123 lines
3.4 KiB
Groovy
123 lines
3.4 KiB
Groovy
buildscript {
|
|
dependencies {
|
|
classpath files("buildlibs/simple-ypk-packer-0.3.0.jar")
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'java'
|
|
id 'java-library'
|
|
}
|
|
|
|
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.17.0'
|
|
// api 'org.apache.logging.log4j:log4j-api:2.17.0'
|
|
api 'com.google.code.gson:gson:2.8.8'
|
|
implementation fileTree(dir:'cplib',include: '*.jar')
|
|
implementation fileTree(dir:'cplib/libs',include: '*.jar')
|
|
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-codecs:8.9.0'
|
|
implementation 'org.apache.lucene:lucene-backward-codecs:8.9.0'
|
|
implementation 'org.apache.lucene:lucene-analyzers-smartcn:8.9.0'
|
|
implementation 'org.testng:testng:7.1.0'
|
|
implementation 'org.neo4j:neo4j:3.3.5'
|
|
implementation 'org.bdware.doip:doip-audit-tool:0.9.0'
|
|
|
|
|
|
testImplementation 'junit:junit:4.13.2'
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
task copyLibs(type: Copy ) {
|
|
from configurations.runtimeClasspath
|
|
exclude {
|
|
details-> details.file.getAbsolutePath().contains("cplib")
|
|
}
|
|
into "./build/output/libs/"
|
|
}
|
|
|
|
//task copyLibs(type: Copy) {
|
|
//
|
|
// from configurations.runtimeClasspath
|
|
// into "./build/output/libs/"
|
|
//}
|
|
task copyYJS(type: Copy) {
|
|
from "./yjs"
|
|
into "./build/output/"
|
|
}
|
|
|
|
|
|
|
|
task sourcesJar(type:Jar) {
|
|
from sourceSets.main.allJava
|
|
archiveClassifier = 'sources'
|
|
}
|
|
|
|
|
|
task copyJar(type: Copy, dependsOn: [":datanet-search-engine-backend:jar", ":datanet-search-engine-backend:copyLibs"]) {
|
|
//task copyJar(type: Copy, dependsOn: ["mergeJar"]) {
|
|
from "./build/libs/$project.name-${project.version}.jar"
|
|
into "./build/output"
|
|
rename { String fileName -> "SearchEngine.jar" }
|
|
doFirst {
|
|
println "copyJar start"
|
|
}
|
|
}
|
|
task copyFront(type: Copy){
|
|
from "../datanet-search-engine-front/dist"
|
|
into "./build/output/assets/"
|
|
doFirst {
|
|
println "copyFront start"
|
|
}
|
|
}
|
|
|
|
def reltivePath = "./datanet-search-engine-backend"
|
|
//reltivePath="."
|
|
task grepCP (dependsOn:["copyJar"]){
|
|
doLast {
|
|
org.bdware.datanet.YPKPacker.grepCPLib("${reltivePath}/cplib","${reltivePath}/build/output/libs")
|
|
}
|
|
}
|
|
|
|
task buildZip(type: Zip, dependsOn: ["copyJar", "copyYJS","copyFront","grepCP"]) {
|
|
from './build/output/'
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
|
archiveFileName = 'SearchEngine.zip'
|
|
destinationDirectory = file('build/')
|
|
}
|
|
|
|
|
|
task buildYPK (dependsOn:["buildZip"]){
|
|
doLast {
|
|
org.bdware.datanet.YPKPacker.staticPack("${reltivePath}/build/SearchEngine.zip","${reltivePath}/build/SearchEngine-${project.version}.ypk")
|
|
}
|
|
}
|