duplication reduced: call JARs reordering from a single place
authornik <Nikolay.Chashnikov@jetbrains.com>
Wed, 24 Jun 2015 13:16:38 +0000 (16:16 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Thu, 25 Jun 2015 05:36:12 +0000 (08:36 +0300)
build/scripts/layouts.gant
build/update.xml

index 65e87e5844d5e3450fde9f9c375c6549e14c9405..a8d23b4de88b3b7d55e3a3e14b714b49a5a49201 100644 (file)
@@ -18,6 +18,7 @@ import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
 includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
 
 target('default': "Developers update") {
+  loadProjectFromPath(home)
   def patchedDescriptorDir = patchAppDescriptor(deploy)
   layoutFull(home, deploy, patchedDescriptorDir)
   ant.delete(dir: patchedDescriptorDir)
@@ -261,7 +262,7 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
 
   printUnusedModules(info.usedModules)
 
-  //reorder(targetDirectory)
+  reorder(home, targetDirectory)
   return info
 }
 
@@ -681,17 +682,15 @@ def moduleOptional(String name, Closure init) {
 }
 
 def reorder(String home, String targetDirectory) {
-  if (findModule("util") != null) {
-    ant.java(classname: "com.intellij.util.io.zip.ReorderJarsMain", fork: "true") {
-      arg(value: "$home/build/order.txt")
-      arg(value: targetDirectory)
-      arg(value: targetDirectory)
-      arg(value: "$home/lib")
-      classpath {
-        pathelement(location: projectBuilder.moduleOutput(findModule("util")))
-        pathelement(location: projectBuilder.moduleOutput(findModule("util-rt")))
-        pathelement(location: "$home/lib/jna.jar")
-        pathelement(location: "$home/lib/trove4j.jar")
+  projectBuilder.info("Reordering JARs in $targetDirectory")
+  ant.java(classname: "com.intellij.util.io.zip.ReorderJarsMain", fork: true, failonerror: true) {
+    arg(value: "${home}/build/order.txt")
+    arg(value: targetDirectory)
+    arg(value: targetDirectory)
+    arg(value: "${home}/lib")
+    classpath {
+      projectBuilder.moduleRuntimeClasspath(findModule("util"), false).each {
+        pathelement(location: it)
       }
     }
   }
index ae4871b2eb6b4c66eea770b09c7fb23397205e2f..adbc5c5faa0bdab3b75116c29fb969b2399658ef 100644 (file)
         <arg value="-f"/>
         <arg value="gant.xml"/>
       </java>
-
-      <java classname="com.intellij.util.io.zip.ReorderJarsMain" fork="true">
-        <jvmarg line="-Djava.awt.headless=true"/>
-        <arg value="${build}/order.txt"/>
-        <arg value="@{deploy}"/>
-        <arg value="@{deploy}"/>
-        <arg value="${project.home}/lib"/>
-        <classpath>
-          <pathelement location="${modules.output}/production/util-rt"/>
-          <pathelement location="${modules.output}/production/util"/>
-          <pathelement location="${project.home}/lib/jna.jar"/>
-          <pathelement location="${project.home}/lib/trove4j.jar"/>
-        </classpath>
-      </java>
     </sequential>
   </macrodef>