Merge pull request #33 from FrankHeijden/feature/kotlinify
Kotlinify + publish to repo.fvdh.dev
This commit is contained in:
commit
7de1f53f22
20 changed files with 429 additions and 309 deletions
27
.github/workflows/gradle.yml
vendored
27
.github/workflows/gradle.yml
vendored
|
|
@ -1,31 +1,34 @@
|
|||
# This workflow will build a Java project with Gradle
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 1.8 ]
|
||||
fail-fast: true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
- name: Setup JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: ${{ matrix.java-version }}
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Build
|
||||
run: ./gradlew clean build --stacktrace
|
||||
- name: Upload artififacts
|
||||
uses: actions/upload-artifact@v2.2.1
|
||||
with:
|
||||
name: ServerUtils
|
||||
path: jars/*.jar
|
||||
- name: Publish
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
env:
|
||||
FVDH_USERNAME: ${{ secrets.FVDH_USERNAME }}
|
||||
FVDH_TOKEN: ${{ secrets.FVDH_TOKEN }}
|
||||
run: ./gradlew publish --stacktrace
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
group = rootProject.group + '.bukkit'
|
||||
String rootDependencyDir = rootProject.group + '.dependencies'
|
||||
String dependencyDir = group + '.dependencies'
|
||||
version = rootProject.version
|
||||
archivesBaseName = rootProject.name + '-Bukkit'
|
||||
|
||||
dependencies {
|
||||
implementation "cloud.commandframework:cloud-paper:${rootProject.cloudVersion}"
|
||||
implementation "net.kyori:adventure-api:${rootProject.adventureVersion}"
|
||||
implementation "net.kyori:adventure-platform-bukkit:${rootProject.adventurePlatformVersion}"
|
||||
implementation ("net.kyori:adventure-text-minimessage:${rootProject.adventureMinimessageVersion}") {
|
||||
exclude group: 'net.kyori', module: 'adventure-api'
|
||||
}
|
||||
implementation "org.bstats:bstats-bukkit:${rootProject.bstatsVersion}"
|
||||
implementation project(":Common")
|
||||
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
|
||||
}
|
||||
|
||||
processResources {
|
||||
from('src/main/resources') {
|
||||
include 'plugin.yml'
|
||||
expand(version: project.version)
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate 'org.bstats', dependencyDir + '.bstats'
|
||||
}
|
||||
38
Bukkit/build.gradle.kts
Normal file
38
Bukkit/build.gradle.kts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("net.minecrell.plugin-yml.bukkit") version "0.5.0"
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
val rootDependencyDir = "${rootProject.group}.dependencies"
|
||||
val dependencyDir = "${group}.bukkit.dependencies"
|
||||
version = rootProject.version
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-Bukkit")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("cloud.commandframework:cloud-paper:${VersionConstants.cloudVersion}")
|
||||
implementation("net.kyori:adventure-api:${VersionConstants.adventureVersion}")
|
||||
implementation("net.kyori:adventure-platform-bukkit:${VersionConstants.adventurePlatformVersion}")
|
||||
implementation("net.kyori:adventure-text-minimessage:${VersionConstants.adventureMinimessageVersion}") {
|
||||
exclude("net.kyori", "adventure-api")
|
||||
}
|
||||
implementation("org.bstats:bstats-bukkit:${VersionConstants.bstatsVersion}")
|
||||
implementation(project(":Common"))
|
||||
compileOnly("com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
relocate("org.bstats", "${dependencyDir}.bstats")
|
||||
}
|
||||
|
||||
bukkit {
|
||||
main = "net.frankheijden.serverutils.bukkit.ServerUtils"
|
||||
description = "A server utility"
|
||||
apiVersion = "1.13"
|
||||
website = "https://github.com/FrankHeijden/ServerUtils"
|
||||
softDepend = listOf("ServerUtilsUpdater")
|
||||
authors = listOf("FrankHeijden")
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
name: ServerUtils
|
||||
main: net.frankheijden.serverutils.bukkit.ServerUtils
|
||||
version: ${version}
|
||||
author: FrankHeijden
|
||||
api-version: '1.13'
|
||||
softdepend: [ServerUtilsUpdater]
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
group = rootProject.group + '.bungee'
|
||||
String rootDependencyDir = rootProject.group + '.dependencies'
|
||||
String dependencyDir = group + '.dependencies'
|
||||
version = rootProject.version
|
||||
archivesBaseName = rootProject.name + '-Bungee'
|
||||
|
||||
repositories {
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "cloud.commandframework:cloud-bungee:${rootProject.cloudVersion}"
|
||||
implementation "net.kyori:adventure-api:${rootProject.adventureVersion}"
|
||||
implementation "net.kyori:adventure-platform-bungeecord:${rootProject.adventurePlatformVersion}"
|
||||
implementation ("net.kyori:adventure-text-minimessage:${rootProject.adventureMinimessageVersion}") {
|
||||
exclude group: 'net.kyori', module: 'adventure-api'
|
||||
}
|
||||
implementation "org.bstats:bstats-bungeecord:${rootProject.bstatsVersion}"
|
||||
implementation project(":Common")
|
||||
compileOnly 'net.md-5:bungeecord-api:1.17-R0.1-SNAPSHOT'
|
||||
}
|
||||
|
||||
processResources {
|
||||
from('src/main/resources') {
|
||||
include 'bungee.yml'
|
||||
expand(version: project.version)
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate 'org.bstats', dependencyDir + '.bstats'
|
||||
}
|
||||
40
Bungee/build.gradle.kts
Normal file
40
Bungee/build.gradle.kts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("net.minecrell.plugin-yml.bungee") version "0.5.0"
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
val rootDependencyDir = "${group}.dependencies"
|
||||
val dependencyDir = "${group}.bungee.dependencies"
|
||||
version = rootProject.version
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-Bungee")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://oss.sonatype.org/content/repositories/snapshots")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("cloud.commandframework:cloud-bungee:${VersionConstants.cloudVersion}")
|
||||
implementation("net.kyori:adventure-api:${VersionConstants.adventureVersion}")
|
||||
implementation("net.kyori:adventure-platform-bungeecord:${VersionConstants.adventurePlatformVersion}")
|
||||
implementation("net.kyori:adventure-text-minimessage:${VersionConstants.adventureMinimessageVersion}") {
|
||||
exclude("net.kyori", "adventure-api")
|
||||
}
|
||||
implementation("org.bstats:bstats-bungeecord:${VersionConstants.bstatsVersion}")
|
||||
implementation(project(":Common"))
|
||||
compileOnly("net.md-5:bungeecord-api:1.17-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
relocate("org.bstats", "${dependencyDir}.bstats")
|
||||
}
|
||||
|
||||
bungee {
|
||||
main = "net.frankheijden.serverutils.bungee.ServerUtils"
|
||||
description = "A server utility"
|
||||
softDepends = setOf("ServerUtilsUpdater")
|
||||
author = "FrankHeijden"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
name: ServerUtils
|
||||
main: net.frankheijden.serverutils.bungee.ServerUtils
|
||||
version: ${version}
|
||||
author: FrankHeijden
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
plugins {
|
||||
id 'net.kyori.blossom' version '1.1.0'
|
||||
}
|
||||
|
||||
group = rootProject.group + '.common'
|
||||
version = rootProject.version
|
||||
archivesBaseName = rootProject.name + '-Common'
|
||||
|
||||
repositories {
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "net.kyori:adventure-platform-api:${rootProject.adventurePlatformVersion}"
|
||||
compileOnly "net.kyori:adventure-text-minimessage:${rootProject.adventureMinimessageVersion}"
|
||||
compileOnly 'com.github.FrankHeijden:ServerUtilsUpdater:v1.0.0'
|
||||
|
||||
testImplementation "net.kyori:adventure-text-serializer-plain:${rootProject.adventureVersion}"
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceTokenIn('src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java')
|
||||
replaceToken '{version}', version
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude 'plugin.yml'
|
||||
exclude 'bungee.yml'
|
||||
}
|
||||
34
Common/build.gradle.kts
Normal file
34
Common/build.gradle.kts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("net.kyori.blossom") version "1.3.0"
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
version = "${rootProject.version}"
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-Common")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://jitpack.io")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("net.kyori:adventure-platform-api:${VersionConstants.adventurePlatformVersion}")
|
||||
compileOnly("net.kyori:adventure-text-minimessage:${VersionConstants.adventureMinimessageVersion}")
|
||||
compileOnly("com.github.FrankHeijden:ServerUtilsUpdater:v1.0.0")
|
||||
|
||||
testImplementation("net.kyori:adventure-text-serializer-plain:${VersionConstants.adventureVersion}")
|
||||
}
|
||||
|
||||
tasks {
|
||||
blossom {
|
||||
replaceToken("{version}", version, "src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
exclude("plugin.yml")
|
||||
exclude("bungee.yml")
|
||||
}
|
||||
70
README.md
70
README.md
|
|
@ -27,7 +27,6 @@ and provides you with handy information about them.
|
|||
|
||||
For the full description of this plugin, please refer to the ServerUtils [SpigotMC][spigot] page.
|
||||
|
||||
[](https://jitpack.io/#FrankHeijden/ServerUtils)
|
||||
[![releaseImg]][release]
|
||||
[](https://github.com/FrankHeijden/ServerUtils/actions)
|
||||
[![licenseImg]][license]
|
||||
|
|
@ -40,38 +39,55 @@ For the full description of this plugin, please refer to the ServerUtils [Spigot
|
|||
|
||||
[![bStatsImg]][bStats]
|
||||
|
||||
## How to run the project?
|
||||
## Compiling ServerUtils
|
||||
There are two ways to compile ServerUtils:
|
||||
### 1. Installing gradle (recommended)
|
||||
1. Make sure you have [gradle][gradleInstall] installed.
|
||||
2. Run the project with `gradle clean build` to compile all submodules with dependencies.
|
||||
3. Afterwards, the platform specific plugins and platform independent compiled jars can be found in the `jars/` directory.
|
||||
2. Run the project with `gradle build` to compile it with dependencies.
|
||||
### 2. Using the wrapper
|
||||
**Windows**: `gradlew.bat build`
|
||||
<br>
|
||||
**Linux/macOS**: `./gradlew build`
|
||||
|
||||
## Developer API
|
||||
### Repository / Dependency
|
||||
If you wish to use snapshot versions of ServerUtils, you can use the following repo:
|
||||
```
|
||||
https://repo.fvdh.dev/snapshots
|
||||
```
|
||||
|
||||
## API Repository / Dependency
|
||||
Please use the following maven repository:
|
||||
#### Gradle:
|
||||
```groovy
|
||||
maven { url 'https://jitpack.io' }
|
||||
```
|
||||
and as dependency:
|
||||
```groovy
|
||||
// Replace VERSION with for example 2.5.0
|
||||
compileOnly 'com.github.FrankHeijden:ServerUtils:VERSION'
|
||||
```kotlin
|
||||
repositories {
|
||||
compileOnly("net.frankheijden.serverutils:ServerUtils:VERSION")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
maven("https://repo.fvdh.dev/releases")
|
||||
}
|
||||
```
|
||||
|
||||
#### Maven:
|
||||
```xml
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
```
|
||||
and as dependency:
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>com.github.FrankHeijden</groupId>
|
||||
<artifactId>ServerUtils</artifactId>
|
||||
<!-- Replace VERSION with for example 2.5.0 -->
|
||||
<version>VERSION</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<project>
|
||||
<repositories>
|
||||
<!-- Insights repo -->
|
||||
<repository>
|
||||
<id>fvdh</id>
|
||||
<url>https://repo.fvdh.dev/releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<!-- Insights dependency -->
|
||||
<dependency>
|
||||
<groupId>net.frankheijden.serverutils</groupId>
|
||||
<artifactId>ServerUtils</artifactId>
|
||||
<version>VERSION</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
```
|
||||
|
||||
## Commands and Permissions
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
plugins {
|
||||
id 'net.kyori.blossom' version '1.3.0'
|
||||
}
|
||||
|
||||
group = rootProject.group + '.velocity'
|
||||
String dependencyDir = group + '.dependencies'
|
||||
version = rootProject.version
|
||||
archivesBaseName = rootProject.name + '-Velocity'
|
||||
|
||||
repositories {
|
||||
maven { url 'https://nexus.velocitypowered.com/repository/maven-public/' }
|
||||
maven { url 'https://libraries.minecraft.net' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "cloud.commandframework:cloud-velocity:${rootProject.cloudVersion}"
|
||||
implementation "org.bstats:bstats-velocity:${rootProject.bstatsVersion}"
|
||||
implementation project(":Common")
|
||||
implementation ("net.kyori:adventure-text-minimessage:${rootProject.adventureMinimessageVersion}") {
|
||||
exclude group: 'net.kyori', module: 'adventure-api'
|
||||
}
|
||||
compileOnly 'com.velocitypowered:velocity-api:3.0.0'
|
||||
compileOnly 'com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT'
|
||||
compileOnly 'com.electronwill.night-config:toml:3.6.3'
|
||||
annotationProcessor 'com.velocitypowered:velocity-api:3.0.0'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate 'org.bstats', dependencyDir + '.bstats'
|
||||
}
|
||||
|
||||
blossom {
|
||||
replaceTokenIn('src/main/java/net/frankheijden/serverutils/velocity/ServerUtils.java')
|
||||
replaceToken '${version}', version
|
||||
}
|
||||
40
Velocity/build.gradle.kts
Normal file
40
Velocity/build.gradle.kts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("net.kyori.blossom") version "1.3.0"
|
||||
}
|
||||
|
||||
group = "${rootProject.group}"
|
||||
val dependencyDir = "${group}.velocity.dependencies"
|
||||
version = rootProject.version
|
||||
base {
|
||||
archivesName.set("${rootProject.name}-Velocity")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven("https://nexus.velocitypowered.com/repository/maven-public/")
|
||||
maven("https://libraries.minecraft.net")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("cloud.commandframework:cloud-velocity:${VersionConstants.cloudVersion}")
|
||||
implementation("org.bstats:bstats-velocity:${VersionConstants.bstatsVersion}")
|
||||
implementation(project(":Common"))
|
||||
implementation("net.kyori:adventure-text-minimessage:${VersionConstants.adventureMinimessageVersion}") {
|
||||
exclude("net.kyori", "adventure-api")
|
||||
}
|
||||
compileOnly("com.velocitypowered:velocity-api:3.0.0")
|
||||
compileOnly("com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT")
|
||||
compileOnly("com.electronwill.night-config:toml:3.6.3")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.0.0")
|
||||
}
|
||||
|
||||
tasks {
|
||||
blossom {
|
||||
replaceToken("{version}", version, "src/main/java/net/frankheijden/serverutils/velocity/ServerUtils.java")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
relocate("org.bstats", "${dependencyDir}.bstats")
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ import org.slf4j.Logger;
|
|||
@Plugin(
|
||||
id = "serverutils",
|
||||
name = "ServerUtils",
|
||||
version = "${version}",
|
||||
version = "{version}",
|
||||
description = "A server utility",
|
||||
url = "https://github.com/FrankHeijden/ServerUtils",
|
||||
authors = "FrankHeijden"
|
||||
|
|
|
|||
129
build.gradle
129
build.gradle
|
|
@ -1,129 +0,0 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||
}
|
||||
|
||||
group = 'net.frankheijden.serverutils'
|
||||
String dependencyDir = group + '.dependencies'
|
||||
version = '3.0.0'
|
||||
|
||||
allprojects {
|
||||
ext {
|
||||
cloudVersion = '1.6.0-SNAPSHOT'
|
||||
adventureVersion = '4.8.1'
|
||||
adventurePlatformVersion = '4.0.0-SNAPSHOT'
|
||||
adventureMinimessageVersion = '4.1.0-SNAPSHOT'
|
||||
bstatsVersion = '2.2.1'
|
||||
}
|
||||
}
|
||||
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
subprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'checkstyle'
|
||||
apply plugin: 'com.github.johnrengelman.shadow'
|
||||
|
||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://repo.incendo.org/content/repositories/snapshots' }
|
||||
maven { url 'https://papermc.io/repo/repository/maven-public/' }
|
||||
maven { url 'https://libraries.minecraft.net' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "cloud.commandframework:cloud-core:${rootProject.cloudVersion}"
|
||||
implementation "cloud.commandframework:cloud-brigadier:${rootProject.cloudVersion}"
|
||||
implementation 'com.github.FrankHeijden:MinecraftReflection:1.0.0'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'me.lucko:commodore:1.10'
|
||||
compileOnly 'com.mojang:brigadier:1.0.17'
|
||||
|
||||
testCompile 'org.assertj:assertj-core:3.18.1'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-api:5.7.0'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-params:5.7.0'
|
||||
testCompile 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.compilerArgs += ["-parameters"]
|
||||
options.fork = true
|
||||
options.forkOptions.executable = 'javac'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion "8.38"
|
||||
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
|
||||
|
||||
ignoreFailures = false
|
||||
maxErrors = 0
|
||||
maxWarnings = 0
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude 'com/mojang/**'
|
||||
exclude 'javax/annotation/**'
|
||||
exclude 'org/checkerframework/**'
|
||||
relocate 'com.google.gson', dependencyDir + '.gson'
|
||||
relocate 'dev.frankheijden.minecraftreflection', dependencyDir + '.minecraftreflection'
|
||||
relocate 'cloud.commandframework', dependencyDir + '.cloud'
|
||||
relocate 'me.lucko.commodore', dependencyDir + '.commodore'
|
||||
relocate 'io.leangen.geantyref', dependencyDir + '.typetoken'
|
||||
relocate 'net.kyori.adventure', dependencyDir + '.adventure'
|
||||
relocate 'net.kyori.examination', dependencyDir + '.examination'
|
||||
relocate 'net.kyori.adventure.text.minimessage', dependencyDir + '.adventure.text.minimessage'
|
||||
relocate 'dev.frankheijden.minecraftreflection', dependencyDir + '.minecraftreflection'
|
||||
}
|
||||
|
||||
shadowJar.dependsOn checkstyleMain, checkstyleTest, test
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':Common', configuration: 'shadow')
|
||||
implementation project(path: ':Bukkit', configuration: 'shadow')
|
||||
implementation project(path: ':Bungee', configuration: 'shadow')
|
||||
implementation project(path: ':Velocity', configuration: 'shadow')
|
||||
implementation("net.kyori:adventure-text-serializer-gson:${rootProject.adventureVersion}") {
|
||||
exclude group: 'net.kyori', module: 'adventure-api'
|
||||
exclude group: 'com.google.code.gson', module: 'gson'
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate 'net.kyori.adventure.text.serializer.gson', dependencyDir + '.impl.adventure.text.serializer.gson'
|
||||
archiveFileName = "${archiveBaseName.orNull}-${archiveVersion.orNull}.${archiveExtension.orNull}"
|
||||
}
|
||||
|
||||
def outputTasks() {
|
||||
[
|
||||
"shadowJar",
|
||||
":Bukkit:shadowJar",
|
||||
":Bungee:shadowJar",
|
||||
":Velocity:shadowJar",
|
||||
].stream().map({ tasks.findByPath(it) })
|
||||
}
|
||||
|
||||
task copyJars(type: Copy) {
|
||||
outputTasks().forEach({ from(it) })
|
||||
rename '(.*)-all.jar', '$1.jar'
|
||||
into file('jars')
|
||||
}
|
||||
|
||||
task cleanJars() {
|
||||
delete file('jars')
|
||||
}
|
||||
|
||||
clean.dependsOn cleanJars
|
||||
build.dependsOn shadowJar
|
||||
build.dependsOn copyJars
|
||||
198
build.gradle.kts
Normal file
198
build.gradle.kts
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "7.0.0"
|
||||
}
|
||||
|
||||
group = "net.frankheijden.serverutils"
|
||||
val dependencyDir = "${group}.dependencies"
|
||||
version = "3.1.0-SNAPSHOT"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = "java")
|
||||
apply(plugin = "maven-publish")
|
||||
apply(plugin = "checkstyle")
|
||||
apply(plugin = "com.github.johnrengelman.shadow")
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://jitpack.io")
|
||||
maven("https://repo.incendo.org/content/repositories/snapshots")
|
||||
maven("https://papermc.io/repo/repository/maven-public/")
|
||||
maven("https://libraries.minecraft.net")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("cloud.commandframework:cloud-core:${VersionConstants.cloudVersion}")
|
||||
implementation("cloud.commandframework:cloud-brigadier:${VersionConstants.cloudVersion}")
|
||||
implementation("com.github.FrankHeijden:MinecraftReflection:1.0.0")
|
||||
implementation("com.google.code.gson:gson:2.8.6")
|
||||
implementation("me.lucko:commodore:1.10")
|
||||
compileOnly("com.mojang:brigadier:1.0.17")
|
||||
|
||||
testImplementation("org.assertj:assertj-core:3.18.1")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.0")
|
||||
}
|
||||
|
||||
tasks {
|
||||
build {
|
||||
dependsOn("checkstyleMain", "checkstyleTest", "test")
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
processResources {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Checkstyle>().configureEach {
|
||||
configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
|
||||
ignoreFailures = false
|
||||
maxErrors = 0
|
||||
maxWarnings = 0
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
exclude("com/mojang/**")
|
||||
exclude("javax/annotation/**")
|
||||
exclude("org/checkerframework/**")
|
||||
relocate("com.google.gson", "${dependencyDir}.gson")
|
||||
relocate("dev.frankheijden.minecraftreflection", "${dependencyDir}.minecraftreflection")
|
||||
relocate("cloud.commandframework", "${dependencyDir}.cloud")
|
||||
relocate("me.lucko.commodore", "${dependencyDir}.commodore")
|
||||
relocate("io.leangen.geantyref", "${dependencyDir}.typetoken")
|
||||
relocate("net.kyori.adventure", "${dependencyDir}.adventure")
|
||||
relocate("net.kyori.examination", "${dependencyDir}.examination")
|
||||
relocate("net.kyori.adventure.text.minimessage", "${dependencyDir}.adventure.text.minimessage")
|
||||
relocate("dev.frankheijden.minecraftreflection", "${dependencyDir}.minecraftreflection")
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "fvdh"
|
||||
url = uri("https://repo.fvdh.dev/test")
|
||||
|
||||
credentials {
|
||||
username = System.getenv("FVDH_USERNAME")
|
||||
password = System.getenv("FVDH_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>("ServerUtils") {
|
||||
artifact(tasks["shadowJar"]) {
|
||||
extension = ""
|
||||
classifier = ""
|
||||
}
|
||||
artifactId = "ServerUtils-$artifactId"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":Common", "shadow"))
|
||||
implementation(project(":Bukkit", "shadow"))
|
||||
implementation(project(":Bungee", "shadow"))
|
||||
implementation(project(":Velocity", "shadow"))
|
||||
implementation("net.kyori:adventure-text-serializer-gson:${VersionConstants.adventureVersion}") {
|
||||
exclude("net.kyori", "adventure-api")
|
||||
exclude("com.google.code.gson", "gson")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
clean {
|
||||
dependsOn("cleanJars")
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn("shadowJar", "copyJars")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<ShadowJar> {
|
||||
relocate("net.kyori.adventure.text.serializer.gson", "${dependencyDir}.impl.adventure.text.serializer.gson")
|
||||
}
|
||||
|
||||
fun outputTasks(): List<Task> {
|
||||
return listOf(
|
||||
"shadowJar",
|
||||
":Bukkit:shadowJar",
|
||||
":Bungee:shadowJar",
|
||||
":Velocity:shadowJar",
|
||||
).map { tasks.findByPath(it)!! }
|
||||
}
|
||||
|
||||
tasks.register("cleanJars") {
|
||||
delete(file("jars"))
|
||||
}
|
||||
|
||||
tasks.register<Copy>("copyJars") {
|
||||
outputTasks().forEach {
|
||||
from(it) {
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
}
|
||||
}
|
||||
into(file("jars"))
|
||||
rename("(.*)-all.jar", "$1.jar")
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "fvdh"
|
||||
url = if (version.toString().endsWith("-SNAPSHOT")) {
|
||||
uri("https://repo.fvdh.dev/snapshots")
|
||||
} else {
|
||||
uri("https://repo.fvdh.dev/releases")
|
||||
}
|
||||
|
||||
credentials {
|
||||
username = System.getenv("FVDH_USERNAME")
|
||||
password = System.getenv("FVDH_TOKEN")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publications {
|
||||
create<MavenPublication>("ServerUtils") {
|
||||
artifact(tasks["shadowJar"]) {
|
||||
extension = ""
|
||||
classifier = ""
|
||||
}
|
||||
artifactId = "ServerUtils"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
buildSrc/build.gradle.kts
Normal file
7
buildSrc/build.gradle.kts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
7
buildSrc/src/main/kotlin/VersionConstants.kt
Normal file
7
buildSrc/src/main/kotlin/VersionConstants.kt
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
object VersionConstants {
|
||||
const val cloudVersion = "1.6.0-SNAPSHOT"
|
||||
const val adventureVersion = "4.8.1"
|
||||
const val adventurePlatformVersion = "4.0.0-SNAPSHOT"
|
||||
const val adventureMinimessageVersion = "4.1.0-SNAPSHOT"
|
||||
const val bstatsVersion = "2.2.1"
|
||||
}
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,5 +1,5 @@
|
|||
#Mon Jun 01 13:25:07 CEST 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
rootProject.name = 'ServerUtils'
|
||||
include 'Common'
|
||||
include 'Bukkit'
|
||||
include 'Bungee'
|
||||
include 'Velocity'
|
||||
5
settings.gradle.kts
Normal file
5
settings.gradle.kts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
rootProject.name = "ServerUtils"
|
||||
include("Common")
|
||||
include("Bukkit")
|
||||
include("Bungee")
|
||||
include("Velocity")
|
||||
Loading…
Add table
Add a link
Reference in a new issue