Skip to content

Commit

Permalink
GEODE-6400: Enable third-parties to consume Geode via Gradle composit…
Browse files Browse the repository at this point in the history
…e build.

* Expose geode-assembly configuration compositeTarget to allow tgz
consumption via 'targetConfiguration' in dependency declarations.
* Explicitly chain root tasks to subprojects: clean, check, test
* Multiple improvements using deferred initialization of task objects.
* Proper task-input specification
* Use of CopySpec objects for modularity/reuse and readability of
distribution contents
* Extract 'checkPom' tasks to its own gradle file for inclusion with out
publish.gradle
* Update dependency declarations and comments
* `geode-assembly` is not a Java project, does not depend on a BOM, and
should not be configured by publish.gradle.  Extraction of
publish.gradle to not be invasive belongs to future work GEODE-6383.

Co-authored-by: Patrick Rhomberg <[email protected]>
Co-authored-by: Robert Houghton <[email protected]>
  • Loading branch information
robbadler and PurelyApplied committed Mar 29, 2019
1 parent e454e6e commit 203aac1
Show file tree
Hide file tree
Showing 9 changed files with 400 additions and 367 deletions.
5 changes: 0 additions & 5 deletions boms/geode-all-bom/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@
<artifactId>istack-commons-runtime</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,10 @@ if (project.hasProperty('askpass')) {
}
}
}

// Explicitly chain generic tasks -- composite builds do not cascade these tasks by default.
['clean', 'check', 'test'].each { chainedTask ->
rootProject.tasks.named(chainedTask).configure {
dependsOn(subprojects*.tasks*.named(chainedTask))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class DependencyConstraints implements Plugin<Project> {
static private Map<String, String> initExternalDependencies() {
Map<String,String> deps = new HashMap<>()
// These versions are consumed beyond the scope of source set dependencies.

// These version numbers are consumed by :geode-modules-assembly:distAppServer filtering
// Some of these are referenced above as well
// Some of these are referenced below as well
deps.put("antlr.version", "2.7.7")
deps.put("commons-io.version", "2.6")
deps.put("commons-lang3.version", "3.8.1")
Expand All @@ -44,12 +44,11 @@ class DependencyConstraints implements Plugin<Project> {
deps.put("micrometer.version", "1.1.3")
deps.put("shiro.version", "1.4.0")
deps.put("slf4j-api.version", "1.7.25")
deps.put("android-json.version", "0.0.20131108.vaadin1")

// These version numbers are used in testing various versions of tomcat and are consumed explicitly
// in will be called explicitly in the relevant extensions module, and respective configurations
// in geode-assembly.gradle. Moreover, dependencyManagement does not seem to place nicely when
// specifying @zip in a dependency, in the manner in which we consume them in custom configurations.
// in geode-assembly.gradle. Moreover, dependencyManagement does not seem to play nicely when
// specifying @zip in a dependency, the manner in which we consume them in custom configurations.
// This would possibly be corrected if they were proper source sets.
deps.put("tomcat6.version", "6.0.37")
deps.put("tomcat7.version", "7.0.90")
Expand All @@ -67,7 +66,6 @@ class DependencyConstraints implements Plugin<Project> {
deps.put("protobuf-java.version", "3.6.1")

// These versions are referenced in test.gradle, which is aggressively injected into all projects.
// This results in brittle behavior compared to dependency-management.gradle"s "opt-in" plugin style.
deps.put("junit.version", "4.12")
deps.put("cglib.version", "3.2.9")
return deps
Expand Down Expand Up @@ -102,7 +100,6 @@ class DependencyConstraints implements Plugin<Project> {
api(group: 'com.mockrunner', name: 'mockrunner-servlet', version: '1.1.2')
api(group: 'com.sun.activation', name: 'javax.activation', version: '1.2.0')
api(group: 'com.sun.istack', name: 'istack-commons-runtime', version: '2.2')
api(group: 'com.vaadin.external.google', name: 'android-json', version: '0.0.20131108.vaadin1')
api(group: 'com.zaxxer', name: 'HikariCP', version: '3.2.0')
api(group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.3')
api(group: 'commons-collections', name: 'commons-collections', version: '3.2.2')
Expand Down
Loading

0 comments on commit 203aac1

Please sign in to comment.