build: 优化构建脚本

This commit is contained in:
2022-10-29 04:54:10 +08:00
parent 1387c58fd4
commit 750dbc7055
5 changed files with 13 additions and 8 deletions

View File

@@ -27,6 +27,9 @@ subprojects {
dependencies { dependencies {
// https://mvnrepository.com/artifact/org.jetbrains/annotations // https://mvnrepository.com/artifact/org.jetbrains/annotations
compileOnly 'org.jetbrains:annotations:23.0.0' compileOnly 'org.jetbrains:annotations:23.0.0'
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
} }
java { java {
@@ -61,11 +64,9 @@ subprojects {
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
var projectNameSplit = project.name.split('-') def projectNameSplit = project.name.split('-')
artifactId = projectNameSplit[projectNameSplit.length - 1] artifactId = projectNameSplit[projectNameSplit.length - 1]
artifact jar from project.components.java
artifact sourcesJar
// artifact javadocJar
} }
} }
repositories { repositories {

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx2G
hamster_core_version=1.0.0 hamster_core_version=1.0.0-SNAPSHOT

View File

@@ -9,7 +9,7 @@ dependencies {
compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
compileOnly "cn.hamster3.mc.plugin:hamster-core-bukkit:${hamster_core_version}" compileOnly "cn.hamster3.mc.plugin.core:bukkit:${hamster_core_version}"
} }
processResources { processResources {

View File

@@ -8,7 +8,8 @@ dependencies {
} }
compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT' compileOnly 'net.md-5:bungeecord-api:1.19-R0.1-SNAPSHOT'
compileOnly "cn.hamster3.mc.plugin:hamster-core-bungeecord:${hamster_core_version}"
compileOnly "cn.hamster3.mc.plugin.core:bungeecord:${hamster_core_version}"
} }
processResources { processResources {

View File

@@ -7,7 +7,10 @@ dependencies {
// https://mvnrepository.com/artifact/io.netty/netty-all // https://mvnrepository.com/artifact/io.netty/netty-all
compileOnly 'io.netty:netty-all:4.1.84.Final' compileOnly 'io.netty:netty-all:4.1.84.Final'
compileOnly "cn.hamster3.mc.plugin:hamster-core-common:${hamster_core_version}" compileOnly "cn.hamster3.mc.plugin.core:common:${hamster_core_version}"
// https://mvnrepository.com/artifact/net.kyori/adventure-api
compileOnly 'net.kyori:adventure-api:4.11.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'