project_version=4.4.14.19 * 修复clear指令构建命令时抛出转型异常导致无法正确发送指令 * 修复ChangePolicy增加和减小index写反的问题
98 lines
2.3 KiB
Groovy
98 lines
2.3 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'java-library'
|
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
|
id 'maven-publish'
|
|
}
|
|
|
|
group = project_group
|
|
version = project_version
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
}
|
|
}
|
|
|
|
base {
|
|
archivesName = "${project_name}-${common_suffix}"
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
javadoc {
|
|
options.encoding = 'UTF-8'
|
|
options.charSet = 'UTF-8'
|
|
// 添加以下选项以减少警告
|
|
options.addBooleanOption('Xdoclint:none', true)
|
|
options.addStringOption('Xmaxwarns', '10')
|
|
}
|
|
|
|
dependencies {
|
|
// Common 依赖 CommonApi
|
|
api project(':CommonApi')
|
|
}
|
|
|
|
// Sources JAR
|
|
tasks.register('sourcesJar', Jar) {
|
|
from sourceSets.main.allSource
|
|
archiveClassifier = 'sources'
|
|
}
|
|
|
|
// Javadoc JAR
|
|
tasks.register('javadocJar', Jar) {
|
|
dependsOn javadoc
|
|
from javadoc.destinationDir
|
|
archiveClassifier = 'javadoc'
|
|
}
|
|
|
|
// Shadow JAR: 只把 CommonApi 打包进 Common
|
|
shadowJar {
|
|
// 只把 CommonApi 的源代码 + Common 自己的源代码打包
|
|
from sourceSets.main.output // Common 自己的代码
|
|
from project(':CommonApi').sourceSets.main.output // CommonApi 的代码
|
|
|
|
// 不要包含 runtimeClasspath 的依赖
|
|
configurations = [] // 空数组,不包含其它依赖
|
|
|
|
mergeServiceFiles()
|
|
archiveClassifier.set('') // 覆盖默认 jar
|
|
}
|
|
|
|
|
|
// 将 shadowJar 绑定到 build
|
|
build.dependsOn shadowJar
|
|
|
|
// Javadoc 配置
|
|
javadoc {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
// 发布配置
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact shadowJar
|
|
artifact sourcesJar
|
|
artifact javadocJar
|
|
pom {
|
|
name = "${project_name}"
|
|
description = "${project_name}"
|
|
url = "https://github.com/3944Realms/DG_LAB_DEVELOP"
|
|
|
|
licenses {
|
|
license {
|
|
name = 'Apache License 2.0'
|
|
url = 'https://www.apache.org/licenses/LICENSE-2.0.html'
|
|
}
|
|
}
|
|
issueManagement {
|
|
system = 'GitHub Issues'
|
|
url = 'https://github.com/3944Realms/DG_LAB_DEVELOP/issues'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|