Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 44 additions & 8 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,58 @@ Some build tasks require a GraalVM JDK (e.g., tests). You should set `GRAALVM_HO
The Native Build Tools repository is structured as a Gradle multi-project, with the Maven and Gradle plugins declared as subprojects of the root project.
To configure it in your IDE (e.g., IntelliJ IDEA), import the root project, and the IDE should automatically detect and include the subprojects.

## Projects

This repo contains the following projects:

- `native-gradle-plugin` — Gradle plugin that provides support for building and testing GraalVM native images in Gradle builds (tasks, DSL, and functional tests).
- `native-maven-plugin` — Maven plugin that provides support for building and testing GraalVM native images in Maven builds (mojos and functional tests).
- `junit-platform-native` (in `common/`) — JUnit Platform native support used by plugins to run on native image.
- `utils` (in `common/`) — Shared utility code used across the plugins, tests, and internal build logic.
- `graalvm-reachability-metadata` (in `common/`) — Common code related to the [GraalVM reachability metadata](https://github.com/oracle/graalvm-reachability-metadata) repository integration.
- `docs` — Documentation sources and build for the user guide and changelog. Please keep up to date.

Internal build logic (used to build this repository itself):

- `settings-plugins` (in `build-logic`) — Gradle settings plugins and supporting tooling.
- `aggregator` (in `build-logic`) — Composite build that aggregates internal build plugins and conventions.

## Building and Testing

You can use the various commands in the [Gradle build lifecycle](https://docs.gradle.org/current/userguide/build_lifecycle.html) to build and test the project.
Some examples are (all executed from the root of the repository):
You can use the various commands in the [Gradle build lifecycle](https://docs.gradle.org/current/userguide/build_lifecycle.html) to build and test the project (and all the subprojects).
Examples used in daily development follow (all executed from the root of the repository):

```bash
# Compile all projects
./gradlew assemble

# Compile only the native-gradle-plugin (for example)
./gradlew :native-gradle-plugin:assemble

# Run unit tests in all projects
./gradlew test

# Run functional tests in all projects
./gradlew funTest
# Run functional tests in individual projects
./gradlew :native-maven-plugin:functionalTest
./gradlew :native-gradle-plugin:functionalTest

# Compile only the native-gradle-plugin (for example)
./gradlew :native-gradle-plugin:assemble
# Run a specific test class
./gradlew -DnoTestIsolation=true :native-maven-plugin:functionalTest --tests "org.graalvm.buildtools.maven.IntegrationTest"

# Run a specific test method (with spaces in their name)
./gradlew -DnoTestIsolation=true :native-maven-plugin:functionalTest --tests "org.graalvm.buildtools.maven.IntegrationTest.run integration tests with failsafe plugin and agent"

# Checkstyle
./gradlew :graalvm-reachability-metadata:checkstyleMain :graalvm-reachability-metadata:checkstyleTest
./gradlew :junit-platform-native:checkstyleMain :junit-platform-native:checkstyleTest
./gradlew :native-gradle-plugin:inspections
./gradlew :native-maven-plugin:inspections

# Build and run all tests, complete (and very long) build
./gradlew build

# Clean all projects
./gradlew clean
```

## Debugging Plugin(s)
Expand Down Expand Up @@ -63,7 +95,7 @@ Next, update the project build files:
1. Update the version string. The version can be found manually by searching for the published artifacts in `build/common-repo`, or alternatively by checking the `nativeBuildTools` property [here](gradle/libs.versions.toml).
2. Update the list of repositories to include and prioritize the common repo.

### Gradle
### Testing with Gradle

Make the following changes to the build files:
```bash
Expand Down Expand Up @@ -99,7 +131,7 @@ Make the following changes to the build files:
```
Then, run the Gradle command as usual.

### Maven
### Testing with Maven

Make the following changes to _pom.xml_:
```bash
Expand All @@ -120,3 +152,7 @@ Make the following changes to _pom.xml_:
```

Then, run the Maven command with the `-U` flag to force Maven to use an updated snapshot (e.g., `mvn -Pnative package -U`).

## Changelog

Changelog must be updated for all significant changes. The changelog uses asciidoc and it is located in [docs](docs/src/docs/asciidoc/changelog.adoc).
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Documentation for common developer tasks can be found [here](DEVELOPING.md).
Examples can be found in the [samples subdirectory](samples).

### Contributing Code
We welcome your code contributions. To get started, you will need to sign the [Oracle Contributor Agreement](https://oca.opensource.oracle.com) (OCA).

Only pull requests from committers that can be verified as having signed the OCA can be accepted.
We welcome your code contributions. To get started, you will need to sign the [Oracle Contributor Agreement](https://oca.opensource.oracle.com) (OCA). Only pull requests from committers that can be verified as having signed the OCA can be accepted.

To see how to develop Native Build Tools go to [development guide](DEVELOPING.md).
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import groovy.json.JsonOutput

def matrixDefault = [
"java-version": [ "17" ],
"os": [ "ubuntu-22.04", "windows-latest" ]
"os": [ "ubuntu-22.04", "windows-latest", "macos-latest" ]
Copy link
Member Author

@vjovanov vjovanov Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added macos as I don't see how we can ship without testing that.

]

// # Following versions are disabled temporarily in order to speed up PR testing "7.3.3", "7.2", "7.1", "6.8.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class IntegrationTest extends AbstractGraalVMMavenFunctionalTest {
withSample("integration-test")

when:
mvn '-Pnative', 'verify'
mvn '-Pnative', '-PquickBuild', 'verify'

then:
buildSucceeded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,16 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
var resultingSystemProperties = [
"common.repo.uri": System.getProperty("common.repo.uri"),
"seed.repo.uri": System.getProperty("seed.repo.uri"),
"maven.repo.local": testDirectory.resolve("local-repo").toFile().absolutePath
]
println "Using local repo: ${resultingSystemProperties['maven.repo.local']}"
if (System.getProperty("noTestIsolation") == null) {
resultingSystemProperties.put("maven.repo.local", testDirectory.resolve("local-repo").toFile().absolutePath)
}
resultingSystemProperties.putAll(systemProperties)
if (resultingSystemProperties.containsKey("maven.repo.local")) {
println "Using local repo: ${resultingSystemProperties['maven.repo.local']}"
} else {
println "Using default Maven local repo"
}

result = executor.execute(
testDirectory.toFile(),
Expand All @@ -170,7 +176,6 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
new File(System.getProperty("maven.settings"))
)
println "Exit code is ${result.exitCode}"

}

void mvnDebug(String... args) {
Expand Down
Loading