Commits

shemnon committed ff9d1b6

replace instead of set

Comments (0)

Files changed (1)

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

 
 
     private configureJavaFXCSSToBinTask(Project project) {
-        def task = project.task("cssToBin", type: JavaFXCSSToBinTask,
-                description: "Converts CSS to Binary CSS.",
-                group: 'Build')
+        def task = project.tasks.replace("cssToBin", JavaFXCSSToBinTask)
+        task.description =  "Converts CSS to Binary CSS."
+        task.group =  'Build'
 
         task.conventionMapping.distsDir = {convention, aware -> convention.getPlugin(JavaPluginConvention).sourceSets.main.output.resourcesDir}
 
     }
 
     private configureJavaFXJarTask(Project project) {
-        def task = project.task("jfxJar", type: JavaFXJarTask,
-                description: "Adds JavaFX specific packaging to the jar.",
-                group: 'Build',
-                dependsOn: 'jar')
+        def task = project.tasks.replace("jfxJar", JavaFXJarTask)
+        task.description = "Adds JavaFX specific packaging to the jar."
+        task.group = 'Build'
+        task.dependsOn = ['jar']
+        
         project.afterEvaluate {
             project.configurations.archives.artifacts*.builtBy task
         }
         task.conventionMapping.classpath = {convention, aware ->
             FileCollection compileClasspath = project.convention.getPlugin(JavaPluginConvention).sourceSets[SourceSet.MAIN_SOURCE_SET_NAME].compileClasspath;
             Configuration providedCompile = project.configurations[PROVIDED_COMPILE_CONFIGURATION_NAME];
-            FileCollection output = compileClasspath - providedCompile;
+            return compileClasspath - providedCompile;
         }
     }
 
     private configureGenerateDebugKeyTask(Project project) {
-        def task = project.task("generateDebugKey", type: GenKeyTask,
-                description: "Generates the JavaFX Debug Key.",
-                group: 'Build')
+        def task = project.tasks.replace("generateDebugKey", GenKeyTask)
+        task.description = "Generates the JavaFX Debug Key."
+        task.group = 'Build'
 
         project.afterEvaluate {
             task.enabled = task.enabled && project.javafx.debugKey != null
     }
 
     private configureJavaFXSignJarTask(Project project) {
-        def task = project.task("jfxSignJar", type: JavaFXSignJarTask,
-                description: "Signs the JavaFX jars the JavaFX way.",
-                group: 'Build',
-                dependsOn: 'jfxJar')
+        def task = project.tasks.replace("jfxSignJar", JavaFXSignJarTask)
+        task.description = "Signs the JavaFX jars the JavaFX way."
+        task.group = 'Build'
+        task.dependsOn = ['jfxJar']
+        
         project.afterEvaluate {
             project.configurations.archives.artifacts*.builtBy task
             task.enabled = task.enabled && (project.javafx.debugKey != null || project.javafx.releaseKey != null)
     }
 
     private configureJFXCopyLibsTask(Project project) {
-        def task = project.task("jfxCopyLibs")
+        def task = project.tasks.replace("jfxCopyLibs")
 
         task.doLast {
             FileCollection runtimeClasspath = project.convention.getPlugin(JavaPluginConvention).sourceSets[SourceSet.MAIN_SOURCE_SET_NAME].runtimeClasspath;
     }
 
     private configureJFXDeployTask(Project project) {
-        def task = project.task("jfxDeploy", type: JavaFXDeployTask,
-                description: "Processes the JavaFX jars and generates webstart and native packages.",
-                group: 'Build')
+        def task = project.tasks.replace("jfxDeploy", JavaFXDeployTask)
+        task.description = "Processes the JavaFX jars and generates webstart and native packages."
+        task.group = 'Build'
 
         [
                 'antJavaFXJar',
     }
     
     private void configureRunTask(Project project) {
-        JavaExec task = project.task("run", type: JavaExec,
-            description: 'Runs the application.',
-            group: 'Execution')
+        JavaExec task = project.tasks.replace("run", JavaExec)
+        task.description = 'Runs the application.'
+        task.group = 'Execution'
 
         configureRunParams(project, task)
     }
     }
 
     private void configureDebugTask(Project project) {
-        JavaExec task = project.task("debug", type:JavaExec,
-            description: 'Runs the applicaiton and sets up debugging on port 5005.',
-            group: 'Execution')
+        JavaExec task = project.tasks.replace("debug", JavaExec)
+        task.description = 'Runs the applicaiton and sets up debugging on port 5005.'
+        task.group = 'Execution'
 
         configureRunParams(project, task)
         task.debug = true
     }
 
     private void configureScenicViewTask(Project project) {
-        def task = project.task("scenicview", type: DefaultTask,
-                description: 'Adds the ScenicView agent to all Execution Tasks.',
-                group: 'Tools')
+        def task = project.tasks.replace("scenicview", DefaultTask)
+        task.description = 'Adds the ScenicView agent to all Execution Tasks.'
+        task.group = 'Tools'
 
         task.doLast {
             project.configurations {
     }
 
     public void configureConfigurations(ConfigurationContainer configurationContainer) {
-        Configuration provideCompileConfiguration = configurationContainer.add(PROVIDED_COMPILE_CONFIGURATION_NAME).setVisible(false).
-                setDescription("Additional compile classpath for libraries that should not be part of the WAR archive.");
-        Configuration provideRuntimeConfiguration = configurationContainer.add(PROVIDED_RUNTIME_CONFIGURATION_NAME).setVisible(false).
+        Configuration provideCompileConfiguration = configurationContainer.create(PROVIDED_COMPILE_CONFIGURATION_NAME).setVisible(false).
+                setDescription("Additional compile classpath for libraries that should not be part of the bundle.");
+        Configuration provideRuntimeConfiguration = configurationContainer.create(PROVIDED_RUNTIME_CONFIGURATION_NAME).setVisible(false).
                 extendsFrom(provideCompileConfiguration).
-                setDescription("Additional runtime classpath for libraries that should not be part of the WAR archive.");
+                setDescription("Additional runtime classpath for libraries that should not be part of the bundle.");
         configurationContainer.getByName(JavaPlugin.COMPILE_CONFIGURATION_NAME).extendsFrom(provideCompileConfiguration);
         configurationContainer.getByName(JavaPlugin.RUNTIME_CONFIGURATION_NAME).extendsFrom(provideRuntimeConfiguration);
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.