Read build number from build.txt (dev. updates)

This commit is contained in:
Roman Shevchenko
2011-10-11 02:15:21 +02:00
parent d458f37e7f
commit 636855a7b9
3 changed files with 48 additions and 18 deletions
+36 -5
View File
@@ -2,8 +2,31 @@ import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
target('default' : "Developers update") {
layoutFull(home, deploy)
target('default': "Developers update") {
def patchedDescriptorDir = patchAppDescriptor(deploy)
layoutFull(home, deploy, patchedDescriptorDir)
ant.delete(dir: patchedDescriptorDir)
}
String appInfoFileName() {
return "idea/IdeaApplicationInfo.xml"
}
String patchAppDescriptor(String targetDirectory) {
def patchedDirectory = "${targetDirectory}/../patched"
ant.delete(dir: patchedDirectory)
layout(patchedDirectory) {
module("community-resources") {
include(name: appInfoFileName())
}
}
ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_NUMBER__", value: "IC-$snapshot")
ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_DATE__", value: new Date().format("yyyyMMddHHmm"))
return patchedDirectory
}
private List platformImplementationModules() {
@@ -29,7 +52,7 @@ private List<String> platformApiModules() {
return ["core-api", "platform-api", "lvcs-api", "lang-api", "vcs-api", "usageView", "xdebugger-api", "xml-openapi"]
}
def layoutFull(String home, String targetDirectory) {
def layoutFull(String home, String targetDirectory, String patchedDescriptorDir = null) {
project.stage("layout to $targetDirectory")
//noinspection GroovyAssignabilityCheck
@@ -89,11 +112,19 @@ def layoutFull(String home, String targetDirectory) {
implementationModules.each { module it}
}
jar("bootstrap.jar") { module("bootstrap")}
jar("bootstrap.jar") { module("bootstrap") }
jar("resources.jar") {
module("resources")
module("platform-resources")
module("community-resources")
module("community-resources") {
if (patchedDescriptorDir != null) {
exclude(name: appInfoFileName())
}
}
if (patchedDescriptorDir != null) {
fileset(dir: patchedDescriptorDir)
}
}
jar("idea_rt.jar") { module("java-runtime")}
+2 -2
View File
@@ -22,6 +22,7 @@
<macrodef name="run">
<attribute name="script"/>
<attribute name="deploy"/>
<sequential>
<java failonerror="true" classname="org.apache.tools.ant.Main" fork="true">
<jvmarg line="-Xms64m -Xmx512m"/>
@@ -52,12 +53,11 @@
<pathelement location="${project.home}/lib/jna.jar"/>
</classpath>
</java>
</sequential>
</macrodef>
<target name="layout">
<run script="${project.home}/build/scripts/layouts.gant"
deploy="${project.home}/out/deploy"/>
deploy="${project.home}/out/deploy"/>
</target>
</project>
@@ -493,22 +493,21 @@ public class ApplicationInfoImpl extends ApplicationInfoEx implements JDOMExtern
myEssentialPluginsIds = ArrayUtil.toStringArray(essentialPluginsIds);
}
private static GregorianCalendar parseDate(String dateString) {
int year = 0;
int month = 0;
int day = 0;
private static GregorianCalendar parseDate(final String dateString) {
@SuppressWarnings("MultipleVariablesInDeclaration")
int year = 0, month = 0, day = 0, hour = 0, minute = 0;
try {
year = Integer.parseInt(dateString.substring(0, 4));
month = Integer.parseInt(dateString.substring(4, 6));
day = Integer.parseInt(dateString.substring(6, 8));
if (dateString.length() > 8) {
hour = Integer.parseInt(dateString.substring(8, 10));
minute = Integer.parseInt(dateString.substring(10, 12));
}
}
catch (Exception ex) {
//ignore
}
if (month > 0) {
month--;
}
return new GregorianCalendar(year, month, day);
catch (Exception ignore) { }
if (month > 0) month--;
return new GregorianCalendar(year, month, day, hour, minute);
}
public void writeExternal(Element element) throws WriteExternalException {