Hello,
I'm trying to write a build script that compiles some classes and put them
togheter with a few resources.
The resources are composed by: all files in the 'images' directory and a few
files in the root directory.

I would like to mantain the same layout also in the resulting jar.

$ cat build.gradle
usePlugin 'java'

version = '4.1.1'

sourceSets {
        main {
                java {
                    srcDir 'src'
                }
                resources {
                    srcDirs 'images'
                    destinationDir file('images')
                }
        }
}

defaultTasks  'jar'

After executing this script I get:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/gbs00819/schemas/build.gradle' line: 12

* What went wrong:
 A problem occurred evaluating root project 'schemaSpy'.
Cause: Could not find method destinationDir() for arguments
[/home/gbs00819/schemas/images] on source set main.

* Try:
Run with -s or -d option to get more details. Run with -S option to get the
full (very verbose) stacktrace.

BUILD FAILED

Total time: 4.16 secs

How can I define to include all file under 'images' preserving the folder?
The script doesn't address the requirement to include some files in the
project's root directory also in the jar. How can I do that?

Thanks and regards,
Alessandro

Reply via email to