ControlProxy/backend/build.gradle
2022-04-20 21:48:32 +08:00

86 lines
2.0 KiB
Groovy

buildscript {
dependencies {
classpath files("buildlibs/simple-ypk-packer-0.2.0.jar")
}
}
plugins {
id 'java'
id 'java-library'
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:none'
options.compilerArgs << '-Xlint:deprecation' << "-Werror"
}
sourceSets {
main {
java {
srcDirs 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
dependencies {
api 'org.apache.logging.log4j:log4j-core:2.14.1'
api 'org.apache.logging.log4j:log4j-api:2.14.1'
api 'com.google.code.gson:gson:2.8.8'
implementation fileTree(dir: 'cplibs', include: '*.jar')
implementation fileTree(dir: 'cplibs/lib/', include: '*.jar')
implementation 'org.bdware.doip:doip-audit-tool:0.9.0'
testImplementation 'junit:junit:4.13.2'
}
task copyLibs(type: Copy) {
from configurations.runtimeClasspath
into "./build/output/libs/"
}
task copyYJS(type: Copy) {
from "./yjs"
into "./build/output/"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task copyAssets(type: Copy) {
from "../front"
into "./build/output/assets/"
}
task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) {
from "./build/libs/$project.name-${project.version}.jar"
into "./build/output"
rename { String fileName -> "controlproxy-${project.version}.jar" }
doFirst {
println "copyJar start"
}
}
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) {
from './build/output/'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'ControlProxy.zip'
destinationDirectory = file('build/')
}
task buildYPK(dependsOn: ["buildZip"]) {
doLast {
org.bdware.datanet.YPKPacker.staticPack("./backend/build/ControlProxy.zip", "./backend/build/ControlProxy-${project.version}.ypk")
}
}