diff --git a/build/scripts/layouts.gant b/build/scripts/layouts.gant index a4740128030d..7d8d4c74b2d7 100644 --- a/build/scripts/layouts.gant +++ b/build/scripts/layouts.gant @@ -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 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")} diff --git a/build/update.xml b/build/update.xml index e16785305ac0..4bdc3584b15c 100644 --- a/build/update.xml +++ b/build/update.xml @@ -22,6 +22,7 @@ + @@ -52,12 +53,11 @@ - + deploy="${project.home}/out/deploy"/> \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java index 89a0459fcdc4..1917063e7d00 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java @@ -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 {