Commits

shemnon committed 200ffa4

Allow java runtime to be specified. i.e. build with JDK8 but ship with JDK7, or vice versa

Comments (1)

Files changed (4)

gradle-javafx-plugin/src/main/groovy/org/bitbucket/shemnon/javafxplugin/JavaFXPlugin.groovy

                 'iconInfos',
                 'id',
                 'installSystemWide',
+                'javaRuntime',
                 'jvmArgs',
                 'licenseType',
                 'mainClass',

gradle-javafx-plugin/src/main/groovy/org/bitbucket/shemnon/javafxplugin/JavaFXPluginExtension.groovy

     Map<String, String> systemProperties = [:]
     List<String> arguments = []
 
+    File javaRuntime
+
     // deploy/info attributes
     String category
     String copyright

gradle-javafx-plugin/src/main/groovy/org/bitbucket/shemnon/javafxplugin/tasks/JavaFXDeployTask.groovy

     Map<String, String> systemProperties = [:]
     List<String> arguments = []
 
+    File javaRuntime
+
     // deploy/info attributes
     String category
     String copyright
         getSystemProperties().each {k, v -> deployParams.addJvmProperty(k, v)}
         deployParams.arguments = getArguments()
 
+        if (getJavaRuntime() != null) {
+            deployParams.javaRuntimeSource = getJavaRuntime()
+        }
+
         File packageResourcesOutput = project.sourceSets['package'].output.resourcesDir
         processIcons(packageResourcesOutput)
 

samples/FullyExpressed/build.gradle

     windows {
         id = 'c533f663-1efd-489f-b910-4c7ec20c7fd0'
         category='JavaFX Demos'
+        javaRuntime = file('C:/Program Files (x86)/Java/jdk1.7.0_21')
     }
 
     macosx {
         id = 'net.java.openjdk.openjfx.Ensemble2'
         category = 'public.app-category.developer-tools'
+        javaRuntime = file('/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/')
     }
 
     linux {
         // linux doesn't care about id, it goes un-used at the moment
         category='Development'
+        javaRuntime='/usr/lib/jvm/java-7-oracle'
     }
 
     debugKey {