changeset 4295:a1f0f26e732e

RT-31640: Exeception throws on any JavaFX program on the Windows (d3d) platform Backed out changeset 142f5a3007a6
author kcr
date Mon, 15 Jul 2013 17:04:32 -0700
parents cce932bdf120
children dc2725737249
files build.gradle buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy
diffstat 2 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Mon Jul 15 15:08:11 2013 -0700
+++ b/build.gradle	Mon Jul 15 17:04:32 2013 -0700
@@ -700,7 +700,6 @@
             if (IS_WINDOWS && t.name == "win") {
                 def rcTask = project.task("rc$capitalName$capitalVariant", type: CompileResourceTask, dependsOn: javahTask, group: "Build") {
                     description = "Compiles native sources for $name"
-                    source(variantProperties.nativeSource)
                     matches = ".*\\.rc|.*\\.cur"
                     output(file("$nativeRootDir/win"))
                 }
--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy	Mon Jul 15 15:08:11 2013 -0700
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy	Mon Jul 15 17:04:32 2013 -0700
@@ -42,9 +42,13 @@
     List<String> params = new ArrayList<String>();
     List sourceRoots = new ArrayList();
     @OutputDirectory File output;
-    @InputFiles List<File> allFiles;
     private final PatternFilterable patternSet = new PatternSet();
 
+    @InputFiles public void setSource(Object source) {
+        sourceRoots.clear();
+        sourceRoots.add(source);
+    }
+
     public NativeCompileTask source(Object... sources) {
         for (Object source : sources) {
             if (source instanceof Collection) {
@@ -53,12 +57,6 @@
                 sourceRoots.add(source);
             }
         }
-        // Combine the different source roots into a single FileCollection based on all files in each source root
-        allFiles = []
-        sourceRoots.each {
-            def dir = project.file(it);
-            allFiles += dir.isDirectory() ? dir.listFiles() : dir;
-        }
         return this;
     }
 
@@ -89,6 +87,12 @@
         }
 
         project.mkdir(output);
+        // Combine the different source roots into a single FileCollection based on all files in each source root
+        def allFiles = [];
+        sourceRoots.each {
+            def dir = project.file(it);
+            allFiles += dir.isDirectory() ? dir.listFiles() : dir;
+        }
         def source = project.files(allFiles);
         final Set<File> files = matches == null ? new HashSet<File>(source.files) : source.filter{it.name.matches(matches)}.files;
         project.logger.info("Compiling native files: $files");