This is an automated email from the ASF dual-hosted git repository.
rhoughton pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-examples.git
The following commit(s) were added to refs/heads/develop by this push:
new c51ce40 Allow custom geode integration (#87)
c51ce40 is described below
commit c51ce40f89391d6660045f940007b7117f752be1
Author: Robert Houghton <[email protected]>
AuthorDate: Wed Oct 30 16:48:01 2019 -0700
Allow custom geode integration (#87)
* Add Gradle option to consume Geode as an includeBuild
Building examples has required a published Geode tgz and jars. Use
Gradle's `includeBuild` feature to allow mapping to a custom Geode clone
for integration and API testing. Invoke with:
`./gradlew -Dcomposite -PgeodeCompositeDirectory=../geode build`
* For composite builds, set JVM memroy options for Geode compilation
---
build.gradle | 16 ++++++++++++++--
gradle/release.gradle | 1 +
gradle/wrapper/gradle-wrapper.properties | 2 +-
settings.gradle | 21 +++++++++++++++++++++
4 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/build.gradle b/build.gradle
index 9bdc417..073ea65 100644
--- a/build.gradle
+++ b/build.gradle
@@ -42,11 +42,17 @@ configurations {
}
dependencies {
- geodeDistribution "org.apache.geode:apache-geode:$geodeVersion@tgz"
-
+ geodeDistribution("org.apache.geode:apache-geode:$geodeVersion@tgz") {
+ if (gradle.usingGeodeCompositeBuild) {
+ targetConfiguration = 'compositeTarget'
+ }
+ }
}
task installGeode(type: Copy) {
+ if (gradle.usingGeodeCompositeBuild) {
+
dependsOn(gradle.includedBuild('geode').task(':geode-assembly:distTar'))
+ }
from tarTree(configurations.geodeDistribution.singleFile)
into buildDir
}
@@ -150,6 +156,12 @@ subprojects {
}
}
}
+ if (gradle.usingGeodeCompositeBuild) {
+ tasks.withType(JavaCompile) {
+ options.fork = true
+ options.forkOptions.jvmArgs += ['-Xmx3g']
+ }
+ }
task runAll(dependsOn: [verifyNoMembersRunning, start, run, stop,
waitForExitingMembers])
start.mustRunAfter verifyNoMembersRunning
diff --git a/gradle/release.gradle b/gradle/release.gradle
index 5b1d677..2a7f7fe 100644
--- a/gradle/release.gradle
+++ b/gradle/release.gradle
@@ -63,6 +63,7 @@ distributions {
exclude 'KEYS'
exclude '**/.gradle'
exclude '**/build/**'
+ exclude '**/out/**'
exclude '**/.project'
exclude '**/.classpath'
exclude '**/.settings/**'
diff --git a/gradle/wrapper/gradle-wrapper.properties
b/gradle/wrapper/gradle-wrapper.properties
index 21818fa..e36600c 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
diff --git a/settings.gradle b/settings.gradle
index c9408ec..57d108d 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -40,3 +40,24 @@ include 'wan'
include 'jdbc'
include 'sessionState'
include 'colocation'
+
+// Logic for defining a custom Geode clone for integration with this project
+// Define `-PgeodeCompositeDirectory` to your geode root, default `../geode`
+// Define `-Dcomposite` to enable Gradle includeBuild feature
+def geodeCompositePropertyName = 'geodeCompositeDirectory'
+def geodePath = hasProperty(geodeCompositePropertyName) ?
geodeCompositeDirectory : '../geode'
+def geodeDirectory = file(geodePath).absolutePath
+def geodeDirectoryExists = file(geodeDirectory).exists()
+def compositeBuildEnabled = System.getProperty("composite") != null
+gradle.ext.usingGeodeCompositeBuild = compositeBuildEnabled &&
geodeDirectoryExists
+
+if (gradle.ext.usingGeodeCompositeBuild) {
+ includeBuild(geodeDirectory) {
+ it.dependencySubstitution {
+ // Any submodule used by examples must should be listed here
+ it.substitute it.module("org.apache.geode:geode-cq") with
it.project(':geode-cq')
+ it.substitute it.module("org.apache.geode:geode-core") with
it.project(':geode-core')
+ it.substitute it.module("org.apache.geode:apache-geode") with
it.project(':geode-assembly')
+ }
+ }
+}