On Fri, Mar 26, 2010 at 8:36 PM, mjparme <[email protected]> wrote:
>
> I am new to Gradle and to help learn it I am trying to get one of my
> projects
> currently built with ANT to build with Gradle. I can't even get the project
> to compile with Gradle. My project is laid out like this:
>
> projectroot/
> --lib
> --src
> ----java
> --test
> ----java
>
> The lib directory contains all the dependent jars needed to build the
> project. I have included the contents of my build.gradle file. Gradle
> fails
> to find all the jars needed (compiler fails as it can't find the classes
> from the jar files). It does however find the source files based on my
> custom sourceSets.
>
> usePlugin 'java'
>
> dependencies {
> runtime fileTree(dir: 'lib', includes: ['*.jar'])
> }
>
Gradle can only deal with file collections as arguments for a configuration.
dependencies {
runtime files(fileTree(...))
}
The logic behind that behavior is that a file tree preserves the hierarchy
whereas a file collection is a flat list of file. The files method flattens
a file tree. But this is such a common scenario, that we should accept file
trees as well and automatically turn them into a file collection.
- Hans
--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz
>
> sourceSets {
> main {
> java {
> srcDir 'src/java'
> }
> }
>
> test {
> java {
> srcDir 'test/java'
> }
> }
> }
>
> What am I missing? Could anyone offer any insight?
>
> Thanks!
> --
> View this message in context:
> http://old.nabble.com/Compile-using-jars-from-a-lib-directory-tp28047035p28047035.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>