2021-11-17 03:28:40 +00:00
|
|
|
buildscript {
|
2022-05-02 15:12:25 +00:00
|
|
|
repositories{
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
}
|
2021-11-17 03:28:40 +00:00
|
|
|
dependencies {
|
2022-05-02 15:12:25 +00:00
|
|
|
classpath "org.bdware.bdcontract:simple-ypk-packer:0.3.0"
|
|
|
|
classpath "org.bdware.bdcontract:ypk-deploy-tool:0.4.0"
|
2021-11-17 03:28:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2022-05-02 15:12:25 +00:00
|
|
|
// api 'org.apache.logging.log4j:log4j-core:2.14.1'
|
|
|
|
// api 'org.apache.logging.log4j:log4j-api:2.14.1'
|
2021-12-07 09:00:03 +00:00
|
|
|
implementation fileTree(dir: 'cplibs', include: '*.jar')
|
2022-05-02 15:12:25 +00:00
|
|
|
// implementation fileTree(dir: 'cplibs/lib/', include: '*.jar')
|
2021-11-17 03:28:40 +00:00
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2022-05-02 15:12:25 +00:00
|
|
|
// api project(":datanet-search-engine-backend")
|
|
|
|
implementation 'org.postgresql:postgresql:42.3.1'
|
2021-11-17 03:28:40 +00:00
|
|
|
}
|
|
|
|
|
2022-05-02 15:12:25 +00:00
|
|
|
//task copyLibs(type: Copy) {
|
|
|
|
// from configurations.runtimeClasspath
|
|
|
|
// into "./build/output/libs/"
|
|
|
|
//}
|
|
|
|
|
|
|
|
task copyLibs(type: Copy ) {
|
2021-11-17 03:28:40 +00:00
|
|
|
from configurations.runtimeClasspath
|
2022-05-02 15:12:25 +00:00
|
|
|
exclude {
|
|
|
|
details-> details.file.getAbsolutePath().contains("cplibs")
|
|
|
|
}
|
2021-11-17 03:28:40 +00:00
|
|
|
into "./build/output/libs/"
|
|
|
|
}
|
|
|
|
|
|
|
|
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/"
|
|
|
|
}
|
2021-12-07 09:00:03 +00:00
|
|
|
task mergeJar(dependsOn: ["sourcesJar", "jar"]) {
|
2021-11-17 03:28:40 +00:00
|
|
|
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"
|
2021-12-07 09:00:03 +00:00
|
|
|
rename { String fileName -> "sc-example.jar" }
|
2021-11-17 03:28:40 +00:00
|
|
|
doFirst {
|
|
|
|
println "copyJar start"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-07 09:00:03 +00:00
|
|
|
task buildZip(type: Zip, dependsOn: ["copyAssets", "copyJar", "copyYJS"]) {
|
2021-11-17 03:28:40 +00:00
|
|
|
from './build/output/'
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
2022-05-02 15:12:25 +00:00
|
|
|
archiveFileName = 'registry.zip'
|
2021-11-17 03:28:40 +00:00
|
|
|
destinationDirectory = file('build/')
|
|
|
|
}
|
2022-05-02 15:12:25 +00:00
|
|
|
def currVersion = "0.0.1"
|
2021-12-07 09:00:03 +00:00
|
|
|
task buildYPK(dependsOn: ["buildZip"]) {
|
2021-11-17 03:28:40 +00:00
|
|
|
doLast {
|
2022-05-02 15:12:25 +00:00
|
|
|
org.bdware.datanet.YPKPacker.staticPack("./backend/build/registry.zip", "./backend/build/registry${currVersion}.ypk")
|
2021-11-17 03:28:40 +00:00
|
|
|
}
|
|
|
|
}
|
2022-05-02 15:12:25 +00:00
|
|
|
|
|
|
|
task deploy(dependsOn: ["buildYPK"]){
|
|
|
|
doLast {
|
|
|
|
org.bdware.ypkdeploy.HTTPTool.batchRun("./backend/deployconfig.json", true)
|
|
|
|
}
|
|
|
|
}
|