build and publishing updates

This commit is contained in:
Jason Penilla 2022-03-10 14:49:12 -07:00 committed by Jason
parent a8932bc307
commit eae247954f
27 changed files with 314 additions and 100 deletions

View file

@ -35,6 +35,12 @@ jobs:
else
echo "STATUS=release" >> $GITHUB_ENV
fi
- name: Publish Snapshot
if: "${{ env.STATUS != 'release' && github.event_name == 'push' && github.ref == 'refs/heads/1.7.0-dev' }}"
run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"
- name: Publish Release
if: "${{ env.STATUS == 'release' && github.event_name == 'release' }}"
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -PreleasePublishing

View file

@ -16,4 +16,7 @@ dependencies {
implementation(libs.gradleKotlinJvm)
implementation(libs.gradleDokka)
implementation(libs.gradleKtlint)
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}

View file

@ -1,39 +0,0 @@
object Versions {
const val checkerQual = "3.21.0"
const val geantyref = "1.3.13"
const val errorprone = "2.9.0"
// INTEGRATION DEPENDENCIES
const val guice = "4.2.3"
// DISCORD DEPENDENCIES
const val javacord = "3.1.1"
const val jda = "4.2.1_257"
// MINECRAFT DEPENDENCIES
const val brigadier = "1.0.17"
const val bukkit = "1.13.2-R0.1-SNAPSHOT"
const val commodore = "1.13"
const val bungeecord = "1.8-SNAPSHOT"
const val cloudburst = "1.0.0-SNAPSHOT"
const val adventureApi = "4.9.3"
const val adventurePlatform = "4.0.1"
const val paperApi = "1.16.5-R0.1-SNAPSHOT"
const val velocityApi = "3.1.0"
const val spongeApi7 = "7.3.0"
const val jetbrainsAnnotations = "23.0.0"
const val guava = "21.0-jre"
const val fabricLoader = "0.12.11"
const val fabricMc = "1.16.5"
const val fabricApi = "0.31.0+1.16"
// IRC DEPENDENCIES
const val pircbotx = "479835f008"
// TEST DEPENDENCIES
const val jupiterEngine = "5.8.1"
const val jmh = "1.27"
const val mockitoCore = "4.1.0"
const val mockitoKotlin = "4.0.0"
const val truth = "1.1.3"
}

View file

@ -16,7 +16,7 @@ indra {
testWith(8, 11, 17)
}
checkstyle("9.0")
checkstyle(libs.versions.checkstyle.get())
}
/* Disable checkstyle on tests */
@ -93,13 +93,13 @@ repositories {
}
dependencies {
compileOnlyApi("org.checkerframework", "checker-qual", Versions.checkerQual)
testImplementation("org.junit.jupiter", "junit-jupiter-engine", Versions.jupiterEngine)
testImplementation("org.mockito", "mockito-core", Versions.mockitoCore)
testImplementation("org.mockito.kotlin", "mockito-kotlin", Versions.mockitoKotlin)
testImplementation("com.google.truth", "truth", Versions.truth)
testImplementation("com.google.truth.extensions", "truth-java8-extension", Versions.truth)
errorprone("com.google.errorprone", "error_prone_core", Versions.errorprone)
compileOnlyApi(libs.checkerQual)
testImplementation(libs.jupiterEngine)
testImplementation(libs.mockitoCore)
testImplementation(libs.mockitoKotlin)
testImplementation(libs.truth)
testImplementation(libs.truthJava8)
errorprone(libs.errorproneCore)
// Silences compiler warnings from guava using errorprone
compileOnly("com.google.errorprone", "error_prone_annotations", Versions.errorprone)
compileOnly(libs.errorproneAnnotations)
}

View file

@ -1,5 +1,7 @@
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Project
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.the
// set by GitHub Actions
val Project.ci: Provider<Boolean>
@ -10,3 +12,6 @@ val Project.ci: Provider<Boolean>
val Project.compileExamples: Boolean
get() = providers.gradleProperty("compile-examples")
.isPresent
val Project.libs: LibrariesForLibs
get() = the()

View file

@ -3,14 +3,7 @@ plugins {
id("com.github.ben-manes.versions")
}
group = "cloud.commandframework"
version = "1.7.0-SNAPSHOT"
description = "Command framework and dispatcher for the JVM"
subprojects {
if (name != "cloud-bom") {
apply(plugin = "cloud.base-conventions")
}
if (!name.startsWith("example-")) {
apply(plugin = "cloud.publishing-conventions")
}

View file

@ -1,3 +1,7 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
implementation(projects.cloudCore)
}

View file

@ -1,7 +1,11 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudServices)
compileOnly("com.google.inject", "guice", Versions.guice)
testImplementation("org.openjdk.jmh", "jmh-core", Versions.jmh)
testImplementation("org.openjdk.jmh", "jmh-generator-annprocess", Versions.jmh)
testImplementation("com.google.inject", "guice", Versions.guice)
compileOnly(libs.guice)
testImplementation(libs.jmhCore)
testImplementation(libs.jmhGeneratorAnnprocess)
testImplementation(libs.guice)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
implementation("org.javacord", "javacord", Versions.javacord)
implementation(libs.javacord)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
compileOnly ("net.dv8tion", "JDA", Versions.jda)
compileOnly (libs.jda)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
implementation("com.github.pircbotx", "pircbotx", Versions.pircbotx)
implementation(libs.pircbotx)
}

View file

@ -1,6 +1,10 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
implementation(projects.cloudCore)
/* Needs to be provided by the platform */
compileOnly("com.mojang", "brigadier", Versions.brigadier)
testImplementation("com.mojang", "brigadier", Versions.brigadier)
compileOnly(libs.brigadier)
testImplementation(libs.brigadier)
}

View file

@ -1,9 +1,13 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
api(projects.cloudBrigadier)
api(projects.cloudTasks)
compileOnly("org.bukkit", "bukkit", Versions.bukkit)
compileOnly("me.lucko", "commodore", Versions.commodore)
compileOnly("org.jetbrains", "annotations", Versions.jetbrainsAnnotations)
compileOnly("com.google.guava", "guava", Versions.guava)
compileOnly(libs.bukkit)
compileOnly(libs.commodore)
compileOnly(libs.jetbrainsAnnotations)
compileOnly(libs.guava)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
compileOnly("net.md-5", "bungeecord-api", Versions.bungeecord)
compileOnly(libs.bungeecord)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
compileOnly("org.cloudburstmc", "cloudburst-server", Versions.cloudburst)
compileOnly(libs.cloudburst)
}

View file

@ -2,6 +2,7 @@ import net.fabricmc.loom.task.AbstractRunTask
import net.ltgt.gradle.errorprone.errorprone
plugins {
id("cloud.base-conventions")
id("quiet-fabric-loom") version "0.11-SNAPSHOT"
}
@ -40,19 +41,21 @@ tasks {
}
dependencies {
minecraft("com.mojang", "minecraft", Versions.fabricMc)
minecraft(libs.fabricMinecraft)
mappings(loom.officialMojangMappings())
modImplementation("net.fabricmc", "fabric-loader", Versions.fabricLoader)
modImplementation(fabricApi.module("fabric-command-api-v1", Versions.fabricApi))
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", Versions.fabricApi))
modImplementation(libs.fabricLoader)
modImplementation(fabricApi.module("fabric-command-api-v1", libs.versions.fabricApi.get()))
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", libs.versions.fabricApi.get()))
modApi(include("me.lucko", "fabric-permissions-api", "0.1-SNAPSHOT"))
modImplementation(libs.fabricPermissionsApi)
include(libs.fabricPermissionsApi)
api(include(projects.cloudCore)!!)
api(include(projects.cloudBrigadier)!!)
api(include(projects.cloudServices)!!)
api(include("io.leangen.geantyref", "geantyref", Versions.geantyref))
api(libs.geantyref)
include(libs.geantyref)
}
/* set up a testmod source set */

View file

@ -1,5 +1,9 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
api("net.kyori", "adventure-api", Versions.adventureApi)
api("net.kyori", "adventure-text-serializer-plain", Versions.adventureApi)
api(libs.adventureApi)
api(libs.adventureTextSerializerPlain)
}

View file

@ -1,7 +1,11 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudBukkit)
compileOnly("com.destroystokyo.paper", "paper-api", Versions.paperApi)
compileOnly("com.destroystokyo.paper", "paper-mojangapi", Versions.paperApi)
compileOnly("org.jetbrains", "annotations", Versions.jetbrainsAnnotations)
compileOnly("com.google.guava", "guava", Versions.guava)
compileOnly(libs.paperApi)
compileOnly(libs.paperMojangApi)
compileOnly(libs.jetbrainsAnnotations)
compileOnly(libs.guava)
}

View file

@ -1,4 +1,8 @@
plugins {
id("cloud.base-conventions")
}
dependencies {
api(projects.cloudCore)
compileOnly("org.spongepowered", "spongeapi", Versions.spongeApi7)
compileOnly(libs.spongeApi7)
}

View file

@ -1,3 +1,7 @@
plugins {
id("cloud.base-conventions")
}
java {
disableAutoTargetJvm()
}
@ -5,5 +9,5 @@ java {
dependencies {
api(projects.cloudCore)
api(projects.cloudBrigadier)
compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi)
compileOnly(libs.velocityApi)
}

View file

@ -1,3 +1,7 @@
dependencies {
api("io.leangen.geantyref", "geantyref", Versions.geantyref)
plugins {
id("cloud.base-conventions")
}
dependencies {
api(libs.geantyref)
}

View file

@ -0,0 +1,3 @@
plugins {
id("cloud.base-conventions")
}

View file

@ -12,12 +12,12 @@ dependencies {
implementation(project(":cloud-annotations"))
implementation(project(":cloud-minecraft-extras"))
/* Extras */
implementation("me.lucko", "commodore", Versions.commodore) {
implementation(libs.commodore) {
isTransitive = false
}
implementation("net.kyori", "adventure-platform-bukkit", Versions.adventurePlatform)
implementation(libs.adventurePlatformBukkit)
/* Bukkit */
compileOnly("org.bukkit", "bukkit", Versions.bukkit)
compileOnly(libs.bukkit)
}
tasks {

View file

@ -20,7 +20,7 @@ dependencies {
implementation(project(":cloud-annotations"))
implementation(project(":cloud-minecraft-extras"))
/* Extras */
implementation("net.kyori", "adventure-platform-bungeecord", Versions.adventurePlatform)
implementation(libs.adventurePlatformBungeecord)
/* Bungee*/
compileOnly("net.md-5", "bungeecord-api", "1.8-SNAPSHOT")
}

View file

@ -69,6 +69,7 @@ dependencies {
api(project(":cloud-velocity"))
api(project(":cloud-minecraft-extras"))
api(project(":cloud-annotations"))
annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi))
velocityRunClasspath("com.velocitypowered", "velocity-proxy", Versions.velocityApi)
annotationProcessor(libs.velocityApi)
compileOnly(libs.velocityApi)
velocityRunClasspath("com.velocitypowered", "velocity-proxy", libs.versions.velocityApi.get())
}

View file

@ -1,3 +1,7 @@
group=cloud.commandframework
version=1.7.0-SNAPSHOT
description=Command framework and dispatcher for the JVM
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1G

View file

@ -5,18 +5,58 @@ metadata:
plugins:
com.github.johnrengelman.shadow: 7.1.2
com.github.ben-manes.versions: 0.36.0
org.jlleitschuh.gradle.ktlint: &ktlint 10.2.0
com.github.ben-manes.versions: 0.42.0
org.jlleitschuh.gradle.ktlint: &ktlint 10.2.1
versions:
checkstyle: 9.0
checkerQual: 3.21.3
errorprone: 2.9.0
geantyref: 1.3.13
jmh: 1.27
# integration
guice: 4.2.3
# kotlin
kotlin: &kotlin 1.5.31
dokka: *kotlin
coroutines: 1.5.2
checkerQual: 3.14.0
# discord
javacord: 3.1.1
jda: 4.2.1_257
# irc
pircbotx: 83a4c22e80
# minecraft
guava: 21.0-jre
brigadier: 1.0.17
bukkit: 1.13.2-R0.1-SNAPSHOT
commodore: 1.13
bungeecord: 1.8-SNAPSHOT
cloudburst: 1.0.0-SNAPSHOT
adventureApi: 4.9.3
adventurePlatform: 4.1.0
paperApi: 1.16.5-R0.1-SNAPSHOT
velocityApi: 3.1.0
spongeApi7: 7.3.0
jetbrainsAnnotations: 23.0.0
fabricMinecraft: 1.16.5
fabricLoader: 0.13.3
fabricApi: 0.31.0+1.16
fabricPermissionsApi: 0.1-SNAPSHOT
# testing
jupiterEngine : 5.8.2
mockitoCore : 4.1.0
mockitoKotlin : 4.0.0
truth : 1.1.3
# build-logic
indra: 2.0.6
gradleTestLogger: 3.0.0
indra: 2.1.1
gradleTestLogger: 3.1.0
gradleErrorprone: 2.0.2
licenser: 0.6.1
ktlint: *ktlint
@ -26,7 +66,34 @@ dependencies:
group: org.checkerframework
name: checker-qual
version: { ref: checkerQual }
errorproneCore:
group: com.google.errorprone
name: error_prone_core
version: { ref: errorprone }
errorproneAnnotations:
group: com.google.errorprone
name: error_prone_annotations
version: { ref: errorprone }
geantyref:
group: io.leangen.geantyref
name: geantyref
version: { ref: geantyref }
jmhCore:
group: org.openjdk.jmh
name: jmh-core
version: { ref: jmh }
jmhGeneratorAnnprocess:
group: org.openjdk.jmh
name: jmh-generator-annprocess
version: { ref: jmh }
# integration
guice:
group: com.google.inject
name: guice
version: { ref: guice }
# kotlin
coroutinesCore:
group: org.jetbrains.kotlinx
name: kotlinx-coroutines-core
@ -36,6 +103,118 @@ dependencies:
name: kotlinx-coroutines-jdk8
version: { ref: coroutines }
# discord
javacord:
group: org.javacord
name: javacord
version: { ref: javacord }
jda:
group: net.dv8tion
name: JDA
version: { ref: jda }
# irc
pircbotx:
group: com.github.pircbotx
name: pircbotx
version: { ref: pircbotx }
# minecraft
guava:
group: com.google.guava
name: guava
version: { ref: guava }
brigadier:
group: com.mojang
name: brigadier
version: { ref: brigadier }
bukkit:
group: org.bukkit
name: bukkit
version: { ref: bukkit }
commodore:
group: me.lucko
name: commodore
version: { ref: commodore }
jetbrainsAnnotations:
group: org.jetbrains
name: annotations
version: { ref: jetbrainsAnnotations }
bungeecord:
group: net.md-5
name: bungeecord-api
version: { ref: bungeecord }
cloudburst:
group: org.cloudburstmc
name: cloudburst-server
version: { ref: cloudburst }
adventureApi:
group: net.kyori
name: adventure-api
version: { ref: adventureApi }
adventurePlatformBukkit:
group: net.kyori
name: adventure-platform-bukkit
version: { ref: adventurePlatform }
adventurePlatformBungeecord:
group: net.kyori
name: adventure-platform-bungeecord
version: { ref: adventurePlatform }
adventureTextSerializerPlain:
group: net.kyori
name: adventure-text-serializer-plain
version: { ref: adventureApi }
paperApi:
group: com.destroystokyo.paper
name: paper-api
version: { ref: paperApi }
paperMojangApi :
group: com.destroystokyo.paper
name: paper-mojangapi
version: { ref: paperApi }
spongeApi7:
group: org.spongepowered
name: spongeapi
version: { ref: spongeApi7 }
velocityApi:
group: com.velocitypowered
name: velocity-api
version: { ref: velocityApi }
fabricMinecraft:
group: com.mojang
name: minecraft
version: { ref: fabricMinecraft }
fabricLoader:
group: net.fabricmc
name: fabric-loader
version: { ref: fabricLoader }
fabricPermissionsApi:
group: me.lucko
name: fabric-permissions-api
version: { ref: fabricPermissionsApi }
# testing
jupiterEngine:
group: org.junit.jupiter
name: junit-jupiter-engine
version: { ref: jupiterEngine }
mockitoCore:
group: org.mockito
name: mockito-core
version: { ref: mockitoCore }
mockitoKotlin:
group: org.mockito.kotlin
name: mockito-kotlin
version: { ref: mockitoKotlin }
truth:
group: com.google.truth
name: truth
version: { ref: truth }
truthJava8:
group: com.google.truth.extensions
name: truth-java8-extension
version: { ref: truth }
# build-logic
indraCommon:
group: net.kyori