Skip to content

Instantly share code, notes, and snippets.

@cbeams
Last active March 24, 2016 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbeams/fd99fe9db59e92f4941d to your computer and use it in GitHub Desktop.
Save cbeams/fd99fe9db59e92f4941d to your computer and use it in GitHub Desktop.

In this build, only the ':foo' subproject has had the java plugin applied.

As expected, only the ':foo' project has java-plugin related tasks, e.g. assemble.

However, both the ':foo' and ':foo:bar' subprojects have source sets configured.

Why does the ':foo:bar' subproject have source sets at all? Is this a bug?


$ gradle --version
[...]
Gradle 2.12

$ gradle projects
-----------------------------------------
--- root project 'my-project'
---
--- tasks: []
-----------------------------------------

-----------------------------------------
--- project ':foo'
---
--- tasks: [task ':foo:assemble', task ':foo:buildDependents', task ':foo:buildNeeded', task ':foo:check', task ':foo:classes', task ':foo:compileJava', task ':foo:compileTestJava', task ':foo:jar', task ':foo:javadoc', task ':foo:processResources', task ':foo:processTestResources', task ':foo:test', task ':foo:testClasses']
--- sourceSets: [source set 'main', source set 'test']
-----------------------------------------

-----------------------------------------
--- project ':foo:bar'
---
--- tasks: []
--- sourceSets: [source set 'main', source set 'test']
-----------------------------------------

:projects

------------------------------------------------------------
Root project
------------------------------------------------------------

Root project 'my-project'
\--- Project ':foo'
     \--- Project ':foo:bar'

To see a list of the tasks of a project, run gradle <project-path>:tasks
For example, try running gradle :foo:tasks

BUILD SUCCESSFUL

Total time: 0.766 secs
project(':') {
// nothing
}
project(':foo') {
apply plugin: 'java'
}
project(':foo:bar') {
// nothing
}
allprojects {
println "-----------------------------------------"
println "--- $project"
println "---"
println "--- tasks: ${project.tasks}"
if (project.hasProperty('sourceSets'))
println "--- sourceSets: ${project.sourceSets}"
println "-----------------------------------------"
println ""
}
include 'foo:bar'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment