Skip to content

Commit

Permalink
feat(build): adds project properties for composite builds. (#721)
Browse files Browse the repository at this point in the history
This adds flags for the related projects that we bring in
as dependencies, to enable referencing the related project
as a composite build via gradle.

This method of enabling composite builds seems to work
significantly better with IntelliJ. (As opposed to
importing multiple projects into the IDE and configuring
the composite relationship after the fact)

This holds the opinion that all the projects are checked
out in the same parent directory, and can be found at
`'../<projectName>'` relative to this project.

To enable a composite reference to a project, set the
project property `'<projectName>Composite=true'`.

This can be done either as
* a command line flag, e.g. `-PkorkComposite=true`
* a project property via gradle.properties
* a global project property via ~/.gradle/gradle.properties
  • Loading branch information
cfieber committed May 5, 2020
1 parent 9d09664 commit 0c58b0e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,18 @@ fiatVersion=1.18.3
korkVersion=7.41.3
org.gradle.parallel=true
spinnakerGradleVersion=8.0.6

# To enable a composite reference to a project, set the
# project property `'<projectName>Composite=true'`.
#
# This can be done either as
# * a command line flag, e.g. `-PkorkComposite=true`
# * a project property via gradle.properties
# * a global project property via ~/.gradle/gradle.properties
#
# The composite project must checked out in a sibling directory
# to this project, matching the name of the project
# e.g. '../kork'
#
#fiatComposite=true
#korkComposite=true
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
* limitations under the License.
*/

['fiat', 'kork'].each { prj ->
String propName = "${prj}Composite"
String projectPath = "../$prj"
if (settings.ext.has(propName) && Boolean.parseBoolean(settings.ext.get(propName) as String)) {
includeBuild projectPath
}
}

rootProject.name='igor'

include 'igor-bom',
Expand Down

0 comments on commit 0c58b0e

Please sign in to comment.