java - Gradle exclude module for Copy task -


i have copy task set follow:

task copytolib( type: copy ) {    "$builddir/myapp/lib"    configurations.runtime     // want jars files go in lib folder    exclude "*.exe"    exclude "*.bat"    exclude "*.cmd"    exclude "*.dll"     // exclude lib    exclude group: "org.slf4j", name: "slf4j-api", version: "1.6.2" } 

and i'm getting following error:

could not find method exclude() arguments [{group=org.slf4j, name=slf4j-api, version=1.6.2}] on task ':copytolib' of type org.gradle.api.tasks.copy 

i have feeling it's syntax issue, hint?

exclude group: exclude group: org.slf4j

exclude module: exclude module: slf4j-api

exclude file name: exclude { it.file.name.contains('slf4j-api') }

exclude file: exclude "slf4j-api.jar"

you can exclude group , module needs go configurations exclude this. it's gonna restrict configuration before copying.

task copytolib( type: copy ) {     "$builddir/myapp/lib"     configurations.runtime {         exclude group: 'org.slf4j'     }      // want jars files go in lib folder     exclude "*.exe"     exclude "*.bat"     exclude "*.cmd"     exclude "*.dll"  } 

and remember make sure directory exists $builddir/myapp/lib

and maybe instead of excluding other files include jars?


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -