build: 优化构建脚本
This commit is contained in:
@@ -1,9 +1,3 @@
|
||||
//file:noinspection GroovyAssignabilityCheck
|
||||
//file:noinspection VulnerableLibrariesLocal
|
||||
//file:noinspection GrDeprecatedAPIUsage
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '7+'
|
||||
}
|
||||
setArchivesBaseName("HamsterCore-BungeeCord")
|
||||
|
||||
evaluationDependsOn(':core-common')
|
||||
@@ -31,40 +25,3 @@ processResources {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier = 'dev'
|
||||
}
|
||||
|
||||
tasks.compileJava.dependsOn(":core-common:build")
|
||||
shadowJar {
|
||||
classifier = ''
|
||||
relocate 'org.slf4j', 'cn.hamster3.mc.plugin.core.lib.slf4j'
|
||||
relocate 'net.kyori', 'cn.hamster3.mc.plugin.core.lib.kyori'
|
||||
relocate 'com.zaxxer.hikari', 'cn.hamster3.mc.plugin.core.lib.hikari'
|
||||
destinationDir(getRootProject().buildDir)
|
||||
}
|
||||
tasks.build.dependsOn(shadowJar)
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
shadow(MavenPublication) { publication ->
|
||||
{
|
||||
from 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", "")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user