Skip to content

Commit 688db78

Browse files
committed
Fix review feedback
- Rename `javaNative` -> `jvmNative` - Rename `nativeAssemble` -> `jvmNativeCompile` - Rename `nativeTestAssemble` -> `jvmNativeTestCompile`
1 parent 4477fbd commit 688db78

File tree

15 files changed

+53
-55
lines changed

15 files changed

+53
-55
lines changed

common/docs/ANNOUNCEMENT.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ pluginManagement {
4343
```
4444
_(this step will be redundant once this plugin is published to the Gradle Plugin Portal)._
4545

46-
After that, we can configure the image build by using a `javaNative` configuration block:
46+
After that, we can configure the image build by using a `jvmNative` configuration block:
4747

4848
```groovy
49-
javaNative {
49+
jvmNative {
5050
images {
5151
main {
5252
imageName = "my-app"
@@ -58,7 +58,7 @@ javaNative {
5858
}
5959
```
6060

61-
The plugin then adds `nativeAssemble` and `nativeRun` tasks that respectively creates a native executable and runs the main class (as one might expect ☺). If the reflection configuration is necessary for the Native Image building, this plugin also provides a simple option that activates the `[native-image-agent](https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/#assisted-configuration-of-native-image-builds)` without any additional user setup. More information (and _Kotlin_ configuration syntax) is available in the [documentation](https://github.com/graalvm/native-build-tools/blob/master/native-gradle-plugin/README.md).
61+
The plugin then adds `jvmNativeCompile` and `nativeRun` tasks that respectively creates a native executable and runs the main class (as one might expect ☺). If the reflection configuration is necessary for the Native Image building, this plugin also provides a simple option that activates the `[native-image-agent](https://www.graalvm.org/reference-manual/native-image/BuildConfiguration/#assisted-configuration-of-native-image-builds)` without any additional user setup. More information (and _Kotlin_ configuration syntax) is available in the [documentation](https://github.com/graalvm/native-build-tools/blob/master/native-gradle-plugin/README.md).
6262

6363
#### Testing in _Gradle_
6464

common/junit-platform-native/gradle/native-image-testing.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ tasks.named("test") {
127127
}
128128
}
129129

130-
tasks.register("nativeTestAssemble", Exec) {
130+
tasks.register("jvmNativeTestCompile", Exec) {
131131
dependsOn(test)
132132
inputs.files(test.classpath)
133133
workingDir "${buildDir}"
@@ -141,7 +141,7 @@ tasks.register("nativeTestAssemble", Exec) {
141141
}
142142

143143
tasks.register("nativeTest", Exec) {
144-
dependsOn nativeTestAssemble
144+
dependsOn jvmNativeTestCompile
145145
workingDir = "${buildDir}"
146146
executable = "${buildDir}/native-image-tests"
147147
}

docs/src/docs/asciidoc/gradle-plugin.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ This plugin works with the `application` plugin and will register a number of ta
131131

132132
The main tasks that you will want to execute are:
133133

134-
- `nativeAssemble`, which will trigger the generation of a native executable of your application
134+
- `jvmNativeCompile`, which will trigger the generation of a native executable of your application
135135
- `nativeRun`, which executes the generated native executable
136-
- `nativeTestAssemble`, which will build a native image with tests found in the `test` source set
136+
- `jvmNativeTestCompile`, which will build a native image with tests found in the `test` source set
137137
- `nativeTest`, which will <<testing,execute tests>> found in the `test` source set in native mode
138138

139-
Those tasks are configured with reasonable defaults using the `javaNative` extension `images` container of type link:javadocs/native-gradle-plugin/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.html[NativeImageOptions].
139+
Those tasks are configured with reasonable defaults using the `jvmNative` extension `images` container of type link:javadocs/native-gradle-plugin/org/graalvm/buildtools/gradle/dsl/NativeImageOptions.html[NativeImageOptions].
140140

141141
The main executable is configured by the image named `main`, while the test executable is configured via the image named `test`.
142142

@@ -152,7 +152,7 @@ If you want to use a different toolchain, for example a GraalVM Enterprise Editi
152152
.Selecting the GraalVM toolchain
153153
[role="multi-language-sample"]
154154
```groovy
155-
javaNative {
155+
jvmNative {
156156
images {
157157
main {
158158
javaLauncher = javaToolchains.launcherFor {
@@ -166,7 +166,7 @@ javaNative {
166166

167167
[role="multi-language-sample"]
168168
```kotlin
169-
javaNative {
169+
jvmNative {
170170
images {
171171
main {
172172
javaLauncher.set(javaToolchains.launcherFor {
@@ -185,7 +185,7 @@ The following configuration options are available for building images:
185185
.NativeImageOption configuration
186186
[role="multi-language-sample"]
187187
```groovy
188-
javaNative {
188+
jvmNative {
189189
images {
190190
main {
191191
// Main options
@@ -217,7 +217,7 @@ javaNative {
217217

218218
[role="multi-language-sample"]
219219
```kotlin
220-
javaNative {
220+
jvmNative {
221221
images {
222222
main {
223223
// Main options
@@ -312,7 +312,7 @@ This should be as easy as appending `-Pagent` to `run` and `nativeBuild`, or `te
312312

313313
```bash
314314
./gradlew -Pagent run # Runs on JVM with native-image-agent.
315-
./gradlew -Pagent nativeAssemble # Builds image using configuration acquired by agent.
315+
./gradlew -Pagent jvmNativeCompile # Builds image using configuration acquired by agent.
316316

317317
# For testing
318318
./gradlew -Pagent test # Runs on JVM with native-image-agent.
@@ -345,7 +345,7 @@ nativeBuild {
345345
you need to use:
346346

347347
```groovy
348-
javaNative {
348+
jvmNative {
349349
images {
350350
main {
351351
verbose = true
@@ -365,7 +365,7 @@ nativeTest {
365365
you need to use:
366366

367367
```groovy
368-
javaNative {
368+
jvmNative {
369369
images {
370370
test {
371371
verbose = true
@@ -374,8 +374,8 @@ javaNative {
374374
}
375375
```
376376

377-
- The `nativeBuild` task has been renamed to `nativeAssemble`.
378-
- The `nativeTestBuild` task has been renamed to `nativeTestAssemble`.
377+
- The `nativeBuild` task has been renamed to `jvmNativeCompile`.
378+
- The `nativeTestBuild` task has been renamed to `jvmNativeTestCompile`.
379379

380380
Both `nativeBuild` and `nativeTestBuild` task invocations are still supported but deprecated and will be removed in a future release.
381381

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/DeprecatedExtensionFunctionalTest.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ class DeprecatedExtensionFunctionalTest extends AbstractFunctionalTest {
5757
jvmArgs('hello', 'world')
5858
}
5959
60-
assert javaNative.images.${replacedWith}.verbose.get() == true
61-
assert javaNative.images.${replacedWith}.jvmArgs.get() == ['hello', 'world']
60+
assert jvmNative.images.${replacedWith}.verbose.get() == true
61+
assert jvmNative.images.${replacedWith}.jvmArgs.get() == ['hello', 'world']
6262
"""
6363

6464
when:
6565
run 'help'
6666

6767
then:
68-
outputContains "The $extensionName extension is deprecated and will be removed. Please use the 'javaNative.images.$replacedWith' extension to configure the native image instead."
68+
outputContains "The $extensionName extension is deprecated and will be removed. Please use the 'jvmNative.images.$replacedWith' extension to configure the native image instead."
6969

7070
where:
7171
extensionName | replacedWith
@@ -84,12 +84,12 @@ class DeprecatedExtensionFunctionalTest extends AbstractFunctionalTest {
8484

8585
then:
8686
tasks {
87-
succeeded ':nativeAssemble'
87+
succeeded ':jvmNativeCompile'
8888
succeeded ':nativeBuild'
8989
}
9090

9191
and:
92-
outputContains 'Task nativeBuild is deprecated. Use nativeAssemble instead.'
92+
outputContains 'Task nativeBuild is deprecated. Use jvmNativeCompile instead.'
9393

9494
where:
9595
version << TESTED_GRADLE_VERSIONS

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/JavaApplicationFunctionalTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import org.graalvm.buildtools.gradle.fixtures.AbstractFunctionalTest
4646
class JavaApplicationFunctionalTest extends AbstractFunctionalTest {
4747
def "can build a native image for a simple application"() {
4848
gradleVersion = version
49-
def nativeApp = file("build/native/nativeAssemble/java-application")
49+
def nativeApp = file("build/native/jvmNativeCompile/java-application")
5050
debug = true
5151

5252
given:
@@ -59,11 +59,11 @@ class JavaApplicationFunctionalTest extends AbstractFunctionalTest {
5959
""".stripIndent()
6060

6161
when:
62-
run 'nativeAssemble'
62+
run 'jvmNativeCompile'
6363

6464
then:
6565
tasks {
66-
succeeded ':jar', ':nativeAssemble'
66+
succeeded ':jar', ':jvmNativeCompile'
6767
doesNotContain ':build', ':run'
6868
}
6969

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/JavaApplicationWithResourcesFunctionalTest.groovy

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractFunctionalTest
4747
@Unroll("can build an application which uses resources using #pattern on Gradle #version with JUnit Platform #junitVersion")
4848
def "can build an application which uses resources"() {
4949
gradleVersion = version
50-
def nativeApp = file("build/native/nativeAssemble/java-application")
50+
def nativeApp = file("build/native/jvmNativeCompile/java-application")
5151
debug = true
5252
given:
5353
withSample("java-application-with-resources")
@@ -60,11 +60,11 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractFunctionalTest
6060
"""
6161

6262
when:
63-
run 'nativeAssemble'
63+
run 'jvmNativeCompile'
6464

6565
then:
6666
tasks {
67-
succeeded ':jar', ':nativeAssemble'
67+
succeeded ':jar', ':jvmNativeCompile'
6868
doesNotContain ':build', ':run'
6969
}
7070

@@ -92,7 +92,7 @@ class JavaApplicationWithResourcesFunctionalTest extends AbstractFunctionalTest
9292
junitVersion = System.getProperty('versions.junit')
9393
[version, [pattern, config]] << [TESTED_GRADLE_VERSIONS,
9494
[["explicit resource declaration", """
95-
javaNative {
95+
jvmNative {
9696
images {
9797
main {
9898
resources {
@@ -103,7 +103,7 @@ javaNative {
103103
}
104104
"""],
105105
["detected", """
106-
javaNative {
106+
jvmNative {
107107
images {
108108
main {
109109
resources {
@@ -119,7 +119,7 @@ javaNative {
119119
"""
120120
],
121121
["project local detection only", """
122-
javaNative {
122+
jvmNative {
123123
images {
124124
main {
125125
resources {
@@ -171,7 +171,7 @@ javaNative {
171171
junitVersion = System.getProperty('versions.junit')
172172
[version, [pattern, config]] << [TESTED_GRADLE_VERSIONS,
173173
[["explicit resource declaration", """
174-
javaNative {
174+
jvmNative {
175175
images {
176176
test {
177177
resources {
@@ -183,7 +183,7 @@ javaNative {
183183
}
184184
"""],
185185
["detected", """
186-
javaNative {
186+
jvmNative {
187187
images {
188188
test {
189189
resources {

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/JavaApplicationWithTestsFunctionalTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ class JavaApplicationWithTestsFunctionalTest extends AbstractFunctionalTest {
4949
@Unroll("can execute tests in a native image on Gradle #version with JUnit Platform #junitVersion")
5050
def "can build a native image and run it"() {
5151
gradleVersion = version
52-
def nativeTestsApp = file("build/native/nativeTestAssemble/java-application-tests")
52+
def nativeTestsApp = file("build/native/jvmNativeTestCompile/java-application-tests")
5353

5454
given:
5555
withSample("java-application-with-tests")
5656

5757
when:
58-
run 'nativeTestAssemble'
58+
run 'jvmNativeTestCompile'
5959

6060
then:
6161
tasks {
62-
succeeded ':testClasses', ':nativeTestAssemble'
62+
succeeded ':testClasses', ':jvmNativeTestCompile'
6363
// doesNotContain ':build'
6464
}
6565
outputDoesNotContain "Running in 'test discovery' mode. Note that this is a fallback mode."
@@ -105,7 +105,7 @@ class JavaApplicationWithTestsFunctionalTest extends AbstractFunctionalTest {
105105
then:
106106
tasks {
107107
succeeded ':testClasses',
108-
':nativeTestAssemble',
108+
':jvmNativeTestCompile',
109109
':test', // there should probably not be a dependency here
110110
':nativeTest'
111111
doesNotContain ':build'

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/JavaLibraryFunctionalTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ class JavaLibraryFunctionalTest extends AbstractFunctionalTest {
5757
libExt = ".dylib"
5858
}
5959

60-
def library = file("build/native/nativeAssemble/java-library" + libExt)
60+
def library = file("build/native/jvmNativeCompile/java-library" + libExt)
6161
debug = true
6262

6363
given:
6464
withSample("java-library")
6565

6666
when:
67-
run 'nativeAssemble'
67+
run 'jvmNativeCompile'
6868

6969
then:
7070
tasks {
71-
succeeded ':jar', ':nativeAssemble'
71+
succeeded ':jar', ':jvmNativeCompile'
7272
doesNotContain ':build'
7373
}
7474

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/KotlinApplicationWithTestsFunctionalTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class KotlinApplicationWithTestsFunctionalTest extends AbstractFunctionalTest {
6060
then:
6161
tasks {
6262
succeeded ':compileTestKotlin',
63-
':nativeTestAssemble',
63+
':jvmNativeTestCompile',
6464
':test',
6565
':nativeTest'
6666
doesNotContain ':build'

native-gradle-plugin/src/functionalTest/groovy/org/graalvm/buildtools/gradle/MultiProjectJavaApplicationWithTestsFunctionalTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MultiProjectJavaApplicationWithTestsFunctionalTest extends AbstractFunctio
5959
tasks {
6060
succeeded ':utils:jar',
6161
':core:testClasses',
62-
':core:nativeTestAssemble',
62+
':core:jvmNativeTestCompile',
6363
':core:nativeTest'
6464
doesNotContain ':core:build'
6565
}

0 commit comments

Comments
 (0)