-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Documentation #645
base: master
Are you sure you want to change the base?
Conversation
c552a0a
to
ac98cf6
Compare
ac98cf6
to
46751a3
Compare
46751a3
to
e9a01a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work David!
I have mostly made changes to the Gradle end-to-end guide. I think most comments can be copied to the Maven guide which reuses the same sentences.
9fb93b7
to
133308a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnestoro, at this point I reviewed the main entry page index.adoc and gradle-plugin.adoc. Could you please follow the comments or apply suggestions? Some of the comments in gradle-plugin.adoc apply to maven-plugin.adoc too. Then I will continue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnestoro, don't keep the quickstart-gradle-plugin.adoc and quickstart-gradle-maven.adoc content around or just shorten what's there. The point of this refactoring was to simplify the getting started experience. Step 1: provide a demo example, a HelloWorld or very simple app. Step 2: how to add a plugin. Step 3: build and run. Step 4: the last step how to add additional options (-Ob, -Os etc.). That's what end users need to see and what we cross-link in the first place. What I see in end-to-end-maven-guide.adoc belongs to the reference documentation that should be in maven-plugin.adoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @vjovanov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But these are not getting started guides, but sequential end-to-end guides. I kept getting started guides as links at the top of end-to-end guides.
Difference between end-to-end guides and reference docs is that I described only necessary stuff that users may need, while reference documentation contains everything we support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing the ideas over zoom with David and Vojin, here is a proposed beginning and a structure for the end-to-end Gradle guide:
# Gradle Plugin User Guide
_The GraalVM team_
_version 0.10.4-SNAPSHOT_
This guide walks you through integrating the Gradle plugin for Native Image into your project.
It starts from enabling the plugin, building the first native image, and running it.
Then it takes you to more advanced use-cases such us providing configuration.
If you are an advanced user, you can skip the getting started part and go directly to the advanced section.
## Getting Started
To compile your application ahead of time with [GraalVM Native Image](https://www.graalvm.org/latest/reference-manual/native-image/) and Gradle, enable the Gradle plugin for Native Image building.
The plugin requires that you [install GraalVM](#link).
### Enable the Plugin
1. Add the plugin declaration into your _build.gradle_ file inside `plugins` block:
id 'org.graalvm.buildtools.native' version '0.10.4-SNAPSHOT'
Older versions of the plugin are listed [here](#).
2. In _build.gradle_, add the following block that configures the plugin:
GroovyKotlin
graalvmNative {
graalvmNative {
binaries.main {
imageName = "yourName"
mainClass = "org.example.Main"
buildArgs.add('-Ob')
}
}
}
It specifies the path for the application main class (the main entry point) and the name for a native executable file.
Adjust this path according to your application sources.
You can pass additional options to the Native Image tool using the `buildArgs.add('')` syntax.
In this example, `-Ob` enables quick build mode.
Learn more in [Providing Configuration Options](#link).
### Build and Run Your Application
> Note: A Java version between 17 and 21 is required to execute Gradle. (See the [Gradle Compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html)).
1. Compile and build a native executable of your application:
./gradlew nativeCompile
The executable is created in the _app/build/native/nativeCompile/_ directory of the project.
2. Run the application from the native executable:
./gradlew nativeRun
The Gradle plugin for Native Image registers more tasks that you may want to use, for example, `nativeTest` that executes tests found in the test sources in native mode.
Continue reading below to learn more about the plugin.
## Advanced Use Cases
For advanced users, the guide explains how to collect metadata, use diagnostics tools to analyze native executables, and includes examples of tests that demonstrate the guide's concepts.
### Providing Configuration Options
### Collecting Metadata with Tracing Agent
### Collecting Configuration from Reachability Metadata Repository
### Maintaining Generated Metadata
### Enabling Monitoring Tools
## Summary
7762f09
to
bc8ea12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnestoro, I'm done proofreading your latest version of end-to-end-gradle-guide.adoc.
All plugin versions are listed https://github.com/graalvm/native-build-tools/releases[here]. | ||
|
||
|
||
- Provide the application main class in _build.gradle_ / _build.gradle.kts_ as shown below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dnestoro, is it a must-have step when enabling the Gradle plugin to specify the main entry point? Also, is it still required to declare an additional plugin repository in settings.gradle?
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I was able to run few reproducers without that.
This PR: