buildscript { repositories{ mavenCentral() mavenLocal() } dependencies { classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0" classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0" } } 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' implementation fileTree(dir: 'cplibs', include: '*.jar') // implementation fileTree(dir: 'cplibs/lib/', include: '*.jar') testImplementation 'junit:junit:4.13.2' // api project(":datanet-search-engine-backend") implementation 'org.postgresql:postgresql:42.3.1' } //task copyLibs(type: Copy) { // from configurations.runtimeClasspath // into "./build/output/libs/" //} task copyLibs(type: Copy ) { from configurations.runtimeClasspath exclude { details-> details.file.getAbsolutePath().contains("cplibs") } 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 mergeJar(dependsOn: ["sourcesJar", "jar"]) { doLast { org.bdware.datanet.YPKPacker.mergeJar("./backend/build/libs/$project.name-${project.version}.jar", "./backend/build/libs/$project.name-${project.version}-sources.jar", "./backend/build/libs/$project.name-${project.version}-all.jar") } } task copyJar(type: Copy, dependsOn: ["mergeJar", ":backend:copyLibs"]) { from "./build/libs/$project.name-${project.version}-all.jar" into "./build/output" rename { String fileName -> "sc-example.jar" } doFirst { println "copyJar start" } } task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) { from './build/output/' duplicatesStrategy = DuplicatesStrategy.INCLUDE archiveFileName = 'registry.zip' destinationDirectory = file('build/') } def currVersion = "0.0.1" task buildYPK(dependsOn: ["buildZip"]) { doLast { 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) } }