Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add clean task - Task 'clean' not found

Tags:

gradle

I am using https://github.com/eriwen/gradle-js-plugin and i would like to be able run task 'clean'. When i run 'gradle -d clean', it gives the following error

Task 'clean' not found in root project 

To my understanding, gradle comes with task - 'clean', however the gradles-js-plugin doesn't seem to support that at this time or something. How do i add the task 'clean'?

Here is my build.gradle:

// Pull the plugin from Maven Central buildscript {     repositories {         mavenCentral()     }     dependencies {         classpath 'com.eriwen:gradle-js-plugin:1.5.0'     } } // Invoke the plugin apply plugin: 'js'  def jsSrcDir = 'public/js'  javascript.source {     dev {         js {             srcDir jsSrcDir             include "*.js"             exclude "*.min.js"         }     }     prod {         js {             srcDir jsSrcDir             include "*.min.js"         }     } }  combineJs{     source = fileTree(javascript.source.dev.js.files)     dest = file("${buildDir}/all.js") } 
like image 582
latvian Avatar asked Jun 13 '13 13:06

latvian


1 Answers

The clean task is introduced by the base plugin. So you need to apply this plugin to get the clean task and the clean task rules for cleaning up specific task outputs:

apply plugin:'base' 
like image 135
Rene Groeschke Avatar answered Sep 28 '22 00:09

Rene Groeschke