Launcher/LaunchServer/build.gradle

228 lines
6.8 KiB
Groovy
Raw Normal View History

def mainClassName = "pro.gravit.launchserver.LaunchServerStarter"
def mainAgentName = "pro.gravit.launchserver.StarterAgent"
2018-09-17 10:07:32 +03:00
evaluationDependsOn(':Launcher')
2018-09-17 10:07:32 +03:00
repositories {
2019-04-03 16:27:40 +03:00
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "http://maven.geomajas.org/"
}
2018-09-17 10:07:32 +03:00
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
configurations {
2019-04-03 16:27:40 +03:00
compileOnlyA
bundleOnly
bundle
hikari
pack
launch4j
launch4jCJ
bundleOnly.extendsFrom bundle
compile.extendsFrom bundle, hikari, pack, launch4jCJ, launch4j
2018-09-17 10:07:32 +03:00
}
jar {
2019-04-03 16:27:40 +03:00
dependsOn parent.childProjects.Launcher.tasks.build
from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } }
from(parent.childProjects.Launcher.tasks.shadowJar.archivePath)
from(parent.childProjects.Launcher.tasks.genRuntimeJS.archivePath)
2019-04-03 16:27:40 +03:00
manifest.attributes("Main-Class": mainClassName,
"Premain-Class": mainAgentName,
"Can-Redefine-Classes": "true",
"Can-Retransform-Classes": "true",
"Can-Set-Native-Method-Prefix": "true"
)
2018-09-17 10:07:32 +03:00
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
task cleanjar(type: Jar, dependsOn: jar) {
classifier = 'clean'
manifest.attributes("Main-Class": mainClassName,
"Premain-Class": mainAgentName,
"Can-Redefine-Classes": "true",
"Can-Retransform-Classes": "true",
"Can-Set-Native-Method-Prefix": "true"
)
from sourceSets.main.output
}
2018-09-17 10:07:32 +03:00
dependencies {
pack project(':LauncherAPI')
bundle 'org.ow2.asm:asm-commons:7.1'
bundle 'mysql:mysql-connector-java:8.0.16'
2019-10-19 19:46:04 +03:00
bundle 'org.postgresql:postgresql:42.2.6'
bundle 'org.jline:jline:3.13.1'
bundle 'org.jline:jline-reader:3.13.1'
bundle 'org.jline:jline-terminal:3.13.1'
bundle 'net.sf.proguard:proguard-base:6.2.0'
bundle 'org.fusesource.jansi:jansi:1.18'
2019-04-03 16:27:40 +03:00
bundle 'commons-io:commons-io:2.6'
bundle 'commons-codec:commons-codec:1.12'
bundle 'org.apache.httpcomponents:httpclient:4.5.10'
bundle 'io.netty:netty-all:4.1.43.Final'
bundle 'org.hibernate:hibernate-core:5.4.9.Final'
bundle 'org.bouncycastle:bcpkix-jdk15on:1.61'
2019-04-03 16:27:40 +03:00
bundle 'org.slf4j:slf4j-simple:1.7.25'
bundle 'org.slf4j:slf4j-api:1.7.25'
hikari 'io.micrometer:micrometer-core:1.0.6'
hikari('com.zaxxer:HikariCP:3.4.1') {
2019-04-03 16:27:40 +03:00
exclude group: 'javassist'
exclude group: 'io.micrometer'
exclude group: 'org.slf4j'
}
launch4j('net.sf.launch4j:launch4j:3.12') {
exclude group: 'org.apache.ant'
exclude group: 'net.java.abeille'
exclude group: 'foxtrot'
exclude group: 'com.jgoodies'
}
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-win32') {
exclude group: '*'
}
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-linux') {
exclude group: '*'
}
compileOnlyA 'com.google.guava:guava:26.0-jre'
2019-05-15 14:11:22 +03:00
compileOnlyA 'log4j:log4j:1.2.17' // Do not update (laggy dep).
compileOnlyA 'org.apache.logging.log4j:log4j-core:2.11.2'
testCompile 'org.junit.jupiter:junit-jupiter:5.4.1'
2018-09-17 10:07:32 +03:00
}
task hikari(type: Copy) {
2019-04-03 16:27:40 +03:00
into "$buildDir/libs/libraries/hikaricp"
from configurations.hikari
2018-09-17 10:07:32 +03:00
}
task launch4jM(type: Copy) {
2019-04-03 16:27:40 +03:00
into "$buildDir/libs/libraries/launch4j"
from(configurations.launch4jCJ.collect { it.isDirectory() ? it : zipTree(it) })
includeEmptyDirs false
eachFile { FileCopyDetails fcp ->
if (fcp.relativePath.pathString.startsWith("launch4j-")) {
def segments = fcp.relativePath.segments
def pathSegments = segments[1..-1] as String[]
fcp.relativePath = new RelativePath(!fcp.file.isDirectory(), pathSegments)
fcp.mode = 0755
} else {
fcp.exclude()
}
}
}
task launch4jA(type: Copy) {
2019-04-03 16:27:40 +03:00
into "$buildDir/libs/libraries/launch4j"
from(configurations.launch4j)
includeEmptyDirs false
eachFile { FileCopyDetails fcp ->
if (fcp.name.startsWith("launch4j")) {
fcp.name = "launch4j.jar"
}
fcp.mode = 0755
}
}
2018-09-17 10:07:32 +03:00
task dumpLibs(type: Copy) {
2019-04-03 16:27:40 +03:00
dependsOn tasks.hikari, tasks.launch4jM, tasks.launch4jA
into "$buildDir/libs/libraries"
from configurations.bundleOnly
2018-09-17 10:07:32 +03:00
}
2019-03-15 17:32:01 +03:00
task dumpCompileOnlyLibs(type: Copy) {
2019-04-03 16:27:40 +03:00
into "$buildDir/libs/launcher-libraries-compile"
from configurations.compileOnlyA
2019-03-15 17:32:01 +03:00
}
task bundle(type: Zip) {
2019-04-03 16:27:40 +03:00
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.jar
archiveName 'LaunchServer.zip'
destinationDir file("$buildDir")
from(tasks.dumpLibs.destinationDir) { into 'libraries' }
from(tasks.dumpCompileOnlyLibs.destinationDir) { into 'launcher-libraries-compile' }
from tasks.jar.archivePath
from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' }
2019-01-09 11:29:54 +03:00
}
2019-03-15 20:07:50 +03:00
task dumpClientLibs(type: Copy) {
2019-04-03 16:27:40 +03:00
dependsOn parent.childProjects.Launcher.tasks.build
into "$buildDir/libs/launcher-libraries"
from parent.childProjects.Launcher.tasks.dumpLibs.destinationDir
2019-03-15 20:07:50 +03:00
}
assemble.dependsOn tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.dumpClientLibs, tasks.bundle, tasks.cleanjar
publishing {
publications {
launchserverapi(MavenPublication) {
artifactId = 'launchserver-api'
artifact(cleanjar) {
classifier ""
}
artifact sourcesJar
artifact javadocJar
pom {
name = 'GravitLauncher LaunchServer API'
description = 'GravitLauncher LaunchServer Module API'
url = 'https://launcher.gravit.pro'
licenses {
license {
name = 'GNU General Public License, Version 3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
}
}
developers {
developer {
id = 'gravit'
name = 'Gravit'
email = 'gravit.min@ya.ru'
}
developer {
id = 'zaxar163'
name = 'Zaxar163'
email = 'zahar.vcherachny@yandex.ru'
}
}
scm {
connection = 'scm:git:https://github.com/GravitLauncher/Launcher.git'
developerConnection = 'scm:git:ssh://git@github.com:GravitLauncher/Launcher.git'
url = 'https://launcher.gravit.pro/'
}
}
}
}
}
signing {
sign publishing.publications.launchserverapi
}