Commits

shemnon committed 7bd7773

use properties to override signing props

  • Participants
  • Parent commits 3c9a1ab

Comments (0)

Files changed (1)

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

 
         task.conventionMapping.antJavaFXJar = {convention, aware -> convention.getPlugin(JavaFXPluginConvention).antJavaFXJar }
 
-        ['alias', 'keypass', 'keystore', 'storepass', 'storetype'].each { prop ->
+        ['alias', 'keypass', 'storepass', 'storetype'].each { prop ->
             task.conventionMapping[prop]  = {convention, aware ->
                 def jfxc = convention.getPlugin(JavaFXPluginConvention);
-                return jfxc["${jfxc.signingMode}Key"][prop]
+                def props = project.properties
+                def mode = props['javafx.signingMode']  ?: jfxc.signingMode
+                return props?."javafx.${mode}Key.$prop" ?: jfxc?."${mode}Key"?.'prop'
             }
         }
+        task.conventionMapping.keystore  = {convention, aware ->
+            def jfxc = convention.getPlugin(JavaFXPluginConvention);
+            def props = project.properties
+            def mode = props['javafx.signingMode']  ?: jfxc.signingMode
+            String keyFile = props?."javafx.${mode}Key.keystore"
+            return keyFile == null ? jfxc?."${mode}Key"?.keystore : new File(keyFile)
+        }
 
         task.conventionMapping.destdir = {convention, aware -> "$project.libsDir/../signed" as File}