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

No such property: source for class: com.eriwen.gradle.js.JsHintExtension_Decorated #133

Closed IvannaBabchanik closed 8 years ago

IvannaBabchanik commented 8 years ago

HI! I'm trying to include jshint to project and got the error:

No such property: source for class: com.eriwen.gradle.js.JsHintExtension_Decorated My conf file:

buildscript {

    ext {
        springBootVersion = '1.3.3.RELEASE'
    }

    repositories {
        maven { url 'http://nexus/content/repositories/thirdparty/' }
        maven { url 'http://nexus/content/repositories/public/' }
        maven { url 'http://nexus/content/repositories/cura-releases/' }
        maven { url "https://plugins.gradle.org/m2/" }
    }

    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath "com.eriwen:gradle-js-plugin:2.14.1"
    }
}

apply from: '../version.gradle'

apply plugin: "com.eriwen.gradle.js"

javascript.source {
    dev {
        js {
            srcDir "admin/src/main/resources/static/js"
            include "**/*.js"
            exclude "admin/src/main/resources/static/js/lib"
        }
    }
}

jshint {
    tasks.jshint.source = javascript.source.dev.js.files
    tasks.jshint.dest = file("${buildDir}/jshint.out")
    tasks.jshint.reporter = 'checkstyle'
    jshint.options = [expr: "true", unused: "true"]
}

Can someone explain me what I do wrong?

eriwen commented 8 years ago

I'm afraid I can't reproduce the problem. I've created an example project for this issue. Here's a build scan of gradlew jshint working.

Could you please tell me what version of Gradle you're using? Would you consider changing the example project in order to create a reproducible test case?

IvannaBabchanik commented 8 years ago

Hi Eriwen! Thanks for your response. I'm using gradle 2.10. The issue was in wrong puling including (on example of maine page is missing same part of configaration). I copy configuration from your example and everything work fine. Thanks

freshcodemonger commented 6 years ago

Why do you have to declare the properties prefixed with tasks.jshint?

The documentation on the main page makes it look like you can just do jshint { source = }