Skip to content

Commit f2fd551

Browse files
committed
Instructions for testing
1 parent 9d44733 commit f2fd551

File tree

4 files changed

+54
-12
lines changed

4 files changed

+54
-12
lines changed

DEVELOPING.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,58 @@ Some build tasks require a GraalVM JDK (e.g., tests). You should set `GRAALVM_HO
1313
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.
1414
To configure it in your IDE (e.g., IntelliJ IDEA), import the root project, and the IDE should automatically detect and include the subprojects.
1515

16+
## Projects
17+
18+
This repo contains the following projects:
19+
20+
- `native-gradle-plugin` — Gradle plugin that provides support for building and testing GraalVM native images in Gradle builds (tasks, DSL, and functional tests).
21+
- `native-maven-plugin` — Maven plugin that provides support for building and testing GraalVM native images in Maven builds (mojos and functional tests).
22+
- `junit-platform-native` (in `common/`) — JUnit Platform native support used by plugins to run on native image.
23+
- `utils` (in `common/`) — Shared utility code used across the plugins, tests, and internal build logic.
24+
- `graalvm-reachability-metadata` (in `common/`) — Common code related to the [GraalVM reachability metadata](https://github.com/oracle/graalvm-reachability-metadata) repository integration.
25+
- `docs` — Documentation sources and build for the user guide and changelog. Please keep up to date.
26+
27+
Internal build logic (used to build this repository itself):
28+
29+
- `settings-plugins` (in `build-logic`) — Gradle settings plugins and supporting tooling.
30+
- `aggregator` (in `build-logic`) — Composite build that aggregates internal build plugins and conventions.
31+
1632
## Building and Testing
1733

18-
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.
19-
Some examples are (all executed from the root of the repository):
34+
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).
35+
Examples used in daily development follow (all executed from the root of the repository):
2036

2137
```bash
2238
# Compile all projects
2339
./gradlew assemble
2440

41+
# Compile only the native-gradle-plugin (for example)
42+
./gradlew :native-gradle-plugin:assemble
43+
2544
# Run unit tests in all projects
2645
./gradlew test
2746

28-
# Run functional tests in all projects
29-
./gradlew funTest
47+
# Run functional tests in individual projects
48+
./gradlew :native-maven-plugin:functionalTest
49+
./gradlew :native-gradle-plugin:functionalTest
3050

31-
# Compile only the native-gradle-plugin (for example)
32-
./gradlew :native-gradle-plugin:assemble
51+
# Run a specific test class
52+
./gradlew -DnoTestIsolation=true :native-maven-plugin:functionalTest --tests "org.graalvm.buildtools.maven.IntegrationTest"
53+
54+
# Run a specific test method (with spaces in their name)
55+
./gradlew -DnoTestIsolation=true :native-maven-plugin:functionalTest --tests "org.graalvm.buildtools.maven.IntegrationTest.run integration tests with failsafe plugin and agent"
56+
57+
# Checkstyle
58+
./gradlew :graalvm-reachability-metadata:checkstyleMain :graalvm-reachability-metadata:checkstyleTest
59+
./gradlew :junit-platform-native:checkstyleMain :junit-platform-native:checkstyleTest
60+
./gradlew :native-gradle-plugin:inspections
61+
./gradlew :native-maven-plugin:inspections
3362

3463
# Build and run all tests, complete (and very long) build
3564
./gradlew build
65+
66+
# Clean all projects
67+
./gradlew clean
3668
```
3769

3870
## Debugging Plugin(s)
@@ -120,3 +152,7 @@ Make the following changes to _pom.xml_:
120152
```
121153
122154
Then, run the Maven command with the `-U` flag to force Maven to use an updated snapshot (e.g., `mvn -Pnative package -U`).
155+
156+
## Changelog
157+
158+
Changelog must be updated for all significant changes. The changelog uses asciidoc and it is located in [docs](docs/src/docs/asciidoc/changelog.adoc).

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Documentation for common developer tasks can be found [here](DEVELOPING.md).
2727
Examples can be found in the [samples subdirectory](samples).
2828

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

32-
Only pull requests from committers that can be verified as having signed the OCA can be accepted.
31+
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.
32+
33+
To see how to develop Native Build Tools go to [development guide](DEVELOPING.md).

native-maven-plugin/src/functionalTest/groovy/org/graalvm/buildtools/maven/IntegrationTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class IntegrationTest extends AbstractGraalVMMavenFunctionalTest {
55
withSample("integration-test")
66

77
when:
8-
mvn '-Pnative', 'verify'
8+
mvn '-Pnative', '-PquickBuild', 'verify'
99

1010
then:
1111
buildSucceeded

native-maven-plugin/src/testFixtures/groovy/org/graalvm/buildtools/maven/AbstractGraalVMMavenFunctionalTest.groovy

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,16 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
157157
var resultingSystemProperties = [
158158
"common.repo.uri": System.getProperty("common.repo.uri"),
159159
"seed.repo.uri": System.getProperty("seed.repo.uri"),
160-
"maven.repo.local": testDirectory.resolve("local-repo").toFile().absolutePath
161160
]
162-
println "Using local repo: ${resultingSystemProperties['maven.repo.local']}"
161+
if (System.getProperty("noTestIsolation") == null) {
162+
resultingSystemProperties.put("maven.repo.local", testDirectory.resolve("local-repo").toFile().absolutePath)
163+
}
163164
resultingSystemProperties.putAll(systemProperties)
165+
if (resultingSystemProperties.containsKey("maven.repo.local")) {
166+
println "Using local repo: ${resultingSystemProperties['maven.repo.local']}"
167+
} else {
168+
println "Using default Maven local repo"
169+
}
164170

165171
result = executor.execute(
166172
testDirectory.toFile(),
@@ -170,7 +176,6 @@ abstract class AbstractGraalVMMavenFunctionalTest extends Specification {
170176
new File(System.getProperty("maven.settings"))
171177
)
172178
println "Exit code is ${result.exitCode}"
173-
174179
}
175180

176181
void mvnDebug(String... args) {

0 commit comments

Comments
 (0)