sdk-java/build.gradle
2021-09-24 17:57:22 +08:00

72 lines
1.6 KiB
Groovy

plugins {
id 'java-library'
}
group 'com.bdware.sc'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs 'src/main/java', 'src/main/sdk'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
dependencies {
api project(":gmhelper")
api 'javax.websocket:javax.websocket-api:1.1'
api 'log4j:log4j:1.2.17'
api 'org.apache.logging.log4j:log4j-core:2.14.1'
api 'org.apache.logging.log4j:log4j-api:2.14.1'
api 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17'
testImplementation 'junit:junit:4.13.2'
}
jar {
String libs = ''
configurations.runtimeClasspath.each {
libs = libs + " libs/" + it.name
}
manifest {
attributes 'Manifest-Version': archiveVersion
// attributes 'Main-Class': "com.bdware.client.AutoRegister"
attributes 'Class-Path': libs
attributes 'Main-Class': 'org.bdware.client.Main'
}
}
task copyJar(type: Copy, dependsOn: [":sdk-java:jar", ":sdk-java:copyLibs"]) {
into "./build/output/"
from "./build/libs/$project.name-${version}.jar"
}
task copyLibs(type: Copy) {
into "./build/output/libs/"
from configurations.runtimeClasspath
}
task release(type: Zip, dependsOn: ["copyJar", "copyLibs"]) {
from "./build/output/"
duplicatesStrategy = DuplicatesStrategy.INCLUDE
archiveFileName = "java-client-${projectIds.version}.zip"
destinationDirectory = file('build/')
}