提交 4148226f authored 作者: Thomas Mueller's avatar Thomas Mueller

automate release process

上级 2e6c30d6
@echo off @echo off
echo %time:~0,8% echo %time:~0,8% Start
rem == Change version and build number in Constants.java rem == Change version and build number in Constants.java
rem == Maybe increase TCP_DRIVER_VERSION (old clients must be compatible!) rem == Maybe increase TCP_DRIVER_VERSION (old clients must be compatible!)
...@@ -8,7 +8,6 @@ rem == Update the newsfeed ...@@ -8,7 +8,6 @@ rem == Update the newsfeed
rem == No " Message.get" (must be "throw Message.get") rem == No " Message.get" (must be "throw Message.get")
rem == Documentation: check if all Javadoc files are in the index rem == Documentation: check if all Javadoc files are in the index
rem == Check that is no TODO in the docs rem == Check that is no TODO in the docs
rem == Check code coverage rem == Check code coverage
rem == Run regression test with JDK 1.4 and 1.5 rem == Run regression test with JDK 1.4 and 1.5
rem == Use latest versions of other dbs rem == Use latest versions of other dbs
...@@ -27,51 +26,31 @@ mkdir ..\h2web ...@@ -27,51 +26,31 @@ mkdir ..\h2web
rmdir /s /q bin 2>nul rmdir /s /q bin 2>nul
rmdir /s /q temp 2>nul rmdir /s /q temp 2>nul
call java14 >nul 2>nul call java14 >nul 2>nul
call build -quiet compile call build -quiet
call build -quiet spellcheck
call build jarClient
call build -quiet jar
call build -quiet javadocImpl
call java16 >nul 2>nul call java16 >nul 2>nul
call build -quiet compile call build -quiet compile
set classpath= call build -quiet spellcheck javadocImpl jarClient
call build -quiet javadoc
call build -quiet javadocImpl
echo %time:~0,8% JDK 1.4
call java14 >nul 2>nul call java14 >nul 2>nul
call build -quiet compile call build -quiet compile
call java16 >nul 2>nul call build -quiet installer mavenDeployCentral
call build -quiet compile
rem call java14 >nul 2>nul rem call build -quiet compile benchmark
rem call build -quiet benchmark
rem == Copy the benchmark results and update the performance page and diagram rem == Copy the benchmark results and update the performance page and diagram
call build -quiet docs
soffice.exe -invisible macro:///Standard.Module1.H2Pdf
call java14 >nul 2>nul
call build -quiet all
copy ..\h2web\h2.pdf docs >nul
xcopy /s /q /y dataWeb ..\h2web >nul
call build -quiet zip
makensis /v2 src/installer/h2.nsi
call build -quiet mavenDeployCentral
call java16 >nul 2>nul call java16 >nul 2>nul
call build -quiet compile call build -quiet switchSource
ren ..\h2web h2web-%today% ren ..\h2web h2web-%today%
echo %time:~0,8%
echo %time:~0,8% Done
rem == Test with Hibernate rem == Test with Hibernate
rem == Run FindBugs rem == Run FindBugs
rem == Check docs, versions and links in main, downloads, build numbers
rem == Check if missing javadocs rem == Check if missing javadocs
rem == Check jar file size rem == Test installer
rem == Check dataWeb/index.html, versions and links in main, downloads, build
rem == Check the pdf file is in h2/docs rem == Check the pdf file is in h2/docs
rem == Check in the PDF file: rem == Check in the PDF file:
rem == - footer rem == - footer
...@@ -79,14 +58,10 @@ rem == - front page ...@@ -79,14 +58,10 @@ rem == - front page
rem == - orphan control rem == - orphan control
rem == - check images rem == - check images
rem == - table of contents rem == - table of contents
rem == Test Console rem == Test Console
rem == Test all languages rem == Test all languages
rem == Scan for viruses rem == Scan for viruses
rem == Upload to SourceForge rem == Upload to SourceForge
rem == svn commit rem == svn commit
rem == svn copy: /svn/trunk /svn/tags/version-1.0.x; Version 1.0.x (yyyy-mm-dd) rem == svn copy: /svn/trunk /svn/tags/version-1.0.x; Version 1.0.x (yyyy-mm-dd)
rem == Newsletter: prepare (always to BCC!!) rem == Newsletter: prepare (always to BCC!!)
...@@ -95,3 +70,4 @@ rem == Newsletter: send (always to BCC!!) ...@@ -95,3 +70,4 @@ rem == Newsletter: send (always to BCC!!)
rem == Add to freshmeat rem == Add to freshmeat
rem == http://en.wikipedia.org/wiki/H2_%28DBMS%29 (change version) rem == http://en.wikipedia.org/wiki/H2_%28DBMS%29 (change version)
rem == http://www.heise.de/software/ rem == http://www.heise.de/software/
rem == http://code.google.com/p/h2database/issues/list
...@@ -25,14 +25,6 @@ public class Build extends BuildBase { ...@@ -25,14 +25,6 @@ public class Build extends BuildBase {
new Build().run(args); new Build().run(args);
} }
/**
* Create the jar file and generate the documentation.
*/
public void all() {
jar();
docs();
}
/** /**
* Run the benchmarks. * Run the benchmarks.
*/ */
...@@ -89,12 +81,19 @@ public class Build extends BuildBase { ...@@ -89,12 +81,19 @@ public class Build extends BuildBase {
compile(true, false); compile(true, false);
} }
private void compile(boolean debugInfo, boolean clientOnly) { /**
* Switch the source code to the current JDK.
*/
public void switchSource() {
try { try {
SwitchSource.main(new String[] { "-dir", "src", "-auto" }); SwitchSource.main(new String[] { "-dir", "src", "-auto" });
} catch (IOException e) { } catch (IOException e) {
throw new Error(e); throw new Error(e);
} }
}
private void compile(boolean debugInfo, boolean clientOnly) {
switchSource();
clean(); clean();
mkdir("temp"); mkdir("temp");
resources(clientOnly); resources(clientOnly);
...@@ -179,6 +178,27 @@ public class Build extends BuildBase { ...@@ -179,6 +178,27 @@ public class Build extends BuildBase {
return getStaticValue("org.h2.engine.Constants", "getVersion"); return getStaticValue("org.h2.engine.Constants", "getVersion");
} }
/**
* Create the h2.zip file and the Windows installer.
*/
public void installer() {
jar();
docs();
exec("soffice", new String[]{"-invisible", "macro:///Standard.Module1.H2Pdf"});
copy("docs", getFiles("../h2web/h2.pdf"), "../h2web");
delete("docs/html/onePage.html");
FileList files = getFiles("../h2").keep("../h2/build.*");
files.addAll(getFiles("../h2/bin").keep("../h2/bin/h2.*"));
files.addAll(getFiles("../h2/docs"));
files.addAll(getFiles("../h2/service"));
files.addAll(getFiles("../h2/src"));
zip("../h2web/h2.zip", files, "../", false, false);
exec("makensis", new String[]{"/v2", "src/installer/h2.nsi"});
String buildDate = getStaticField("org.h2.engine.Constants", "BUILD_DATE");
writeFile(new File("../h2web/h2-" + buildDate + ".zip"), readFile(new File("../h2web/h2.zip")));
writeFile(new File("../h2web/h2-setup-" + buildDate + ".exe"), readFile(new File("../h2web/h2-setup.exe")));
}
/** /**
* Create the regular h2.jar file. * Create the regular h2.jar file.
*/ */
...@@ -210,7 +230,10 @@ public class Build extends BuildBase { ...@@ -210,7 +230,10 @@ public class Build extends BuildBase {
exclude("*.bat"). exclude("*.bat").
exclude("*.sh"). exclude("*.sh").
exclude("*.txt"); exclude("*.txt");
jar("bin/h2client.jar", files, "temp"); long kb = jar("bin/h2client.jar", files, "temp");
if (kb < 300 || kb > 350) {
throw new Error("Expected file size 300 - 350 KB, got: " + kb);
}
} }
/** /**
...@@ -349,17 +372,4 @@ public class Build extends BuildBase { ...@@ -349,17 +372,4 @@ public class Build extends BuildBase {
java("org.h2.build.doc.SpellChecker", null); java("org.h2.build.doc.SpellChecker", null);
} }
/**
* Create the h2.zip file.
*/
public void zip() {
delete("docs/html/onePage.html");
FileList files = getFiles("../h2").keep("../h2/build.*");
files.addAll(getFiles("../h2/bin").keep("../h2/bin/h2.*"));
files.addAll(getFiles("../h2/docs"));
files.addAll(getFiles("../h2/service"));
files.addAll(getFiles("../h2/src"));
zip("../h2.zip", files, "../", false, false);
}
} }
...@@ -552,10 +552,12 @@ public class BuildBase { ...@@ -552,10 +552,12 @@ public class BuildBase {
* @param destFile the target file name * @param destFile the target file name
* @param files the file list * @param files the file list
* @param basePath the base path * @param basePath the base path
* @return the size of the jar file in KB
*/ */
protected void jar(String destFile, List files, String basePath) { protected long jar(String destFile, List files, String basePath) {
long kb = zipOrJar(destFile, files, basePath, false, false, true); long kb = zipOrJar(destFile, files, basePath, false, false, true);
println("Jar " + destFile + " (" + kb + " KB)"); println("Jar " + destFile + " (" + kb + " KB)");
return kb;
} }
/** /**
......
...@@ -29,7 +29,7 @@ public class WebSite { ...@@ -29,7 +29,7 @@ public class WebSite {
"<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>"; "<script type=\"text/javascript\">var pageTracker=_gat._getTracker(\"UA-2351060-1\");pageTracker._initData();pageTracker._trackPageview();</script>";
private String sourceDir = "docs"; private String sourceDir = "docs";
private String targetDir = "dataWeb"; private String targetDir = "../h2web";
/** /**
* This method is called when executing this application from the command * This method is called when executing this application from the command
...@@ -44,7 +44,7 @@ public class WebSite { ...@@ -44,7 +44,7 @@ public class WebSite {
private void run() throws Exception { private void run() throws Exception {
deleteRecursive(new File(targetDir)); deleteRecursive(new File(targetDir));
copy(new File(sourceDir), new File(targetDir)); copy(new File(sourceDir), new File(targetDir));
Newsfeed.main(new String[] {"dataWeb/html"}); Newsfeed.main(new String[] {targetDir + "/html"});
} }
private void deleteRecursive(File dir) { private void deleteRecursive(File dir) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论