Commits

shemnon committed 599ee04

Arguments, JVM Arguments, and System Properties. Oh My!

  • Participants
  • Parent commits 9a4fdf2

Comments (0)

Files changed (4)

File plugin/src/main/groovy/com/bitbucket/shemnon/javafxplugin/JavaFXPlugin.groovy

 
         task.conventionMapping.distsDir = {convention, aware -> project.distsDir }
 
+        task.conventionMapping.jvmArgs = {convention, aware -> project.javafx.jvmArgs }
+        task.conventionMapping.systemProperties = {convention, aware -> project.javafx.systemProperties }
+        task.conventionMapping.arguments = {convention, aware -> project.javafx.arguments}
+
         task.dependsOn(project.tasks.getByName("jfxSignJar"))
         project.tasks.getByName("assemble").dependsOn(task)
         project.tasks.getByName("jar").enabled = false
 
         task.classpath = project.sourceSets.main.runtimeClasspath
         task.conventionMapping.main = {convention, aware -> project.javafx.mainClass }
+        task.doFirst {
+            task.jvmArgs project.javafx.jvmArgs
+            task.systemProperties project.javafx.systemProperties
+            if (!task.args) task.args = project.javafx.arguments
+        }
     }
 
     private void configureDebugTask(Project project) {
 
         task.classpath = project.sourceSets.main.runtimeClasspath
         task.conventionMapping.main = {convention, aware -> project.javafx.mainClass }
+        task.doFirst {
+            task.jvmArgs project.javafx.jvmArgs
+            task.systemProperties project.javafx.systemProperties
+            if (!task.args) task.args = project.javafx.arguments
+        }
         task.debug = true
     }
 

File plugin/src/main/groovy/com/bitbucket/shemnon/javafxplugin/JavaFXPluginExtension.groovy

 
     String packaging
 
+    List<String> jvmArgs = []
+    Map<String, String> systemProperties = [:]
+    List<String> arguments = []
+
     public debugKey(Closure closure) {
         debugKey = new SigningKeyInfo(closure)
     }

File plugin/src/main/groovy/com/bitbucket/shemnon/javafxplugin/tasks/JavaFXDeployTask.groovy

             }
         }
 
+        jvmArgs.each { deployParams.addJvmArg(it) }
+        systemProperties.each {k, v -> deployParams.addJvmProperty(k, v)}
+        deployParams.arguments = arguments
 
         PackagerLib packager = new PackagerLib();
         packager.generateDeploymentPackages(deployParams)
     boolean offlineAllowed = true
     String codebase
 
+    List<String> jvmArgs = []
+    Map<String, String> systemProperties = [:]
+    List<String> arguments = []
+
     // deplpy/info attributes
     String category
     String copyright

File samples/FullyExpressed/build.gradle

     mainClass = 'com.bitbucket.shemnon.jfx.sample.fullyexpressed.TheMain'
 
     packaging = 'image'
+
+
+    jvmArgs = ['-XX:+AggressiveOpts', '-XX:CompileThreshold=1']
+    systemProperties = [ 'prism.disableRegionCaching':'true' ]
+    arguments = ['1AC', '1NC', '2AC', '2NC', '1NR', '1AR', '2NR', '2AR']
 }
 
 generateDebugKey {