-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feature] Bump version to 2.2.3, No longer including dependent classes
- Loading branch information
1 parent
01d01b8
commit 283d1d2
Showing
12 changed files
with
216 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import org.gradle.api.JavaVersion | ||
import org.gradle.api.tasks.compile.JavaCompile | ||
import org.gradle.api.tasks.javadoc.Javadoc | ||
import org.gradle.kotlin.dsl.`java-library` | ||
import org.gradle.kotlin.dsl.repositories | ||
|
||
plugins { | ||
`java-library` | ||
`kotlin-dsl` | ||
} | ||
|
||
allprojects { | ||
apply(plugin = "java-library") | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
url = uri("https://oss.sonatype.org/content/groups/public/") | ||
} | ||
|
||
maven { | ||
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") | ||
} | ||
|
||
maven { | ||
url = uri("https://repo1.maven.org/maven2/") | ||
} | ||
|
||
maven { | ||
url = uri("https://repo.maven.apache.org/maven2/") | ||
} | ||
} | ||
|
||
group = "com.huanmeng-qwq" | ||
version = "2.2.3" | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
tasks.withType<JavaCompile>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.withType<Javadoc>() { | ||
options.encoding = "UTF-8" | ||
if (JavaVersion.current().isJava9Compatible) { | ||
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.indra) | ||
implementation("cl.franciscosolis.sonatype-central-upload:cl.franciscosolis.sonatype-central-upload.gradle.plugin:1.0.3") | ||
compileOnly(files(libs::class.java.protectionDomain.codeSource.location)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
register("libs") { | ||
from(files("../gradle/libs.versions.toml")) // include from parent project | ||
} | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
buildSrc/src/main/kotlin/com.huanmeng-qwq.java-conventions.gradle.kts
This file was deleted.
Oops, something went wrong.
102 changes: 102 additions & 0 deletions
102
buildSrc/src/main/kotlin/me.huanmeng.gui.publish-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import groovy.util.Node | ||
import groovy.util.NodeList | ||
|
||
plugins { | ||
`maven-publish` | ||
`java-library` | ||
id("net.kyori.indra") | ||
id("net.kyori.indra.publishing") | ||
id("cl.franciscosolis.sonatype-central-upload") | ||
} | ||
|
||
indra { | ||
github("huanmeng-qwq", "Gui") { | ||
ci(true) | ||
} | ||
mitLicense() | ||
|
||
javaVersions { | ||
target(8) | ||
minimumToolchain(17) | ||
} | ||
|
||
configurePublications { | ||
pom { | ||
url = "https://github.com/huanmeng-qwq/Gui" | ||
description = "Lightweight Inventory API for Bukkit Development" | ||
developers { | ||
developer { | ||
id = "huanmeng-qwq" | ||
name = "huanmeng_qwq" | ||
email = "huanmeng@huanmeng-qwq.com" | ||
} | ||
} | ||
withXml { | ||
project.configurations.compileOnly.get().allDependencies.forEach { dep -> | ||
((asNode().get("dependencies") as NodeList)[0] as Node).appendNode("dependency").apply { | ||
appendNode("groupId", dep.group) | ||
appendNode("artifactId", dep.name) | ||
appendNode("version", dep.version) | ||
appendNode("scope", "provided") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<JavaCompile>().configureEach { | ||
options.compilerArgs = mutableListOf("-Xlint:-deprecation,-unchecked") | ||
} | ||
|
||
fun read(str: String?): String? { | ||
if (str == null) { | ||
return null | ||
} | ||
try { | ||
val file = File(str).let { | ||
if (!it.exists()) { | ||
return@let File(uri(str)) | ||
} | ||
it | ||
} | ||
if (file.exists()) { | ||
return file.readText(Charsets.UTF_8) | ||
} | ||
} catch (_: Exception) { | ||
} | ||
return str | ||
} | ||
|
||
val cleanUpload by tasks.creating(Delete::class) { | ||
setDelete(project.files(project.layout.buildDirectory.dir("sonatype-central-upload"))) | ||
} | ||
|
||
tasks.sonatypeCentralUpload { | ||
// gradle sonatypeCentralUpload -PCENTRAL_USERNAME=<username> -PCENTRAL_PASSWORD=<password> -PCENTRAL_PRIVATE_KEY=<privateKey> -PCENTRAL_PRIVATE_KEY_PWD=<privateKeyPwd> -PCENTRAL_PUBLIC_KEY=<publicKey> | ||
val centralUsername = read(System.getenv("MAVEN_USERNAME") ?: findProperty("CENTRAL_USERNAME")?.toString()) | ||
val centralPassword = read(System.getenv("MAVEN_PASSWORD") ?: findProperty("CENTRAL_PASSWORD")?.toString()) | ||
val privateKey = read(System.getenv("MAVEN_PRIVATE_KEY") ?: findProperty("CENTRAL_PRIVATE_KEY")?.toString()) | ||
val privateKeyPwd = | ||
read(System.getenv("MAVEN_PRIVATE_KEY_PWD") ?: findProperty("CENTRAL_PRIVATE_KEY_PWD")?.toString()) | ||
val publicKey = read(System.getenv("MAVEN_PUBLIC_KEY") ?: findProperty("CENTRAL_PUBLIC_KEY")?.toString()) | ||
dependsOn(tasks.build, tasks.generatePomFileForMavenPublication, cleanUpload) | ||
this.username = centralUsername | ||
this.password = centralPassword | ||
this.publishingType = "MANUAL" | ||
this.signingKey = privateKey | ||
this.signingKeyPassphrase = privateKeyPwd | ||
this.publicKey = publicKey | ||
archives = project.layout.buildDirectory.dir("libs").get().asFileTree | ||
pom = file(project.layout.buildDirectory.file("publications/maven/pom-default.xml")) | ||
} | ||
|
||
tasks.test { | ||
onlyIf { !gradle.startParameter.taskNames.contains("sonatypeCentralUpload") } | ||
} | ||
|
||
project.afterEvaluate { | ||
tasks.findByName("shadowJar")?.apply { | ||
onlyIf { !gradle.startParameter.taskNames.contains("sonatypeCentralUpload") } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
plugins { | ||
id("com.huanmeng-qwq.java-conventions") | ||
id("me.huanmeng.gui.publish-conventions") | ||
} | ||
|
||
dependencies { | ||
api("net.kyori:adventure-api:4.14.0") | ||
api("net.kyori:adventure-platform-bukkit:4.3.1") | ||
api("net.kyori:adventure-text-serializer-legacy:4.14.0") | ||
api("org.bstats:bstats-bukkit:3.0.2") | ||
implementation("net.kyori:adventure-api:4.14.0") | ||
implementation("net.kyori:adventure-platform-bukkit:4.3.1") | ||
implementation("net.kyori:adventure-text-serializer-legacy:4.14.0") | ||
implementation("org.bstats:bstats-bukkit:3.0.2") | ||
compileOnly("org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT") | ||
compileOnly("org.jetbrains:annotations:24.1.0") | ||
} | ||
|
||
description = "Bukkit-Gui" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[versions] | ||
adventure = "4.14.0" | ||
adventure-bukkit = "4.3.1" | ||
bstats = "3.0.2" | ||
[libraries] | ||
|
||
adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" } | ||
adventure-bukkit = { group = "net.kyori", name = "adventure-platform-bukkit", version.ref = "adventure-bukkit" } | ||
adventure-text-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" } | ||
bstats = { group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats" } | ||
|
||
indra = { module = "net.kyori:indra-common", version = "3.1.3" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
id("com.huanmeng-qwq.java-conventions") | ||
`kotlin-dsl` | ||
id("me.huanmeng.gui.publish-conventions") | ||
kotlin("jvm") | ||
} | ||
|
||
dependencies { | ||
api("org.jetbrains.kotlin:kotlin-stdlib:2.0.0") | ||
api(project(":Bukkit-Gui")) | ||
implementation(project(":bukkit-gui")) | ||
compileOnly("org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT") | ||
} | ||
|
||
description = "Bukkit-Gui-kotlin-dsl" | ||
kotlin { | ||
compilerOptions.jvmTarget = JvmTarget.JVM_1_8 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} | ||
|
||
rootProject.name = "Bukkit-Gui-pom" | ||
include(":Bukkit-Gui") | ||
include(":Bukkit-Gui-kotlin-dsl") | ||
project(":Bukkit-Gui").projectDir = file("core") | ||
project(":Bukkit-Gui-kotlin-dsl").projectDir = file("kotlin-dsl") | ||
include(":bukkit-gui") | ||
include(":bukkit-gui-kotlin-dsl") | ||
project(":bukkit-gui").apply { | ||
projectDir = file("core") | ||
} | ||
project(":bukkit-gui-kotlin-dsl").apply { | ||
projectDir = file("kotlin-dsl") | ||
} |