Skip to content

Commit

Permalink
Update code-blocks and bump to release api-8
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMorpheus committed Feb 5, 2022
1 parent fc17fa3 commit cf778d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion source/plugin/buildsystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ for the Sponge projects and provides the best integration for Sponge plugins.
Gradle
======
Gradle_ uses Groovy_ or Kotlin_ based scripts for configuring projects. A Gradle_ project typically consists of a
``build.gradle`` file in your project's root directory, which tells Gradle_ how to build the project.
``build.gradle`` or a ``build.gradle.kts`` file in your project's root directory, which tells Gradle_ how to build
the project.

.. tip::
Refer to the `Gradle User Guide`_ for the installation and a general introduction of concepts used in Gradle_. If
Expand Down
29 changes: 16 additions & 13 deletions source/plugin/project/gradle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,30 @@ only need to update your plugin version in one file.
version together with SpongeGradle_. :ref:`The Gradle section of the build systems page <gradle-setup>` explains how
to setup Gradle on your computer.

.. tip::
The `Sponge plugin template <https://github.com/SpongePowered/sponge-plugin-template/>`__ is a `Template repository <https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template>`__
that demonstrate SpongeGradle.

Below is a simple template that should be usable for most plugins. **Make sure to replace the group with the group ID
you have chosen before.**

.. code-block:: groovy
.. code-block:: kotlin
plugins {
'java-library'
id("org.spongepowered.gradle.plugin") version "2.0.0"
r"""`java-library`
id("org.spongepowered.gradle.plugin") version "2.0.1"
}
// TODO: Change the following to match your information
group = 'com.example'
version = '1.0.0-SNAPSHOT'
group = "com.example"
version = "1.0.0-SNAPSHOT"
repositories {
mavenCentral()
}
sponge {
apiVersion("8.0.0-SNAPSHOT")
apiVersion("8.0.0")
license("CHANGEME")
loader {
name(PluginLoaders.JAVA_PLAIN)
Expand Down Expand Up @@ -78,7 +82,7 @@ By default, the Gradle plugin will contribute the **plugin name**, **plugin vers
to :doc:`/plugin/plugin-meta` with defaults defined in the project properties. It is also possible to override these if
you want to specify them manually:

.. code-block:: groovy
.. code-block:: kotlin
sponge {
apiVersion("8.0.0-SNAPSHOT")
Expand Down Expand Up @@ -116,18 +120,17 @@ Without SpongeGradle
Generally, everything necessary to compile a Sponge plugin using Gradle can be done by simply adding the SpongeAPI
dependency to your project:

.. code-block:: groovy
.. code-block:: kotlin
repositories {
mavenCentral()
maven {
name = 'sponge-repo'
url = 'https://repo.spongepowered.org/repository/maven-public/'
maven("https://repo.spongepowered.org/repository/maven-public/") {
name = "sponge"
}
}
dependencies {
compile 'org.spongepowered:spongeapi:8.0.0'
api("org.spongepowered:spongeapi:8.0.0")
}
.. _SpongeGradle: https://github.com/SpongePowered/SpongeGradle
.. _SpongeGradle: https://github.com/SpongePowered/SpongeGradle

0 comments on commit cf778d7

Please sign in to comment.