mirror of
https://gitee.com/BDWare/router-backend
synced 2026-02-14 23:49:25 +00:00
initial commit
This commit is contained in:
121
build.gradle
Normal file
121
build.gradle
Normal file
@@ -0,0 +1,121 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
}
|
||||
|
||||
mainClassName = 'org.bdware.server.NodeCenterServer'
|
||||
|
||||
application {
|
||||
mainClass = mainClassName
|
||||
applicationDefaultJvmArgs = ['-Dfile.encoding=UTF-8']
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":front-base")
|
||||
// https://mvnrepository.com/artifact/com.jianggujin/IKAnalyzer-lucene
|
||||
implementation 'com.jianggujin:IKAnalyzer-lucene:8.0.0'
|
||||
// https://mvnrepository.com/artifact/org.apache.lucene/lucene-core
|
||||
implementation 'org.apache.lucene:lucene-core:8.9.0'
|
||||
// https://mvnrepository.com/artifact/org.apache.lucene/lucene-queryparser
|
||||
implementation 'org.apache.lucene:lucene-queryparser:8.9.0'
|
||||
// https://mvnrepository.com/artifact/org.apache.lucene/lucene-analyzers-common
|
||||
implementation 'org.apache.lucene:lucene-analyzers-common:8.9.0'
|
||||
// https://mvnrepository.com/artifact/org.apache.lucene/lucene-backward-codecs
|
||||
implementation 'org.apache.lucene:lucene-backward-codecs:8.9.0'
|
||||
implementation 'org.apache.lucene:lucene-analyzers-smartcn:8.9.0'
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
}
|
||||
|
||||
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.dependsOn(":web-client:copyToCluster")
|
||||
tasks.processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
|
||||
|
||||
task copyScript(type: Copy) {
|
||||
from("../script/") {
|
||||
include 'ncstart.sh'
|
||||
include 'ncstop.sh'
|
||||
include 'ncconfig.json.template'
|
||||
include 'updateCluster.sh'
|
||||
}
|
||||
into "./build/output"
|
||||
println("copyScript done !")
|
||||
}
|
||||
|
||||
task copySsl(type: Copy) {
|
||||
from './ssl'
|
||||
into './build/output/ssl'
|
||||
}
|
||||
|
||||
task copyLibs(type: Copy, dependsOn: ["copyScript", 'copySsl']) {
|
||||
from configurations.runtimeClasspath
|
||||
into "./build/output/libs/"
|
||||
}
|
||||
|
||||
//task copyJar(type: Exec, dependsOn: [":front-cluster:jar", ":front-cluster:copyLibs"]) {
|
||||
// println("copyJar start")
|
||||
// commandLine "cp", "./build/libs/$project.name-$version" + ".jar", "./build/output/bdcluster.jar"
|
||||
//}
|
||||
|
||||
task copyJar(type: Copy, dependsOn: [":front-cluster:jar", ":front-cluster:copyLibs"]) {
|
||||
from "./build/libs/$project.name-${project.version}.jar"
|
||||
into "./build/output"
|
||||
rename { String fileName -> "bdcluster.jar" }
|
||||
doFirst {
|
||||
println "copyJar start"
|
||||
}
|
||||
}
|
||||
|
||||
task copyWebContent(type: Copy) {
|
||||
from("./WebContent") {
|
||||
exclude 'client/BaaSClient.html'
|
||||
exclude 'client/README.md'
|
||||
exclude 'client/.idea/'
|
||||
exclude 'client/.gitignore'
|
||||
exclude '.idea/'
|
||||
}
|
||||
into "./build/output/WebContent"
|
||||
}
|
||||
|
||||
task buildBDServerClusterZip(type: Zip, dependsOn: [":front-cluster:copyWebContent", ":front-cluster:copyScript",
|
||||
":front-cluster:copyJar"]) {
|
||||
from './build/output/'
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
archiveFileName = 'bdserver-cluster.zip'
|
||||
destinationDirectory = file('build/')
|
||||
}
|
||||
|
||||
task buildBDClusterZip(type: Zip, dependsOn: [":front-cluster:buildBDServerClusterZip"]) {
|
||||
from('./build/output/') {
|
||||
include("libs/*")
|
||||
include("bdcluster.jar")
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
archiveFileName = 'bdcluster.zip'
|
||||
destinationDirectory = file('build/')
|
||||
}
|
||||
|
||||
task buildWebContentZip(type: Zip, dependsOn: [":front-cluster:copyWebContent"]) {
|
||||
from "./build/output/WebContent"
|
||||
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
||||
archiveFileName = 'ClusterWebContent.zip'
|
||||
destinationDirectory = file('build/')
|
||||
}
|
||||
|
||||
task buildBundle(dependsOn: [":front-cluster:buildBDClusterZip", ":front-cluster:buildWebContentZip"]) {
|
||||
doLast {
|
||||
println "buildBundle in ./build/output/ successfully"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user