build: 优化构建脚本

This commit is contained in:
2023-06-16 21:39:34 +08:00
parent 20517e7207
commit 421f28586e
7 changed files with 54 additions and 137 deletions

View File

@@ -1,4 +1,3 @@
//file:noinspection GroovyAssignabilityCheck
setArchivesBaseName("HamsterCore-Common")
dependencies {
@@ -7,42 +6,16 @@ dependencies {
//noinspection VulnerableLibrariesLocal
compileOnly 'com.google.code.gson:gson:2.8.0'
// https://mvnrepository.com/artifact/net.kyori/adventure-api
compileOnly "net.kyori:adventure-api:${adventure_version}"
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-api
compileOnly "net.kyori:adventure-platform-api:${adventure_version}"
implementation "net.kyori:adventure-platform-api:${adventure_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
compileOnly "net.kyori:adventure-text-minimessage:${adventure_serializer_version}"
implementation "net.kyori:adventure-text-minimessage:${adventure_serializer_version}" exclude group: 'org.jetbrains'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
compileOnly "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}"
implementation "net.kyori:adventure-text-serializer-gson:${adventure_serializer_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
compileOnly "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
implementation "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}" exclude group: 'org.jetbrains'
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from project.components.java
}
}
repositories {
maven {
def releasesRepoUrl = 'https://maven.airgame.net/maven-releases/'
def snapshotsRepoUrl = 'https://maven.airgame.net/maven-snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = rootProject.properties.getOrDefault("maven_username", "")
password = rootProject.properties.getOrDefault("maven_password", "")
}
}
}
}