diff --git a/.evergreen/run-graalvm-native-image-app.sh b/.evergreen/run-graalvm-native-image-app.sh index 130b0ef7b4..ba24ef764a 100755 --- a/.evergreen/run-graalvm-native-image-app.sh +++ b/.evergreen/run-graalvm-native-image-app.sh @@ -22,4 +22,4 @@ echo "The Gradle version is" ./gradlew --version echo "Building and running the GraalVM native image app" -./gradlew -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} :graalvm-native-image-app:nativeRun +./gradlew -PincludeGraalvm -PjavaVersion=${JAVA_VERSION} -Dorg.mongodb.test.uri=${MONGODB_URI} :graalvm-native-image-app:nativeRun diff --git a/graalvm-native-image-app/build.gradle b/graalvm-native-image-app/build.gradle index 713b8c29a1..b3d7335f9d 100644 --- a/graalvm-native-image-app/build.gradle +++ b/graalvm-native-image-app/build.gradle @@ -14,6 +14,8 @@ * limitations under the License. */ +// Note requires a Gradle project flag `-PincludeGraalvm` (see settings.gradle). + plugins { id 'application' id 'org.graalvm.buildtools.native' version '0.9.23' diff --git a/graalvm-native-image-app/readme.md b/graalvm-native-image-app/readme.md index a659b7d1c0..1fda1453a8 100644 --- a/graalvm-native-image-app/readme.md +++ b/graalvm-native-image-app/readme.md @@ -62,10 +62,12 @@ you can specify the connection string used by the `:graalvm-native-image-app:run Gradle tasks, as well as by the built native application by passing the CLI argument `-Dorg.mongodb.test.uri=""` to `gradlew` or `NativeImageApp` respectively: +For gradle to include this project in the build you *must* include a project flag: `-PincludeGraalvm` + ```bash -./gradlew ... -Dorg.mongodb.test.uri="" +./gradlew ... -PincludeGraalvm -Dorg.mongodb.test.uri="" ``` ```bash -./graalvm-native-image-app/build/native/nativeCompile/NativeImageApp -Dorg.mongodb.test.uri="" +./graalvm-native-image-app/build/native/nativeCompile/NativeImageApp -PincludeGraalvm -Dorg.mongodb.test.uri="" ``` diff --git a/gradle/javaToolchain.gradle b/gradle/javaToolchain.gradle index 187b143eea..f1c779dab3 100644 --- a/gradle/javaToolchain.gradle +++ b/gradle/javaToolchain.gradle @@ -80,7 +80,7 @@ allprojects { options.encoding = "UTF-8" options.release.set(17) } - } else if (project == project(':graalvm-native-image-app')) { + } else if (project.name == 'graalvm-native-image-app') { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' options.release.set(DEFAULT_JDK_VERSION) diff --git a/gradle/javadoc.gradle b/gradle/javadoc.gradle index 8d425b693b..b986747c64 100644 --- a/gradle/javadoc.gradle +++ b/gradle/javadoc.gradle @@ -17,8 +17,9 @@ import static org.gradle.util.CollectionUtils.single */ -def projectsThatDoNotPublishJavaDocs = project(":util").allprojects + project(":driver-benchmarks") + project("driver-workload-executor") + project("driver-lambda") + project(":graalvm-native-image-app") -def javaMainProjects = subprojects - projectsThatDoNotPublishJavaDocs +def projectNamesThatDoNotPublishJavaDocs =["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util", + "spock", "taglets"] +def javaMainProjects = subprojects.findAll { !projectNamesThatDoNotPublishJavaDocs.contains(it.name) } task docs { dependsOn javaMainProjects.collect { it.tasks.withType(Javadoc) + it.tasks.withType(ScalaDoc) } diff --git a/gradle/publish.gradle b/gradle/publish.gradle index f72773c5ad..9add25f926 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -72,8 +72,10 @@ ext { } } -def projectsNotPublishedToMaven = project(":util").allprojects + project(":driver-benchmarks") + project("driver-workload-executor") + project("driver-lambda") + project(":graalvm-native-image-app") -def publishedProjects = subprojects - projectsNotPublishedToMaven + +def projectNamesNotToBePublished = ["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util", + "spock", "taglets"] +def publishedProjects = subprojects.findAll { !projectNamesNotToBePublished.contains(it.name) } def scalaProjects = publishedProjects.findAll { it.name.contains('scala') } def javaProjects = publishedProjects - scalaProjects def projectsWithManifest = publishedProjects.findAll {it.name != 'driver-legacy' } diff --git a/settings.gradle b/settings.gradle index b1c5e185d3..4ebbb10c4e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -32,4 +32,7 @@ include ':driver-scala' include ':mongodb-crypt' include 'util:spock' include 'util:taglets' -include ':graalvm-native-image-app' + +if(hasProperty("includeGraalvm")) { + include ':graalvm-native-image-app' +}