agent-backend/build.gradle

237 lines
7.8 KiB
Groovy
Raw Permalink Normal View History

2021-09-26 04:49:24 +00:00
plugins {
id 'java'
id 'application'
}
mainClassName = 'org.bdware.server.CMHttpServer'
2023-12-15 08:41:27 +00:00
apply from: '../spotless.gradle'
2021-09-26 04:49:24 +00:00
2021-09-26 04:49:24 +00:00
application {
mainClass = mainClassName
applicationDefaultJvmArgs = ['-Dfile.encoding=UTF-8', '-Djava.library.path="./dynamicLibrary"']
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
dependencies {
implementation project(":cm")
implementation project(":mockjava")
implementation project(":front-base")
2022-02-15 06:44:15 +00:00
implementation project(":consistency-sdk")
2021-09-26 04:49:24 +00:00
implementation 'io.prometheus:simpleclient_httpserver:0.12.0'
implementation 'org.hyperic.sigar:sigar:1.6.4'
implementation 'io.grpc:grpc-all:1.43.1'
2021-12-21 09:48:30 +00:00
implementation 'org.apache.velocity:velocity-engine-core:2.3'
implementation 'com.nimbusds:nimbus-jose-jwt:9.10'
2024-12-23 08:13:27 +00:00
implementation 'org.bdware.doip:doip-sdk:1.5.6'
implementation 'org.bdware.doip:doip-audit-tool:1.5.4'
2023-12-15 08:40:55 +00:00
implementation 'org.bdware.doip:bdosclient:0.1.0'
2022-05-23 09:14:09 +00:00
implementation fileTree(dir: 'lib', include: '*.jar')
2021-09-26 04:49:24 +00:00
testImplementation 'junit:junit:4.13.2'
implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final-linux-aarch_64-fedora'
2023-04-24 10:57:40 +00:00
// implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
// implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
// implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
// implementation 'io.netty:netty-tcnative-boringssl-static:2.0.59.Final'
2021-09-26 04:49:24 +00:00
}
2021-10-29 09:47:48 +00:00
2021-09-26 04:49:24 +00:00
compileJava {
2021-10-29 09:47:48 +00:00
options.compilerArgs << "-Xlint:unchecked"
2021-09-26 04:49:24 +00:00
}
2022-01-08 16:04:04 +00:00
repositories {
mavenCentral()
}
2021-09-26 04:49:24 +00:00
jar {
String libs = ''
configurations.runtimeClasspath.each {
libs = libs + " libs/" + it.name
}
manifest {
attributes 'Manifest-Version': project.version
attributes 'Main-Class': mainClassName
attributes 'Class-Path': libs
}
}
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
2021-10-29 09:47:48 +00:00
task prepareWebContent(type: Exec) {
if (System.properties['os.name'].toString().toLowerCase().contains('windows')) {
commandLine "rmdir", ".\\WebContent\\ide"
commandLine "mklink", "/j", "..\\..\\agent-frontend", ".\\WebContent\\ide"
} else {
commandLine "rm", "./WebContent/ide"
commandLine "ln", "-s", "../../agent-frontend", "./WebContent/ide"
}
}
2021-09-26 04:49:24 +00:00
task copyScript(type: Copy) {
2021-10-29 09:47:48 +00:00
from("./script/") {
2021-09-26 04:49:24 +00:00
include 'cmstart.sh'
include 'cmstop.sh'
include 'cmconfig.json.template'
include 'killContracts.sh'
2022-05-05 05:28:28 +00:00
include 'genKeyAndCMConfig.sh'
include 'cmvar.json'
include 'log4j2.properties'
2021-09-26 04:49:24 +00:00
}
into "./build/output"
println("copyScript done !")
}
task copyScriptBDLedger(type: Copy) {
from("../script/") {
include 'cmstart.sh'
include 'cmconfig.json'
include 'cmstartbdledger.sh'
include 'cmstop.sh'
include 'cmconfig.json.template'
include 'killContracts.sh'
include 'updateContract.sh'
include 'installClusterWithBdledger.sh'
}
into "./build/output"
println("copyScript done !")
}
task copySsl(type: Copy) {
from './ssl'
into './build/output/ssl'
}
task copyDynamicLibrary(type: Copy) {
from './dynamicLibrary/'
into './build/output/dynamicLibrary'
}
2022-05-27 09:48:25 +00:00
task copyCustomPlugin(type: Copy, dependsOn: [":custom-plugin:jar"]) {
from '../custom-plugin/build/libs/custom-plugin.jar'
into "./build/output/libs/"
}
2021-09-26 04:49:24 +00:00
task copyLibs(type: Copy, dependsOn: ["copyScript", 'copySsl', 'copyCustomPlugin']) {
2021-09-26 04:49:24 +00:00
from configurations.runtimeClasspath
into "./build/output/libs/"
}
//task copyJar(type: Exec, dependsOn: [":agent-backend:jar", ":agent-backend:copyLibs", ":agent-backend:copyDynamicLibrary"]) {
// println("copyJar start")
// commandLine "cp", "./build/libs/$project.name-${project.version}.jar", "./build/output/bdagent.jar"
//}
task copyJar(type: Copy, dependsOn: [":agent-backend:jar", ":agent-backend:copyLibs", ":agent-backend:copyDynamicLibrary"]) {
from "./build/libs/$project.name-${project.version}.jar"
into "./build/output"
rename { String fileName -> "bdagent.jar" }
doFirst {
println "copyJar start"
}
}
task copyBDWareProjectDir(type: Copy, dependsOn: [":agent-backend:copyJar", ":agent-backend:copyDockerfile"]) {
from "./contracts"
into "./build/output/BDWareProjectDir/public"
}
task copyWebContent(type: Copy) {
from("./WebContent") {
exclude 'ide/BaaSOnlineIDE.html'
exclude 'ide/.idea/'
exclude 'ide/.gitignore'
exclude 'client/BaaSClient.html'
exclude 'client/README.md'
exclude 'client/.idea/'
exclude 'client/.gitignore'
exclude '.keep'
2021-09-26 04:49:24 +00:00
}
into "./build/output/WebContent"
}
task copyDockerfile(type: Copy) {
from "./Dockerfile"
into "./build/"
}
task copyKeys(type: Copy) {
from "./keys"
into "./build/output/keys"
}
2021-10-29 09:47:48 +00:00
task buildBDServerZip(type: Zip, dependsOn: [":agent-backend:copyWebContent",
2021-09-26 04:49:24 +00:00
":agent-backend:copyBDWareProjectDir", ":agent-backend:copyScript",
":agent-backend:copyJar", ":agent-backend:copyLibs", ":agent-backend:copyKeys"]) {
from './build/output/'
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'bdserver.zip'
destinationDirectory = file('build/')
}
2021-10-29 09:47:48 +00:00
task buildBDServerZipLite(type: Zip, dependsOn: [":agent-backend:copyWebContent",
2021-09-26 04:49:24 +00:00
":agent-backend:copyBDWareProjectDir", ":agent-backend:copyScript",
":agent-backend:copyJar", ":agent-backend:copyLibs",
":agent-backend:copyKeys"]) {
2021-09-26 04:49:24 +00:00
from('./build/output/') {
exclude 'BDWareProjectDir/public/TF**/'
2021-09-26 04:49:24 +00:00
exclude 'WebContent/doc/'
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'bdserver-lite.zip'
destinationDirectory = file('build/')
}
task buildBDServerZipMin(type: Zip, dependsOn: [":agent-backend:copyWebContent",
":agent-backend:copyBDWareProjectDir", ":agent-backend:copyScript",
":agent-backend:copyJar", ":agent-backend:copyLibs",
":agent-backend:copyKeys"]) {
from('./build/output/') {
exclude 'BDWareProjectDir/public/**'
exclude 'WebContent/doc/'
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'bdserver-min.zip'
destinationDirectory = file('build/')
}
2021-09-26 04:49:24 +00:00
task buildBDServerZipUpdate(type: Zip, dependsOn: [":agent-backend:copyCP", ":agent-backend:copyWebContent",
":agent-backend:copyBDWareProjectDir", ":agent-backend:copyScript",
":agent-backend:copyJar", ":agent-backend:copyLibs",
":agent-backend:copyKeys"]) {
2021-09-26 04:49:24 +00:00
from('./build/output/') {
include '*.jar'
include 'libs/'
include 'WebContent/'
exclude 'WebContent/doc/'
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'bdserver-update.zip'
destinationDirectory = file('build/')
}
task buildWebContentZip(type: Zip, dependsOn: [":agent-backend:copyCP", ":agent-backend:copyWebContent"]) {
from "./build/output/WebContent"
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = 'AgentWebContent.zip'
destinationDirectory = file('build/')
}