From 178f9faba71f6a7545167668828b650da35c628b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Marussy?= Date: Thu, 18 Jul 2024 16:21:29 +0200 Subject: [PATCH] docs: simplify plugin installation instructions Gradle Plugin Portal mirrors Maven Central, so we only need to manually specify the artifact coordinates for the plugin but not the repository. --- subprojects/docs/src/develop/java.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/subprojects/docs/src/develop/java.md b/subprojects/docs/src/develop/java.md index 5a9e9f45..ecb75b7f 100644 --- a/subprojects/docs/src/develop/java.md +++ b/subprojects/docs/src/develop/java.md @@ -22,7 +22,7 @@ Below, you can find instructions on using [Gradle](#gradle) or [Apache Maven](#m ## Working with Gradle {#gradle} We recommend [Gradle](https://gradle.org/) as a build system for creating Java programs that use Refinery as a library. -We created a [Gradle plugin](pathname://javadoc/refinery-gradle-plugins/) to simplify project configuration. +We created a [Gradle plugin](pathname://../javadoc/refinery-gradle-plugins/) to simplify project configuration. To find out how to add the plugin to your build, select below whether you want to use a **released** version or a **snapshot** version of refinery or whether you want to build Refinery **locally** yourself. @@ -43,11 +43,6 @@ import TabItem from '@theme/TabItem'; ```kotlin title="settings.gradle.kts" pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - } - resolutionStrategy { eachPlugin { if (requested.id.namespace == "tools.refinery") { @@ -179,7 +174,7 @@ See the [multi-module projects](#multi-module-projects) section of this tutorial ### Declaring dependencies The Refinery Gradle plugins adds a [version catalog](https://docs.gradle.org/current/userguide/platforms.html#sec:sharing-catalogs) named `refinery` that you can use to quickly access dependencies. -For example, to add a dependency to the [`tools.refinery:refinery-generator`](pathname://javadoc/refinery-generator/) library, you add the following to your `build.gradle.kts` or `build.gradle` file: +For example, to add a dependency to the [`tools.refinery:refinery-generator`](pathname://../javadoc/refinery-generator/) library, you add the following to your `build.gradle.kts` or `build.gradle` file: @@ -224,7 +219,7 @@ For example, you may add [GSON](https://google.github.io/gson/) for JSON parsing You can use the built-in [`application`](https://docs.gradle.org/current/userguide/application_plugin.html) to build stand-alone Java applications. -When developing you main application code in the `src/main/java` directory of you project, you can use the [`StandaloneRefinery`](pathname://javadoc/refinery-generator/tools/refinery/generator/standalone/StandaloneRefinery.html) class from [`tools.refinery:refinery-generator`](pathname://javadoc/refinery-generator/) to access Refinery generator components. See the tutorial on Xtext's [dependency injection](https://eclipse.dev/Xtext/documentation/302_configuration.html#dependency-injection) for more advanced use-cases. +When developing you main application code in the `src/main/java` directory of you project, you can use the [`StandaloneRefinery`](pathname://../javadoc/refinery-generator/tools/refinery/generator/standalone/StandaloneRefinery.html) class from [`tools.refinery:refinery-generator`](pathname://../javadoc/refinery-generator/) to access Refinery generator components. See the tutorial on Xtext's [dependency injection](https://eclipse.dev/Xtext/documentation/302_configuration.html#dependency-injection) for more advanced use-cases. ```java package org.example; @@ -316,7 +311,7 @@ Our Gradle plugin automatically sets up [JUnit 5](https://junit.org/junit5/) for You should put your test files into the `src/test/java` directory in your projects. You may run test with the commands `./gradlew test` or `./gradlew build`. -To ensure that your tests are properly isolated, in contrast with you main application code, you should *not* rely on the [`StandaloneRefinery`](pathname://javadoc/refinery-generator/tools/refinery/generator/standalone/StandaloneRefinery.html) class from [`tools.refinery:refinery-generator`](pathname://javadoc/refinery-generator/) to access Refinery generator components. +To ensure that your tests are properly isolated, in contrast with you main application code, you should *not* rely on the [`StandaloneRefinery`](pathname://../javadoc/refinery-generator/tools/refinery/generator/standalone/StandaloneRefinery.html) class from [`tools.refinery:refinery-generator`](pathname://../javadoc/refinery-generator/) to access Refinery generator components. Instead, you should use Xtext's [dependency injection](https://eclipse.dev/Xtext/documentation/302_configuration.html#dependency-injection) and [unit testing](https://eclipse.dev/Xtext/documentation/103_domainmodelnextsteps.html#tutorial-unit-tests) support to instantiate the components. You'll need to add a dependency to Refinery's Xtext testing support library to your project.