I'm trying to set-up a Gradle build of a project that I'm working on.
That project called "ProjectC" depends on "ProjectA" and "ProjectB" that are 
jars taken from a mount point at "/mnt/build/lib" the folder structure is like:

/mnt/build/lib/ProjectA/lib_ProjectA.jar

So I declared a flatDirResolver in this way:

usePlugin 'java'

root = '/mnt/build/lib/'

repositories{
 flatDir name: 'projects', dirs: root
 projects.addArtifactPattern(root+"[module]/lib_[module].[ext]")
}

dependencies {
  compile 'ProjectA'
  compile 'ProjectB'
}

compile.srcDirs = [new File("src/lib"), new File("src/lib_bridge")]

However the build fails with this exception:

A problem occurred evaluating root project 'ProjectC'.
Cause: java.lang.NullPointerException (no error message)

Exception is:
org.gradle.api.GradleScriptException: Build file 
'/home/alexyz/workspace/ProjectC/build.gradle' line: 11
A problem occurred evaluating root project 'ProjectC'.
        at 
org.gradle.configuration.DefaultProjectEvaluator.evaluate(DefaultProjectEvaluator.java:66)
        at 
org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:627)
        at 
org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:62)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

How can I modify the build file to be able to compile the project?

Thanks and regards,
Alessandro

Reply via email to