Multi level project configuration


(Trilok agarwal) #1

settings.gradle

includeFlat “entsec_ldap:java:src:oracle:security:crypto:cert”

entsec_ldap/java/src/oracle/security/crypto/cert/build.gradle

sourceSets {

main {

java {

srcDir ‘project.projectDir’

}

}

}

Have sources under entsec_ldap/java/src/oracle/security/crypto/cert

but doing build from rootProject dir gives

Starting to execute task ‘:entsec_ldap:java:src:oracle:security:crypto:cert:compileJava’ 23:23:23.768 [INFO] [org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter] Skipping task ‘:entsec_ldap:java:src:oracle:security:crypto:cert:compileJava’ as it has no source files. 23:23:23.768 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ‘:entsec_ldap:java:src:oracle:security:crypto:cert:compileJava’ 23:23:23.769 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :entsec_ldap:java:src:oracle:security:crypto:cert:compileJava UP-TO-DATE

How to specify sourceSet in multiproject


(Peter Niederwieser) #2

‘project.projectDir’ isn’t a String. You need to omit the quotes. Or maybe your code got scrambled. Please use HTML ‘<code>’ tags for all code and output.


(Trilok agarwal) #3

entsec & entsec_ldap are directories at same level

entsec/settings.gradle

includeFlat "entsec_ldap:java:src:oracle:security:crypto:cert"

entsec_ldap/java/src/oracle/security/crypto/cert/build.gradle

sourceSets {

main {

java {

srcDir ‘.’

exclude ‘/.ade_path/

}

}

}

}

but gradle build from entsec directory is not able to find the build.gradle file in entsec_ldap/java/src/oracle/security/crypto/cert directory

10:16:37.222 [DEBUG] [org.gradle.configuration.BuildScriptProcessor] Timing: Running the build script took 5.569 secs 10:16:37.621 [INFO] [org.gradle.configuration.BuildScriptProcessor] Evaluating project ‘:entsec_ldap:java:src:oracle:security:crypto:cert’ using empty build file.


(Jon Austen) #4

Interesting. I didn’t know you could embed sub-projects, using the ‘includeFlat’ notation, using colon characters. I knew it works with ‘include’ but I thought ‘includeFlat’ was different. I might need to try that and see if it works. This makes me wonder: what is really the difference between ‘include’ and ‘includeFlat’?


(Trilok agarwal) #5

you may be right, in the sense, includeFlat cannot support “:” semantic, that is the reason gradle is not able to find the build.gradle.


(Peter Niederwieser) #6

Can you describe the directory layout in more detail? Why is ‘build.gradle’ located in ‘entsec_ldap/java/src/oracle/security/crypto/cert’, and not, say, in ‘entsec_ldap’? Also, isn’t ‘entsec_ldap/java/src’ the source root, with ‘oracle/security/crypto/cert’ being (part of) the package name of the code to be compiled?


(Peter Niederwieser) #7

That’s not the problem, but I first have to understand your directory layout. Your ‘includeFlat’ statement is probably not what you want.