ControlProxy/backend/build.gradle

118 lines
3.3 KiB
Groovy
Raw Normal View History

2021-11-17 03:28:40 +00:00
buildscript {
2022-06-25 03:11:03 +00:00
repositories {
mavenCentral()
mavenLocal()
}
2021-11-17 03:28:40 +00:00
dependencies {
2023-02-15 16:17:58 +00:00
classpath "org.bdware.bdcontract:simple-ypk-packer:0.5.5"
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.7.1"
2022-06-25 03:11:03 +00:00
2021-11-17 03:28:40 +00:00
}
}
plugins {
id 'java'
id 'java-library'
}
2023-02-15 16:17:58 +00:00
version = "1.3.92"
2022-06-25 03:11:03 +00:00
group = 'org.bdware.sc.controlproxy'
2021-11-17 03:28:40 +00:00
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 {
2022-06-25 03:11:03 +00:00
api 'org.apache.logging.log4j:log4j-core:2.17.2'
api 'org.apache.logging.log4j:log4j-api:2.17.2'
2022-04-19 01:26:59 +00:00
api 'com.google.code.gson:gson:2.8.8'
2023-02-15 16:17:58 +00:00
implementation 'org.bdware.sc:cp:1.6.8'
implementation 'org.bdware.doip:doip-audit-tool:1.1.3'
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
2021-11-17 03:28:40 +00:00
testImplementation 'junit:junit:4.13.2'
2023-02-15 16:17:58 +00:00
testImplementation 'org.bdware.bdcontract:ypk-deploy-tool:0.7.1'
2021-11-17 03:28:40 +00:00
}
task copyLibs(type: Copy) {
from configurations.runtimeClasspath
into "./build/output/libs/"
2022-06-25 03:11:03 +00:00
2021-11-17 03:28:40 +00:00
}
task copyYJS(type: Copy) {
from "./yjs"
into "./build/output/"
}
2021-12-07 09:00:03 +00:00
task sourcesJar(type: Jar) {
2021-11-17 03:28:40 +00:00
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
2021-12-07 09:00:03 +00:00
task copyAssets(type: Copy) {
2021-11-17 03:28:40 +00:00
from "../front"
into "./build/output/assets/"
}
2022-04-19 01:26:59 +00:00
task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) {
2022-04-20 04:00:37 +00:00
from "./build/libs/$project.name-${project.version}.jar"
2021-11-17 03:28:40 +00:00
into "./build/output"
2022-04-20 04:00:37 +00:00
rename { String fileName -> "controlproxy-${project.version}.jar" }
2021-11-17 03:28:40 +00:00
doFirst {
println "copyJar start"
}
2022-06-25 03:11:03 +00:00
}
2023-02-15 16:17:58 +00:00
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
tasks.processTestResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
2022-06-25 03:11:03 +00:00
task grepCP(dependsOn: [":backend:copyJar"]) {
doLast {
2023-02-15 16:17:58 +00:00
org.bdware.datanet.YPKPacker.grepJarByCPVersion("./backend/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8)
2022-06-25 03:11:03 +00:00
// org.bdware.datanet.YPKPacker.grepCPLibWithFilter("./backend/cplibs/libs/", "./backend/build/output/libs", "./backend/grepcp.list")
}
2021-11-17 03:28:40 +00:00
}
2022-06-25 03:11:03 +00:00
task buildZip(type: Zip, dependsOn: ["copyAssets", "grepCP", "copyJar", "copyYJS"]) {
2021-11-17 03:28:40 +00:00
from './build/output/'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
2022-04-19 01:26:59 +00:00
archiveFileName = 'ControlProxy.zip'
2021-11-17 03:28:40 +00:00
destinationDirectory = file('build/')
}
2022-06-25 03:11:03 +00:00
task buildYPK(dependsOn: ["buildZip", "grepCP"]) {
2021-11-17 03:28:40 +00:00
doLast {
2022-04-19 01:26:59 +00:00
org.bdware.datanet.YPKPacker.staticPack("./backend/build/ControlProxy.zip", "./backend/build/ControlProxy-${project.version}.ypk")
2021-11-17 03:28:40 +00:00
}
}
2022-06-25 03:11:03 +00:00
task deploy(dependsOn: ["buildYPK"]) {
doLast {
org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
}
2023-02-15 16:17:58 +00:00
}
task putPackage(type: Exec, dependsOn: ["buildYPK"]) {
workingDir "./build"
commandLine "pwd"
commandLine "curl", "--user", "${REPO_USRNAME}:${REPO_PASSWORD}", "--upload-file", "./ControlProxy-${project.version}.ypk","${REPO_HOST}api/packages/iod/generic/ControlProxy/${project.version}/ControlProxy-${project.version}.ypk"
doLast {
println "Executed!"
}
2022-06-25 03:11:03 +00:00
}