加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 7.81 KB
一键复制 编辑 原始数据 按行查看 历史
蔡华谦 提交于 2024-07-22 21:08 . update doip
plugins {
id 'java'
id 'application'
}
mainClassName = 'org.bdware.server.CMHttpServer'
apply from: '../spotless.gradle'
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")
implementation project(":consistency-sdk")
implementation 'io.prometheus:simpleclient_httpserver:0.12.0'
implementation 'org.hyperic.sigar:sigar:1.6.4'
implementation 'io.grpc:grpc-all:1.43.1'
implementation 'org.apache.velocity:velocity-engine-core:2.3'
implementation 'com.nimbusds:nimbus-jose-jwt:9.10'
implementation 'org.bdware.doip:doip-sdk:1.5.5'
implementation 'org.bdware.doip:doip-audit-tool:1.5.3'
implementation 'org.bdware.doip:bdosclient:0.1.0'
implementation fileTree(dir: 'lib', include: '*.jar')
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'
// 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'
}
compileJava {
options.compilerArgs << "-Xlint:unchecked"
}
repositories {
mavenCentral()
}
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)
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"
}
}
task copyScript(type: Copy) {
from("./script/") {
include 'cmstart.sh'
include 'cmstop.sh'
include 'cmconfig.json.template'
include 'killContracts.sh'
include 'genKeyAndCMConfig.sh'
include 'cmvar.json'
include 'log4j2.properties'
}
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'
}
task copyCustomPlugin(type: Copy, dependsOn: [":custom-plugin:jar"]) {
from '../custom-plugin/build/libs/custom-plugin.jar'
into "./build/output/libs/"
}
task copyLibs(type: Copy, dependsOn: ["copyScript", 'copySsl', 'copyCustomPlugin']) {
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'
}
into "./build/output/WebContent"
}
task copyDockerfile(type: Copy) {
from "./Dockerfile"
into "./build/"
}
task copyKeys(type: Copy) {
from "./keys"
into "./build/output/keys"
}
task buildBDServerZip(type: Zip, dependsOn: [":agent-backend:copyWebContent",
":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/')
}
task buildBDServerZipLite(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/TF**/'
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/')
}
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"]) {
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/')
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化