cp/build.gradle

197 lines
5.5 KiB
Groovy
Raw Normal View History

2021-09-29 09:55:13 +00:00
plugins {
id 'java'
2022-01-04 02:43:53 +00:00
id 'java-library'
id 'maven-publish'
id 'signing'
2021-09-29 09:55:13 +00:00
}
group = "org.bdware.sc"
2023-03-30 06:59:28 +00:00
version = "1.8.3"
2023-03-15 08:28:00 +00:00
tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:none'
// options.compilerArgs << '-Xlint:deprecation' << "-Werror"
options.compilerArgs << '-parameters'
}
2022-01-08 15:43:21 +00:00
repositories {
mavenCentral()
mavenLocal()
2022-01-08 15:43:21 +00:00
}
2021-09-29 09:55:13 +00:00
sourceSets {
main {
java {
2021-11-02 04:58:35 +00:00
srcDirs 'src/main/java', 'src/main/debugger', 'src/main/data-mask'
2021-09-29 09:55:13 +00:00
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDirs 'src/test/java', 'src/test/data-mask'
}
resources {
srcDir 'src/test/resources'
}
}
}
dependencies {
2022-01-04 02:43:53 +00:00
api project(":common")
api project(":mockjava")
2021-12-21 09:59:45 +00:00
implementation 'org.apache.commons:commons-lang3:3.0'
2021-09-29 09:55:13 +00:00
implementation 'com.atlassian.commonmark:commonmark:0.17.0'
implementation 'com.idealista:format-preserving-encryption:1.0.0'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'org.codehaus.groovy:groovy-all:3.0.8'
2021-12-21 09:59:45 +00:00
implementation 'io.grpc:grpc-all:1.41.0'
2022-01-04 02:43:53 +00:00
implementation 'org.jsoup:jsoup:1.14.2'
implementation 'com.sun.mail:javax.mail:1.6.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
2022-11-08 09:37:53 +00:00
implementation 'org.bdware.bdcontract:sdk-java:1.0.2'
2023-04-05 08:24:39 +00:00
implementation 'org.bdware.doip:doip-audit-tool:1.2.2'
implementation 'org.bdware.doip:doip-sdk:1.4.0'
2022-06-28 12:40:49 +00:00
implementation fileTree(dir: 'lib', include: '*.jar')
2021-09-29 09:55:13 +00:00
testImplementation 'junit:junit:4.13.2'
}
tasks.jar.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
task classJar(type: Jar, dependsOn: classes) {
classifier = "jar"
}
2023-03-15 08:28:00 +00:00
2021-09-29 09:55:13 +00:00
jar {
String libs = ''
configurations.runtimeClasspath.each {
libs = libs + " libs/" + it.name
}
from {
// uncomment this when publish,
2023-02-20 08:02:42 +00:00
// while develop at local use "false"
configurations.runtimeClasspath.filter {
2023-04-05 08:24:39 +00:00
it.getAbsolutePath().contains("/lib/")
//false
}.collect {
it.isDirectory() ? it : zipTree(it)
}
}
2021-09-29 09:55:13 +00:00
manifest {
attributes 'Manifest-Version': project.version
2022-05-13 17:17:54 +00:00
attributes 'Main-Class': 'org.bdware.sc.ContractProcess'
2021-09-29 09:55:13 +00:00
attributes 'Class-Path': libs
}
}
tasks.withType(Copy).all {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(Jar).all {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
2021-09-29 09:55:13 +00:00
task copyLibs(type: Copy, dependsOn: ":common:jar") {
into "./build/output/libs/"
from configurations.runtimeClasspath
}
task copyJar(type: Copy, dependsOn: [":cp:jar", ":cp:copyLog4jProp"]) {
2021-09-29 09:55:13 +00:00
into "./build/output/"
from "./build/libs/$project.name-${version}.jar"
rename { String fileName -> "yjs.jar" }
2022-06-10 21:34:40 +00:00
}
task copyLog4jProp(type: Copy) {
into "./build/output/"
from "./src/main/resources/log4j2.debug.properties"
from "./src/main/resources/log4j2.properties"
2021-09-29 09:55:13 +00:00
}
task buildBundle(dependsOn: [":cp:copyLibs", ":cp:copyJar"]) {
doLast {
println "buildBundle in ./build/output/ successfully"
}
}
task sourceJar(type: Jar, dependsOn: classes) {
archiveClassifier = "sources"
classifier = "sources"
from sourceSets.main.allSource
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
classifier = "javadoc"
2023-03-27 08:11:49 +00:00
exclude { details -> details.file.getAbsolutePath().contains("/gm/")
}
from javadoc.destinationDir
}
//shadowJar {
2022-05-13 17:17:54 +00:00
// // classifier = "jar"
// dependencies {
// include(dependency(fileTree(dir: 'lib', include: '*.jar')))
//// exclude(dependency('com.google.code.gson:gson:2.8.6'))
//// relocate 'com.google.code.gson', 'irs.com.google.code.gson'
// }
//}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId "cp"
version "${version}"
from components.java
artifact sourceJar
artifact javadocJar
artifact classJar
2022-05-13 17:17:54 +00:00
// artifact customFatJar
pom {
name = "bdware-cp"
description = "cp"
url = "https://gitee.com/BDWare/cp"
licenses {
license {
name = "GPL v2"
url = "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt"
}
}
developers {
developer {
id = "dataware"
email = "caihq@pku.edu.cn"
}
}
scm {
connection = "scm:git:https://gitee.com/BDWare/cp.git"
developerConnection = "scm:git:https://gitee.com/BDWare/cp.git"
url = "https://gitee.com/BDWare/cp"
}
}
}
}
repositories {
maven {
name 'bdwareSnapshotRepository'
url 'https://oss.sonatype.org/content/repositories/snapshots'
credentials {
username = "${NEXUS_USERNAME}"
password = "${NEXUS_PASSWORD}"
}
}
maven {
name 'bdwareRepository'
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username = "${NEXUS_USERNAME}"
password = "${NEXUS_PASSWORD}"
}
}
}
}
signing {
sign publishing.publications.mavenJava
2021-09-29 09:55:13 +00:00
}