update gradle

This commit is contained in:
CaiHQ 2022-05-02 23:22:13 +08:00
parent a536e8e11f
commit 3ab45488df

37
backend/build.gradle Normal file → Executable file
View File

@ -1,6 +1,11 @@
buildscript { buildscript {
repositories{
mavenCentral()
mavenLocal()
}
dependencies { dependencies {
classpath files("buildlibs/simpleypkpacker.jar") classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0"
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0"
} }
} }
@ -34,15 +39,25 @@ sourceSets {
} }
dependencies { dependencies {
api 'org.apache.logging.log4j:log4j-core:2.14.1' // api 'org.apache.logging.log4j:log4j-core:2.14.1'
api 'org.apache.logging.log4j:log4j-api:2.14.1' // api 'org.apache.logging.log4j:log4j-api:2.14.1'
implementation fileTree(dir: 'cplibs', include: '*.jar') implementation fileTree(dir: 'cplibs', include: '*.jar')
implementation fileTree(dir: 'cplibs/lib/', include: '*.jar') // implementation fileTree(dir: 'cplibs/lib/', include: '*.jar')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
// api project(":datanet-search-engine-backend")
implementation 'org.postgresql:postgresql:42.3.1'
} }
task copyLibs(type: Copy) { //task copyLibs(type: Copy) {
// from configurations.runtimeClasspath
// into "./build/output/libs/"
//}
task copyLibs(type: Copy ) {
from configurations.runtimeClasspath from configurations.runtimeClasspath
exclude {
details-> details.file.getAbsolutePath().contains("cplibs")
}
into "./build/output/libs/" into "./build/output/libs/"
} }
@ -79,12 +94,18 @@ task copyJar(type: Copy, dependsOn: ["mergeJar", ":backend:copyLibs"]) {
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) { task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) {
from './build/output/' from './build/output/'
duplicatesStrategy = DuplicatesStrategy.INCLUDE duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'contractexample.zip' archiveFileName = 'registry.zip'
destinationDirectory = file('build/') destinationDirectory = file('build/')
} }
def currVersion = "0.0.1"
task buildYPK(dependsOn: ["buildZip"]) { task buildYPK(dependsOn: ["buildZip"]) {
doLast { doLast {
org.bdware.datanet.YPKPacker.staticPack("./backend/build/contractexample.zip", "./backend/build/contractexample.ypk") org.bdware.datanet.YPKPacker.staticPack("./backend/build/registry.zip", "./backend/build/registry${currVersion}.ypk")
} }
} }
task deploy(dependsOn: ["buildYPK"]){
doLast {
org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
}
}