How to add resources in the source tree to the .jar file?

Thank you, I have something similar working:

resources {
      srcDirs = ['../src/main/resources', '../src/main/groovy']
      include 'com/abinitio/a/b/c/**'
      exclude '**/*.groovy'
    }

If fileTree worked inside sourceSets this could be more precise, but I guess it doesn’t. The doc doesn’t make it clear where fileTree works & where it doesn’t.

The DSL doc on SourceSet (http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.SourceSet.html) doesn’t explain how it works or what can be included in a SourceSet. Include is not mentioned & although it gives an example of exclude, it doesn’t explain, or better yet, specify its behavior (especially its behavior in combination with other things that can occur in a SourceSet declaration).

I’m still glad the doc is there: it is better than nothing. It is not very useful for beginners, however.

1 Like