Skip to content

Commit

Permalink
chore: Bump version of everything + Change fr.xpdustry to com.xpdustry
Browse files Browse the repository at this point in the history
  • Loading branch information
phinner committed Jul 26, 2023
1 parent 235b1de commit 1d59e14
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 38 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# KotlinRuntimePlugin
# kotlin-runtime

[![Xpdustry latest](https://maven.xpdustry.fr/api/badge/latest/releases/fr/xpdustry/kotlin-runtime?color=00ced1&name=KotlinRuntimePlugin&prefix=v)](https://maven.xpdustry.fr/#/releases/fr/xpdustry/kotlin-runtime)
[![Xpdustry latest](https://maven.xpdustry.fr/api/badge/latest/releases/fr/xpdustry/kotlin-runtime?color=00ced1&name=kotlin-runtime&prefix=v)](https://maven.xpdustry.fr/#/releases/fr/xpdustry/kotlin-runtime)
[![Downloads](https://img.shields.io/github/downloads/Xpdustry/KotlinRuntimePlugin/total?color=00ced1)](https://github.com/Xpdustry/KotlinRuntimePlugin/releases)
[![Mindustry 7.0](https://img.shields.io/badge/Mindustry-7.0-00ced1)](https://github.com/Anuken/Mindustry/releases)

## Description

This plugin allows you to write kotlin plugins without having to ship the kotlin runtime with your plugin. Thus avoiding conflicts with other plugins. It currently comes with version 1.8.0 and the following libraries :
This plugin allows you to write kotlin plugins without having to ship the kotlin runtime.
Thus avoiding conflicts with other plugins.
It currently comes with kotlin version 1.9.0 and the following libraries :

- The standard library
- The reflection library

If you want to use other kotlin core libraries, don't mind opening an issue, so I can add them in this plugin.
If you want to use other kotlin libraries, don't mind opening an issue.

## Requirements

This plugin requires Mindustry v141 or later and Java 17 or later.
This plugin requires Mindustry v145 or later and Java 17 or later.

## Building

- `./gradlew shadowJar` to only compile the plugin (it will be located at `/build/libs/KotlinRuntimePlugin.jar`).
- `./gradlew shadowJar` to only compile the plugin (it will be located at `/build/libs/kotlin-runtime.jar`).
- `./gradlew runMindustryServer` to run the plugin in a local Mindustry server.
- `./gradlew runMindustryClient` to run a local Mindustry client.
34 changes: 16 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import fr.xpdustry.toxopid.dsl.anukenJitpack
import fr.xpdustry.toxopid.dsl.mindustryDependencies
import fr.xpdustry.toxopid.spec.ModMetadata
import fr.xpdustry.toxopid.spec.ModPlatform

plugins {
kotlin("jvm") version "1.8.20"
id("com.diffplug.spotless") version "6.11.0"
id("net.kyori.indra") version "3.0.1"
id("net.kyori.indra.publishing") version "3.0.1"
id("net.kyori.indra.git") version "3.0.1"
id("net.kyori.indra.licenser.spotless") version "3.0.1"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("fr.xpdustry.toxopid") version "3.1.0"
kotlin("jvm") version "1.9.0"
id("com.diffplug.spotless") version "6.20.0"
id("net.kyori.indra") version "3.1.2"
id("net.kyori.indra.publishing") version "3.1.2"
id("net.kyori.indra.git") version "3.1.2"
id("net.kyori.indra.licenser.spotless") version "3.1.2"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("fr.xpdustry.toxopid") version "3.2.0"
id("com.github.ben-manes.versions") version "0.47.0"
}

val metadata = ModMetadata.fromJson(file("plugin.json").readText())
group = "fr.xpdustry"
group = "com.xpdustry"
if (indraGit.headTag() == null) {
metadata.version += "-SNAPSHOT"
}
Expand All @@ -25,22 +25,21 @@ description = metadata.description
toxopid {
compileVersion.set("v" + metadata.minGameVersion)
platforms.set(setOf(ModPlatform.HEADLESS))
useMindustryMirror.set(true)
}

repositories {
mavenCentral()
anukenJitpack()
maven("https://maven.xpdustry.fr/anuken") {
name = "xpdustry-anuken"
mavenContent { releasesOnly() }
}
}

dependencies {
mindustryDependencies()
api(kotlin("stdlib"))
api(kotlin("reflect"))

val junit = "5.9.0"
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit")
}

// Required for the GitHub actions
Expand All @@ -49,8 +48,7 @@ tasks.register("getArtifactPath") {
}

tasks.shadowJar {
// Makes sure the name of the final jar is (plugin-display-name).jar
archiveFileName.set(metadata.displayName + ".jar")
archiveFileName.set("kotlin-runtime.jar")
// Set the classifier to plugin for publication on a maven repository
archiveClassifier.set("plugin")
// Include the plugin.json file with the modified version
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 10 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,26 +130,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
12 changes: 6 additions & 6 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "kotlin-runtime",
"displayName": "KotlinRuntimePlugin",
"author": "Xpdustry",
"displayName": "KotlinRuntime",
"author": "xpdustry",
"description": "A companion plugin for Kotlin based plugins.",
"version": "2.0.0-k.1.8.20",
"minGameVersion": "141",
"version": "2.1.0-k.1.9.0",
"minGameVersion": "145",
"hidden": true,
"java": true,
"main": "fr.xpdustry.kotlin.KotlinRuntimePlugin",
"repo": "Xpdustry/KotlinRuntimePlugin",
"main": "com.xpdustry.kotlin.KotlinRuntimePlugin",
"repo": "xpdustry/kotlin-runtime",
"dependencies": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package fr.xpdustry.kotlin
package com.xpdustry.kotlin

import arc.util.Log
import mindustry.mod.Plugin
Expand Down

0 comments on commit 1d59e14

Please sign in to comment.