build: 更改项目结构
This commit is contained in:
81
core-bukkit/build.gradle
Normal file
81
core-bukkit/build.gradle
Normal file
@@ -0,0 +1,81 @@
|
||||
//file:noinspection GroovyAssignabilityCheck
|
||||
//file:noinspection VulnerableLibrariesLocal
|
||||
//file:noinspection GrDeprecatedAPIUsage
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '7+'
|
||||
}
|
||||
setArchivesBaseName("HamsterCore-Bukkit")
|
||||
|
||||
evaluationDependsOn(':core-common')
|
||||
|
||||
dependencies {
|
||||
//noinspection VulnerableLibrariesLocal
|
||||
compileOnly 'org.spigotmc:spigot-api:1.19.4-R0.1-SNAPSHOT'
|
||||
|
||||
compileOnly 'net.milkbowl.vault:VaultAPI:1.7' transitive false
|
||||
compileOnly 'org.black_ixx:playerpoints:2.1.3' transitive false
|
||||
|
||||
implementation project(":core-common") transitive false
|
||||
//noinspection GradlePackageUpdate
|
||||
implementation "com.zaxxer:HikariCP:${HikariCP_version}"
|
||||
//noinspection VulnerableLibrariesLocal
|
||||
implementation "net.kyori:adventure-platform-bukkit:${adventure_version}" exclude group: 'org.jetbrains' exclude group: 'com.google.code.gson'
|
||||
// https://mvnrepository.com/artifact/net.kyori/adventure-text-minimessage
|
||||
implementation "net.kyori:adventure-text-minimessage:${adventure_serializer_version}" exclude group: 'org.jetbrains'
|
||||
// https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson
|
||||
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
|
||||
implementation "net.kyori:adventure-text-serializer-legacy:${adventure_serializer_version}" exclude group: 'org.jetbrains'
|
||||
implementation "de.tr7zw:item-nbt-api:2.11.2"
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
filesMatching("plugin.yml") {
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
classifier = 'dev'
|
||||
}
|
||||
|
||||
tasks.compileJava.dependsOn(":core-common:build")
|
||||
shadowJar {
|
||||
classifier = ''
|
||||
dependencies {
|
||||
exclude(dependency {
|
||||
it.moduleGroup == 'com.google.code.gson'
|
||||
})
|
||||
}
|
||||
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'
|
||||
relocate 'de.tr7zw.changeme.nbtapi', 'cn.hamster3.mc.plugin.core.lib.nbtapi'
|
||||
relocate 'de.tr7zw.annotations', 'cn.hamster3.mc.plugin.core.lib.nbtapi.annotations'
|
||||
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