Skip to content

Commit

Permalink
Deprecating js task
Browse files Browse the repository at this point in the history
  • Loading branch information
eriwen committed Mar 10, 2012
1 parent 0399426 commit f0be9a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/groovy/com/eriwen/gradle/js/tasks/JsTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@ class JsTask extends DefaultTask {
final String outputPath = (outputFiles[0] as File).canonicalPath
final String tempPath = "${tempDir.canonicalPath}/${COMBINED_JS_FILE}"

def deprecationMessage = """
The js is deprecated and will be removed in the next version of the Gradle JS plugin.
It is recommended to use Gradle 1.0m9+ ability to reference other tasks' outputs like so:
combineJs {
source = ["foo.js", "bar.js"]
dest = "all.js"
}
task minify(type: MinifyJsTask) {
source = combineJs.outputs
dest = "all-min.js"
}
"""

logger.warn(deprecationMessage)

if (outputFiles.size() != 1) {
throw new IllegalArgumentException('Output must be exactly 1 File object. Example: outputs.file = file("myFile")')
}
Expand Down

0 comments on commit f0be9a8

Please sign in to comment.