changeset 4031:f78fc2ff7c9a

Gradle build: copy required libraries into .libs for the sake of the IDEs, so they can have references to SWT jar and Antlr and such in order to have no red squiggles
author Richard Bair <richard.bair@oracle.com>
date Fri, 21 Jun 2013 15:03:23 -0700
parents 861cc97175cb
children 72ced9c9c4c0
files build.gradle
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Fri Jun 21 13:44:34 2013 -0700
+++ b/build.gradle	Fri Jun 21 15:03:23 2013 -0700
@@ -869,7 +869,7 @@
         compile name: "plugin"
         compile name: SWT_FILE_NAME
         stubCompile group: "junit", name: "junit", version: "4.8.2",
-            project(":base").sourceSets.test.output, sourceSets.main.output
+        project(":base").sourceSets.test.output, sourceSets.main.output
         antlr3 group: "org.antlr", name: "antlr", version: "3.1.3"
     }
 
@@ -1102,6 +1102,27 @@
     }
     test.dependsOn testWithoutStub, testWithStub
 
+    // To enable the IDEs to all be happy (no red squiggles) we need to have the libraries
+    // available in some known location. Maybe in the future the Gradle plugins to each
+    // of the IDEs will be good enough that we won't need this hack anymore.
+    classes << {
+        // Copy all of the download libraries to .libs for the sake of the IDEs
+        File libsDir = rootProject.file(".libs");
+        if (!libsDir.exists()) {
+            libsDir.mkdirs();
+            for (File f : [configurations.compile.files, configurations.antlr3.files].flatten()) {
+                copy {
+                    into libsDir
+                    from f.getParentFile()
+                    include "**/*swt*.jar"
+                    include "**/antlr-3.1.3.jar"
+                    include "**/stringtemplate-3.2.jar"
+                    include "**/antlr-runtime-3.1.3.jar"
+                    includeEmptyDirs = false
+                }
+            }
+        }
+    }
 }
 
 project(":controls") {
@@ -1558,7 +1579,6 @@
     dependsOn(sdk,publicExports,apps,perf,zips)
 }
 
-
 compileTargets { t ->
     def targetProperties = project.ext[t.upper]
     // The jfxrt task is responsible for creating the jfxrt.jar. A developer may