This commit is contained in:
CaiHQ
2023-03-06 14:32:46 +08:00
parent 905b06be39
commit 6b21c7ff7c
12 changed files with 535 additions and 134 deletions

View File

@@ -39,6 +39,9 @@ sourceSets {
dependencies {
api 'org.apache.logging.log4j:log4j-core:2.17.2'
api 'org.apache.logging.log4j:log4j-api:2.17.2'
implementation 'org.postgresql:postgresql:42.5.4'
implementation 'org.bdware.doip:irp-sdk:1.1.3'
implementation 'org.bdware.sc:cp:1.6.8'
testImplementation 'junit:junit:4.13.2'
}
@@ -63,16 +66,16 @@ task copyAssets(type: Copy) {
}
task copyJar(type: Copy, dependsOn: [":backend:jar", ":backend:copyLibs"]) {
from "./build/libs/$project.name-${project.version}.jar"
from "./build/libs/backend.jar"
into "./build/output"
rename { String fileName -> "sc-example.jar" }
rename { String fileName -> "gdrouter.jar" }
doFirst {
println "copyJar start"
}
}
def reltivePath = "./backend"
//reltivePath="."
def currVersion = "1.3.2"
def currVersion = "0.0.1"
task grepCP(dependsOn: ["copyJar"]) {
doLast {
org.bdware.datanet.YPKPacker.grepJarByCPVersion("${reltivePath}/build/output/libs", org.bdware.datanet.CPVersion.cp_1_6_8)
@@ -86,17 +89,17 @@ tasks.processTestResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS", "grepCP"]) {
from './build/output/'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'contractexample.zip'
archiveFileName = 'gdrouter.zip'
destinationDirectory = file('build/')
}
task buildYPK(dependsOn: ["buildZip"]) {
doLast {
org.bdware.datanet.YPKPacker.staticPack("${reltivePath}/build/contractexample.zip", "${reltivePath}/build/contractexample-${currVersion}.ypk")
org.bdware.datanet.YPKPacker.staticPack("${reltivePath}/build/gdrouter.zip", "${reltivePath}/build/gdrouter-${currVersion}.ypk")
}
}
task deploy(dependsOn: ["buildYPK"]) {
doLast {
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("${reltivePath}/debugconf.json", "${reltivePath}/build/contractexample-${currVersion}.ypk")
org.bdware.ypkdeploy.HTTPTool.deployWithYpk("${reltivePath}/debugconf.json", "${reltivePath}/build/gdrouter-${currVersion}.ypk")
}
}