I am working on a java ant+ivy based project that has the following directory structure:
projectRoot/src projectRoot/classes projectRoot/conf projectRoot/webservices
this works perfectly well in ant but I am looking to migrate to gradle.
Is there a way to define a non-maven directory structure in Gradle or should I be looking to mavenize?
When Gradle is unable to communicate with the Gradle daemon process, the build will immediately fail with a message similar to this: $ gradle help Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details FAILURE: Build failed with an exception.
buildSrc is a separate build whose purpose is to build any tasks, plugins, or other classes which are intended to be used in build scripts of the main build, but don't have to be shared across builds.
Configuration inheritance and composition For example the testImplementation configuration extends the implementation configuration. The configuration hierarchy has a practical purpose: compiling tests requires the dependencies of the source code under test on top of the dependencies needed write the test class.
The Gradle dependency cache consists of two storage types located under GRADLE_USER_HOME/caches : A file-based store of downloaded artifacts, including binaries like jars as well as raw downloaded meta-data like POM files and Ivy files.
It is very easy with Gradle to adapt to any directory structure. See the Working with source sets section of the Gradle User Guide.
Example with non-standard project directory structure (custom layout):
sourceSets { main { java { srcDir 'sources/main/java' } outputDir = file("$workDir/client/program") // For older version (now deprecated): //output.classesDir = "$workDir/client/program" } test { java { srcDir 'sources/test/java' } outputDir = file("$workDir/client/tests") // For older versions (now deprecated): //output.classesDir = "$workDir/client/tests" //output.resourcesDir = "$workDir/client/tests" } resources { srcDirs 'sources/test/res' } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With