Skip to content

Commit 511a63a

Browse files
committed
Work around gradle issue and optionally include graalvm project
JAVA-5637
1 parent 8681337 commit 511a63a

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

.evergreen/run-graalvm-native-image-app.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ echo "The Gradle version is"
2222
./gradlew --version
2323

2424
echo "Building and running the GraalVM native image app"
25-
./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} :graalvm-native-image-app:nativeRun
25+
./gradlew -PincludeGraalvm -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} :graalvm-native-image-app:nativeRun

graalvm-native-image-app/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
// Note requires a Gradle project flag `-PincludeGraalvm` (see settings.gradle).
18+
1719
plugins {
1820
id 'application'
1921
id 'org.graalvm.buildtools.native' version '0.9.23'

graalvm-native-image-app/readme.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@ you can specify the connection string used by the `:graalvm-native-image-app:run
6262
Gradle tasks, as well as by the built native application by passing the CLI argument
6363
`-Dorg.mongodb.test.uri="<your connection string>"` to `gradlew` or `NativeImageApp` respectively:
6464

65+
For gradle to include this project in the build you *must* include a project flag: `-PincludeGraalvm`
66+
6567
```bash
66-
./gradlew ... -Dorg.mongodb.test.uri="<your connection string>"
68+
./gradlew ... -PincludeGraalvm -Dorg.mongodb.test.uri="<your connection string>"
6769
```
6870

6971
```bash
70-
./graalvm-native-image-app/build/native/nativeCompile/NativeImageApp -Dorg.mongodb.test.uri="<your connection string>"
72+
./graalvm-native-image-app/build/native/nativeCompile/NativeImageApp -PincludeGraalvm -Dorg.mongodb.test.uri="<your connection string>"
7173
```

gradle/javaToolchain.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ allprojects {
8080
options.encoding = "UTF-8"
8181
options.release.set(17)
8282
}
83-
} else if (project == project(':graalvm-native-image-app')) {
83+
} else if (project.name == 'graalvm-native-image-app') {
8484
tasks.withType(JavaCompile) {
8585
options.encoding = 'UTF-8'
8686
options.release.set(DEFAULT_JDK_VERSION)

gradle/javadoc.gradle

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import static org.gradle.util.CollectionUtils.single
1717
*/
1818

1919

20-
def projectsThatDoNotPublishJavaDocs = project(":util").allprojects + project(":driver-benchmarks") + project("driver-workload-executor") + project("driver-lambda") + project(":graalvm-native-image-app")
21-
def javaMainProjects = subprojects - projectsThatDoNotPublishJavaDocs
20+
def projectNamesThatDoNotPublishJavaDocs =["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util",
21+
"spock", "taglets"]
22+
def javaMainProjects = subprojects.findAll { !projectNamesThatDoNotPublishJavaDocs.contains(it.name) }
2223

2324
task docs {
2425
dependsOn javaMainProjects.collect { it.tasks.withType(Javadoc) + it.tasks.withType(ScalaDoc) }

gradle/publish.gradle

+4-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ ext {
7272
}
7373
}
7474

75-
def projectsNotPublishedToMaven = project(":util").allprojects + project(":driver-benchmarks") + project("driver-workload-executor") + project("driver-lambda") + project(":graalvm-native-image-app")
76-
def publishedProjects = subprojects - projectsNotPublishedToMaven
75+
76+
def projectNamesNotToBePublished = ["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util",
77+
"spock", "taglets"]
78+
def publishedProjects = subprojects.findAll { !projectNamesNotToBePublished.contains(it.name) }
7779
def scalaProjects = publishedProjects.findAll { it.name.contains('scala') }
7880
def javaProjects = publishedProjects - scalaProjects
7981
def projectsWithManifest = publishedProjects.findAll {it.name != 'driver-legacy' }

settings.gradle

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,7 @@ include ':driver-scala'
3232
include ':mongodb-crypt'
3333
include 'util:spock'
3434
include 'util:taglets'
35-
include ':graalvm-native-image-app'
35+
36+
if(hasProperty("includeGraalvm")) {
37+
include ':graalvm-native-image-app'
38+
}

0 commit comments

Comments
 (0)