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

unable configure source folder structure and unable minify JS #153

Open Prabh2k7 opened 6 years ago

Prabh2k7 commented 6 years ago

when I try to include js plugin into existing gradle script, I am facing below issue. I am manage to create war through gradle-4.2.1 without Js plugin.

script:

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'war'
archivesBaseName = "idcapture"
version = '1.0' 
webAppDirName = 'WebContent'
buildDir = 'gradle_Build'

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "com.eriwen:gradle-js-plugin:1.12.1"
  }
}
apply plugin: "com.eriwen.gradle.js"
javascript.source {
    dev {
        js {
            srcDir ''WebContent/js''
            include "*.js"
            exclude "*.min.js"
        }
    }
}
 sourceSets {
  main {
     java {
          srcDir 'src'
     }
     resources {
       srcDir 'conf'
     }
  } 
}
dependencies {
  compile fileTree(dir: "WebContent/WEB-INF/lib", include: '*.jar')
   } 

Error I am getting while creating war :+1: **What went wrong: problem occurred evaluating root project 'mywebapp'. Could not create an instance of type com.eriwen.gradle.js.source.internal.DefaultJavaScriptSourceSet_Decorated.

Could not find matching constructor for: org.gradle.api.internal.file.DefaultSourceDirectorySet(java.lang.String, java.lan**

PFA, my project folder structure.

capture1 jsfolders