2018-09-19 15:03:52 +03:00
|
|
|
def mainClassName = "ru.gravit.launchserver.LaunchServer"
|
|
|
|
def mainAgentName = "ru.gravit.launchserver.StarterAgent"
|
2018-09-17 10:07:32 +03:00
|
|
|
|
|
|
|
repositories {
|
2018-09-21 18:39:02 +03:00
|
|
|
maven {
|
|
|
|
url "http://maven.geomajas.org/"
|
|
|
|
}
|
|
|
|
maven {
|
|
|
|
url "https://oss.sonatype.org/content/repositories/snapshots"
|
|
|
|
}
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
sourceCompatibility = '1.8'
|
|
|
|
targetCompatibility = '1.8'
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
bundleOnly
|
|
|
|
bundle
|
|
|
|
hikari
|
2018-12-17 19:01:41 +03:00
|
|
|
pack
|
2019-03-08 16:21:41 +03:00
|
|
|
launch4j
|
|
|
|
launch4jCJ
|
2018-12-17 19:01:41 +03:00
|
|
|
bundleOnly.extendsFrom bundle
|
2019-03-08 16:21:41 +03:00
|
|
|
compile.extendsFrom bundle, hikari, pack, launch4jCJ, launch4j
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2019-01-09 11:29:54 +03:00
|
|
|
dependsOn parent.childProjects.Launcher.tasks.build
|
2018-12-17 19:01:41 +03:00
|
|
|
from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } }
|
2018-09-21 18:39:02 +03:00
|
|
|
from(parent.childProjects.Launcher.tasks.jar.archivePath, parent.childProjects.Launcher.tasks.genRuntimeJS.archivePath)
|
|
|
|
manifest.attributes("Main-Class": mainClassName,
|
2018-09-17 10:07:32 +03:00
|
|
|
"Premain-Class": mainAgentName,
|
|
|
|
"Can-Redefine-Classes": "true",
|
|
|
|
"Can-Retransform-Classes": "true",
|
|
|
|
"Can-Set-Native-Method-Prefix": "true"
|
2018-09-21 18:39:02 +03:00
|
|
|
)
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2019-01-09 18:55:50 +03:00
|
|
|
pack project(':libLauncher')
|
2018-11-26 10:53:02 +03:00
|
|
|
bundle 'org.ow2.asm:asm-commons:7.0'
|
|
|
|
bundle 'org.ow2.asm:asm-util:7.0'
|
2018-12-31 11:29:07 +03:00
|
|
|
bundle 'mysql:mysql-connector-java:8.0.13'
|
2018-09-17 10:07:32 +03:00
|
|
|
bundle 'jline:jline:2.14.6'
|
|
|
|
bundle 'net.sf.proguard:proguard-base:6.0.3'
|
|
|
|
bundle 'org.fusesource.jansi:jansi:1.17.1'
|
|
|
|
bundle 'commons-io:commons-io:2.6'
|
2018-12-31 11:29:07 +03:00
|
|
|
bundle 'commons-codec:commons-codec:1.11'
|
2019-01-21 12:11:56 +03:00
|
|
|
bundle 'org.javassist:javassist:3.24.1-GA'
|
2018-12-31 11:29:07 +03:00
|
|
|
bundle 'io.netty:netty-all:4.1.32.Final'
|
2019-01-21 12:11:56 +03:00
|
|
|
|
2018-09-17 10:07:32 +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'
|
2018-12-31 11:29:07 +03:00
|
|
|
hikari('com.zaxxer:HikariCP:3.2.0') {
|
2018-09-17 10:07:32 +03:00
|
|
|
exclude group: 'javassist'
|
|
|
|
exclude group: 'io.micrometer'
|
|
|
|
exclude group: 'org.slf4j'
|
|
|
|
}
|
2019-03-08 16:21:41 +03:00
|
|
|
|
|
|
|
launch4j('net.sf.launch4j:launch4j:3.12') {
|
|
|
|
exclude group: '*'
|
|
|
|
}
|
|
|
|
|
|
|
|
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-win32') {
|
2018-09-17 10:07:32 +03:00
|
|
|
exclude group: '*'
|
|
|
|
}
|
2019-03-08 16:21:41 +03:00
|
|
|
|
|
|
|
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-linux') {
|
|
|
|
exclude group: '*'
|
|
|
|
}
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task hikari(type: Copy) {
|
|
|
|
into "$buildDir/libs/libraries/hikaricp"
|
|
|
|
from configurations.hikari
|
|
|
|
}
|
|
|
|
|
2019-03-08 16:21:41 +03:00
|
|
|
task launch4jM(type: Copy) {
|
|
|
|
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) {
|
|
|
|
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
|
|
|
|
} else {
|
|
|
|
fcp.exclude()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-17 10:07:32 +03:00
|
|
|
task dumpLibs(type: Copy) {
|
2019-03-08 16:21:41 +03:00
|
|
|
dependsOn tasks.hikari, tasks.launch4jM, tasks.launch4jA
|
2018-09-17 10:07:32 +03:00
|
|
|
into "$buildDir/libs/libraries"
|
2018-12-17 19:01:41 +03:00
|
|
|
from configurations.bundleOnly
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
2019-03-08 16:21:41 +03:00
|
|
|
task bundle(type: Zip) {
|
|
|
|
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.jar
|
|
|
|
archiveName 'LaunchServer.zip'
|
|
|
|
destinationDir file("$buildDir")
|
|
|
|
from(tasks.dumpLibs.destinationDir) { into 'libraries' }
|
|
|
|
from tasks.jar.archivePath
|
|
|
|
from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' }
|
2019-01-09 11:29:54 +03:00
|
|
|
}
|
|
|
|
|
2019-03-08 16:21:41 +03:00
|
|
|
build.dependsOn tasks.dumpLibs, tasks.bundle
|