Skip to content
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

Remove redundant settings.gradle configuration #532

Merged
merged 1 commit into from
Oct 23, 2023
Merged
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
32 changes: 1 addition & 31 deletions docs/src/docs/asciidoc/gradle-plugin-quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -187,36 +187,6 @@ plugins {
The `{gradle-plugin-version}` block pulls the latest plugin version.
Replace it with a specific version if you prefer.
The plugin discovers which JAR files it needs to pass to the `native-image` builder and what the executable main class should be.
. The plugin is not yet available on the Gradle Plugin Portal, so declare an additional plugin repository.
Open the _settings.gradle_ file and replace the default content with this:
+
[source,groovy,subs="verbatim,attributes", role="multi-language-sample"]
----
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'fortune-parent'
include('fortune')
----
+
[source,kotlin,subs="verbatim,attributes", role="multi-language-sample"]
----
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "fortune-parent"
include("fortune")
----
+
Note that the `pluginManagement {}` block must appear before any other statements in the file.

[[build-a-native-executable-with-resources-autodetection]]
== Build a Native Executable with Resources Autodetection
Expand Down Expand Up @@ -468,4 +438,4 @@ https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html[plugin
reference documentation].

Note that if your application does not call any classes dynamically at run time, the execution with the agent is needless.
Your workflow, in that case, is just `./gradlew nativeRun`.
Your workflow, in that case, is just `./gradlew nativeRun`.
18 changes: 1 addition & 17 deletions docs/src/docs/asciidoc/gradle-plugin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,8 @@ plugins {

NOTE: This plugin supplements and heavily relies on regular Java plugins (e.g. `application`, `java-library`, `java` etc). Not having them included in your project will most probably cause errors.

The plugin isn't available on the https://plugins.gradle.org[Gradle Plugin Portal] yet, so you will need to declare a plugin repository in addition:

Add the following to your `settings.gradle` / `settings.gradle.kts`:

.Declaring the plugin repository
[source,groovy,role="multi-language-sample"]
----
include::../snippets/gradle/groovy/settings.gradle[tags=plugin-management]
----

[source,kotlin,role="multi-language-sample"]
----
include::../snippets/gradle/kotlin/settings.gradle.kts[tags=plugin-management]
----


[TIP]
.Testing pre-releases (BROKEN AT THE MOMENT!)
.Testing pre-releases
====
You can use development versions of the plugin by adding our snapshot repository instead. Pre-releases are provided for convenience, without any guarantee.
[source, groovy, role="multi-language-sample"]
Expand Down
9 changes: 0 additions & 9 deletions docs/src/docs/snippets/gradle/groovy/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// tag::plugin-management[]
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
// end::plugin-management[]

if (false) {
// tag::pre-release[]
pluginManagement {
Expand Down
9 changes: 0 additions & 9 deletions docs/src/docs/snippets/gradle/kotlin/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@
* SOFTWARE.
*/

// tag::plugin-management[]
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
// end::plugin-management[]

if (false) {
// tag::pre-release[]
pluginManagement {
Expand Down
4 changes: 0 additions & 4 deletions samples/java-application-with-custom-tests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-application-with-extra-sourceset/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-application-with-reflection/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-application-with-resources/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-application-with-tests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-application/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
4 changes: 0 additions & 4 deletions samples/java-library/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-library'
4 changes: 0 additions & 4 deletions samples/kotlin-application-with-tests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = "kotlin-application"
4 changes: 0 additions & 4 deletions samples/metadata-repo-integration/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'metadata-repo-demo'
4 changes: 0 additions & 4 deletions samples/multi-project-with-tests/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'java-application'
Expand Down
4 changes: 0 additions & 4 deletions samples/native-config-integration/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ pluginManagement {
plugins {
id 'org.graalvm.buildtools.native' version getProperty('native.gradle.plugin.version')
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'native-config-integration'