perf: 优化代码
This commit is contained in:
23
build.gradle
23
build.gradle
@@ -58,27 +58,4 @@ subprojects {
|
|||||||
'https://bukkit.windit.net/javadoc'
|
'https://bukkit.windit.net/javadoc'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
mavenJava(MavenPublication) {
|
|
||||||
def projectNameSplit = project.name.split('-')
|
|
||||||
artifactId = projectNameSplit[projectNameSplit.length - 1]
|
|
||||||
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", "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@@ -1,3 +1,4 @@
|
|||||||
|
//file:noinspection GroovyAssignabilityCheck
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||||
}
|
}
|
||||||
@@ -10,9 +11,6 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(":hamster-core-common") transitive false
|
|
||||||
shade project(":hamster-core-common") transitive false
|
|
||||||
|
|
||||||
implementation "de.tr7zw:item-nbt-api:2.11.2"
|
implementation "de.tr7zw:item-nbt-api:2.11.2"
|
||||||
|
|
||||||
//noinspection VulnerableLibrariesLocal
|
//noinspection VulnerableLibrariesLocal
|
||||||
@@ -21,10 +19,9 @@ dependencies {
|
|||||||
compileOnly 'net.milkbowl.vault:VaultAPI:1.7' transitive false
|
compileOnly 'net.milkbowl.vault:VaultAPI:1.7' transitive false
|
||||||
compileOnly 'org.black_ixx:playerpoints:2.1.3' transitive false
|
compileOnly 'org.black_ixx:playerpoints:2.1.3' transitive false
|
||||||
|
|
||||||
|
api project(":hamster-core-common") transitive false
|
||||||
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-bukkit
|
// https://mvnrepository.com/artifact/net.kyori/adventure-platform-bukkit
|
||||||
api "net.kyori:adventure-platform-bukkit:${adventure_version}"
|
api "net.kyori:adventure-platform-bukkit:${adventure_version}"
|
||||||
//noinspection VulnerableLibrariesLocal
|
|
||||||
oldJar "net.kyori:adventure-platform-bukkit:${adventure_version}"
|
|
||||||
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
|
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
|
||||||
api "net.kyori:adventure-text-minimessage:${adventure_serializer_version}"
|
api "net.kyori:adventure-text-minimessage:${adventure_serializer_version}"
|
||||||
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
|
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
|
||||||
@@ -32,14 +29,13 @@ dependencies {
|
|||||||
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
|
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-legacy
|
||||||
api "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}"
|
api "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}"
|
||||||
|
|
||||||
// // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
|
|
||||||
// api 'com.squareup.okhttp3:okhttp:4.10.0'
|
|
||||||
// oldJar 'com.squareup.okhttp3:okhttp:4.10.0'
|
|
||||||
|
|
||||||
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
|
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
|
||||||
compileOnly "com.zaxxer:HikariCP:${HikariCP_version}"
|
compileOnly "com.zaxxer:HikariCP:${HikariCP_version}"
|
||||||
|
|
||||||
//noinspection GradlePackageUpdate
|
//noinspection GradlePackageUpdate
|
||||||
oldJar 'com.zaxxer:HikariCP:4.0.3'
|
oldJar 'com.zaxxer:HikariCP:4.0.3'
|
||||||
|
//noinspection VulnerableLibrariesLocal
|
||||||
|
oldJar "net.kyori:adventure-platform-bukkit:${adventure_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
@@ -52,6 +48,12 @@ processResources {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jar {
|
||||||
|
//noinspection GrDeprecatedAPIUsage
|
||||||
|
classifier = "jar"
|
||||||
|
}
|
||||||
|
|
||||||
tasks.compileJava.dependsOn(":hamster-core-common:build")
|
tasks.compileJava.dependsOn(":hamster-core-common:build")
|
||||||
shadowJar {
|
shadowJar {
|
||||||
//noinspection GrDeprecatedAPIUsage
|
//noinspection GrDeprecatedAPIUsage
|
||||||
@@ -84,4 +86,29 @@ tasks.register("oldJar", Jar) {
|
|||||||
])
|
])
|
||||||
destinationDir(getRootProject().buildDir)
|
destinationDir(getRootProject().buildDir)
|
||||||
}
|
}
|
||||||
tasks.build.dependsOn(oldJar)
|
tasks.build.dependsOn(oldJar)
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
shadow(MavenPublication) { publication ->
|
||||||
|
{
|
||||||
|
def projectNameSplit = project.name.split('-')
|
||||||
|
artifactId = projectNameSplit[projectNameSplit.length - 1]
|
||||||
|
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", "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
//file:noinspection GroovyAssignabilityCheck
|
||||||
setArchivesBaseName("HamsterCore-BungeeCord")
|
setArchivesBaseName("HamsterCore-BungeeCord")
|
||||||
|
|
||||||
evaluationDependsOn(':hamster-core-common')
|
evaluationDependsOn(':hamster-core-common')
|
||||||
@@ -68,3 +69,27 @@ tasks.register("oldJar", Jar) {
|
|||||||
destinationDir(getRootProject().buildDir)
|
destinationDir(getRootProject().buildDir)
|
||||||
}
|
}
|
||||||
tasks.build.dependsOn(oldJar)
|
tasks.build.dependsOn(oldJar)
|
||||||
|
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
def projectNameSplit = project.name.split('-')
|
||||||
|
artifactId = projectNameSplit[projectNameSplit.length - 1]
|
||||||
|
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", "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
//file:noinspection GroovyAssignabilityCheck
|
||||||
setArchivesBaseName("HamsterCore-Common")
|
setArchivesBaseName("HamsterCore-Common")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -28,3 +29,26 @@ dependencies {
|
|||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
def projectNameSplit = project.name.split('-')
|
||||||
|
artifactId = projectNameSplit[projectNameSplit.length - 1]
|
||||||
|
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", "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user