mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FEATURE] Получение launch4j. (#187)
* [FEATURE] Получение launch4j. * [FEATURE] Генерация готового bundle, со всей структурой каталогов нужной для работы лауннчсервера. * [FIX] Название архива с LaunchServer.
This commit is contained in:
parent
57231d948d
commit
1819e1c95c
1 changed files with 52 additions and 9 deletions
|
@ -18,8 +18,10 @@
|
||||||
bundle
|
bundle
|
||||||
hikari
|
hikari
|
||||||
pack
|
pack
|
||||||
|
launch4j
|
||||||
|
launch4jCJ
|
||||||
bundleOnly.extendsFrom bundle
|
bundleOnly.extendsFrom bundle
|
||||||
compile.extendsFrom bundle, hikari, pack
|
compile.extendsFrom bundle, hikari, pack, launch4jCJ, launch4j
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
@ -57,10 +59,18 @@ pack project(':libLauncher')
|
||||||
exclude group: 'io.micrometer'
|
exclude group: 'io.micrometer'
|
||||||
exclude group: 'org.slf4j'
|
exclude group: 'org.slf4j'
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOnly('net.sf.launch4j:launch4j:3.12') { // need user
|
launch4j('net.sf.launch4j:launch4j:3.12') {
|
||||||
exclude group: '*'
|
exclude group: '*'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-win32') {
|
||||||
|
exclude group: '*'
|
||||||
|
}
|
||||||
|
|
||||||
|
launch4jCJ('net.sf.launch4j:launch4j:3.12:workdir-linux') {
|
||||||
|
exclude group: '*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task hikari(type: Copy) {
|
task hikari(type: Copy) {
|
||||||
|
@ -68,16 +78,49 @@ task hikari(type: Copy) {
|
||||||
from configurations.hikari
|
from configurations.hikari
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task dumpLibs(type: Copy) {
|
task dumpLibs(type: Copy) {
|
||||||
dependsOn tasks.hikari
|
dependsOn tasks.hikari, tasks.launch4jM, tasks.launch4jA
|
||||||
into "$buildDir/libs/libraries"
|
into "$buildDir/libs/libraries"
|
||||||
from configurations.bundleOnly
|
from configurations.bundleOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
task dumpClientLibs(type: Copy) {
|
task bundle(type: Zip) {
|
||||||
dependsOn parent.childProjects.Launcher.tasks.build
|
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.jar
|
||||||
into "$buildDir/libs/launcher-libraries"
|
archiveName 'LaunchServer.zip'
|
||||||
from parent.childProjects.Launcher.tasks.dumpLibs.destinationDir
|
destinationDir file("$buildDir")
|
||||||
|
from(tasks.dumpLibs.destinationDir) { into 'libraries' }
|
||||||
|
from tasks.jar.archivePath
|
||||||
|
from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' }
|
||||||
}
|
}
|
||||||
|
|
||||||
build.dependsOn tasks.dumpLibs, tasks.dumpClientLibs
|
build.dependsOn tasks.dumpLibs, tasks.bundle
|
||||||
|
|
Loading…
Reference in a new issue