eriwen / gradle-js-plugin

Gradle plugin for working with JS
http://eriwen.github.io/gradle-js-plugin
Apache License 2.0
382 stars 113 forks source link

Could not get unknown property 'closure' for task of type MinifyJsTask #155

Open avirtual opened 6 years ago

avirtual commented 6 years ago

I'm in a world of pain, trying to get some js files to get minified.

import com.eriwen.gradle.js.tasks.MinifyJsTask
buildscript {
    dependencies {
        classpath "com.eriwen:gradle-js-plugin:2.14.1"
        classpath group: 'com.google.javascript', name: 'closure-compiler', version: 'v20160208'
    }
}

task minJs(type: com.eriwen.gradle.js.tasks.MinifyJsTask) {
    source = "d:/projects/prototype.js"
    dest = "d:/prototype-min.js"
}

If i used GZipTask, it works, on MinifyJsTask it complains about closure. Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'closure' for task ':appframework:minJs' of type com.eriwen.gradle.js.tasks.MinifyJsTask.

I would appreciate any suggestions.

okrasz commented 5 years ago

I have the same issue. The code looks like this:

        tasks.create(name: "minify$extension$index", type: MinifyJsTask) {
            source = srcFile
            dest = targetFile
        }.execute()

and I get:

Could not get unknown property 'closure' for task ':idp.frontend:minifyjs0' of type com.eriwen.gradle.js.tasks.MinifyJsTask

Similar work works with no issue for MinifyCssTask.

okrasz commented 5 years ago

When I downgraded to 1.12.0 it works.

QuentinPin commented 4 years ago

I have the same isssue, somebody have find how to fix it ?