2019-08-25 12:39:08 +03:00
|
|
|
def mainClassName = "pro.gravit.launchserver.LaunchServerStarter"
|
2019-06-02 05:03:08 +03:00
|
|
|
def mainAgentName = "pro.gravit.launchserver.StarterAgent"
|
2018-09-17 10:07:32 +03:00
|
|
|
|
2019-03-28 11:54:18 +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 {
|
2021-03-20 12:49:49 +03:00
|
|
|
url "https://jcenter.bintray.com/"
|
2019-04-03 16:27:40 +03:00
|
|
|
}
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
2020-09-25 21:53:44 +03:00
|
|
|
sourceCompatibility = '11'
|
|
|
|
targetCompatibility = '11'
|
2018-09-17 10:07:32 +03:00
|
|
|
|
|
|
|
configurations {
|
2019-04-03 16:27:40 +03:00
|
|
|
compileOnlyA
|
|
|
|
bundleOnly
|
|
|
|
bundle
|
|
|
|
hikari
|
|
|
|
pack
|
|
|
|
launch4j
|
|
|
|
bundleOnly.extendsFrom bundle
|
2020-03-11 18:28:22 +03:00
|
|
|
api.extendsFrom bundle, hikari, pack, launch4j
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
2020-03-01 14:34:31 +03:00
|
|
|
dependsOn parent.childProjects.Launcher.tasks.assemble
|
2019-04-03 16:27:40 +03:00
|
|
|
from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } }
|
2020-03-01 14:34:31 +03:00
|
|
|
from(parent.childProjects.Launcher.tasks.shadowJar)
|
|
|
|
from(parent.childProjects.Launcher.tasks.genRuntimeJS)
|
2019-04-03 16:27:40 +03:00
|
|
|
manifest.attributes("Main-Class": mainClassName,
|
|
|
|
"Premain-Class": mainAgentName,
|
2020-09-26 13:06:51 +03:00
|
|
|
"Multi-Release": "true",
|
2019-04-03 16:27:40 +03:00
|
|
|
"Can-Redefine-Classes": "true",
|
|
|
|
"Can-Retransform-Classes": "true",
|
|
|
|
"Can-Set-Native-Method-Prefix": "true"
|
|
|
|
)
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
2019-08-29 13:36:11 +03:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
|
|
events "passed", "skipped", "failed"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-28 11:55:58 +03:00
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
from sourceSets.main.allJava
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
from javadoc
|
|
|
|
archiveClassifier = 'javadoc'
|
|
|
|
}
|
2019-08-10 18:51:23 +03:00
|
|
|
|
2019-08-10 21:53:12 +03:00
|
|
|
task cleanjar(type: Jar, dependsOn: jar) {
|
2019-08-10 18:51:23 +03:00
|
|
|
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 {
|
2019-05-03 16:37:37 +03:00
|
|
|
pack project(':LauncherAPI')
|
2021-07-11 13:07:54 +03:00
|
|
|
bundle group: 'me.tongfei', name: 'progressbar', version: '0.9.2'
|
2020-04-05 10:27:04 +03:00
|
|
|
bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi']
|
2020-03-01 14:34:31 +03:00
|
|
|
bundle group: 'org.jline', name: 'jline', version: rootProject['verJline']
|
|
|
|
bundle group: 'org.jline', name: 'jline-reader', version: rootProject['verJline']
|
|
|
|
bundle group: 'org.jline', name: 'jline-terminal', version: rootProject['verJline']
|
|
|
|
bundle group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: rootProject['verBcpkix']
|
|
|
|
bundle group: 'org.ow2.asm', name: 'asm-commons', version: rootProject['verAsm']
|
|
|
|
bundle group: 'io.netty', name: 'netty-all', version: rootProject['verNetty']
|
|
|
|
bundle group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j']
|
|
|
|
bundle group: 'org.hibernate', name: 'hibernate-core', version: rootProject['verHibernate']
|
2020-09-08 17:09:15 +03:00
|
|
|
bundle group: 'org.hibernate', name: 'hibernate-hikaricp', version: rootProject['verHibernate']
|
2020-03-01 14:34:31 +03:00
|
|
|
bundle group: 'mysql', name: 'mysql-connector-java', version: rootProject['verMySQLConn']
|
|
|
|
bundle group: 'org.postgresql', name: 'postgresql', version: rootProject['verPostgreSQLConn']
|
2021-03-20 12:49:49 +03:00
|
|
|
bundle group: 'com.guardsquare', name: 'proguard-base', version: rootProject['verProguard']
|
2021-04-13 12:47:42 +03:00
|
|
|
bundle group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j']
|
|
|
|
bundle group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: rootProject['verLog4j']
|
2021-05-23 17:11:27 +03:00
|
|
|
bundle group: 'io.jsonwebtoken', name: 'jjwt-api', version: rootProject['verJwt']
|
|
|
|
bundle group: 'io.jsonwebtoken', name: 'jjwt-impl', version: rootProject['verJwt']
|
|
|
|
bundle group: 'io.jsonwebtoken', name: 'jjwt-gson', version: rootProject['verJwt']
|
2020-03-01 14:34:31 +03:00
|
|
|
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
|
|
|
|
2021-03-20 12:49:49 +03:00
|
|
|
hikari 'io.micrometer:micrometer-core:1.5.10'
|
|
|
|
hikari('com.zaxxer:HikariCP:4.0.3') {
|
2019-04-03 16:27:40 +03:00
|
|
|
exclude group: 'javassist'
|
|
|
|
exclude group: 'io.micrometer'
|
|
|
|
exclude group: 'org.slf4j'
|
|
|
|
}
|
|
|
|
|
2020-03-12 08:36:09 +03:00
|
|
|
launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j']) {
|
2019-04-03 16:27:40 +03:00
|
|
|
exclude group: 'org.apache.ant'
|
|
|
|
exclude group: 'net.java.abeille'
|
|
|
|
exclude group: 'foxtrot'
|
|
|
|
exclude group: 'com.jgoodies'
|
2020-03-01 14:34:31 +03:00
|
|
|
exclude group: 'org.slf4j'
|
2019-04-03 16:27:40 +03:00
|
|
|
}
|
2020-03-12 08:36:09 +03:00
|
|
|
launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-win32') { transitive = false }
|
2020-03-27 06:55:02 +03:00
|
|
|
launch4j('net.sf.launch4j:launch4j:' + rootProject['verLaunch4j'] + ':workdir-linux64') { transitive = false }
|
2019-04-03 16:27:40 +03:00
|
|
|
|
2020-03-12 08:36:09 +03:00
|
|
|
compileOnlyA group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC']
|
2020-03-01 14:34:31 +03:00
|
|
|
// Do not update (laggy deps).
|
|
|
|
compileOnlyA 'log4j:log4j:1.2.17'
|
2019-05-15 14:11:22 +03:00
|
|
|
compileOnlyA 'org.apache.logging.log4j:log4j-core:2.11.2'
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task hikari(type: Copy) {
|
2020-03-01 12:44:14 +03:00
|
|
|
duplicatesStrategy = 'EXCLUDE'
|
2019-04-03 16:27:40 +03:00
|
|
|
into "$buildDir/libs/libraries/hikaricp"
|
|
|
|
from configurations.hikari
|
2018-09-17 10:07:32 +03:00
|
|
|
}
|
|
|
|
|
2020-03-11 18:28:22 +03:00
|
|
|
task launch4j(type: Copy) {
|
2020-03-01 12:44:14 +03:00
|
|
|
duplicatesStrategy = 'EXCLUDE'
|
2019-04-03 16:27:40 +03:00
|
|
|
into "$buildDir/libs/libraries/launch4j"
|
2020-04-05 10:27:04 +03:00
|
|
|
from(configurations.launch4j.collect {
|
|
|
|
it.isDirectory() ? it : ((it.getName().startsWith("launch4j") && it.getName().contains("workdir")) ? zipTree(it) : it)
|
|
|
|
})
|
2019-04-03 16:27:40 +03:00
|
|
|
includeEmptyDirs false
|
|
|
|
eachFile { FileCopyDetails fcp ->
|
2020-04-05 10:27:04 +03:00
|
|
|
if (fcp.relativePath.pathString.startsWith("launch4j-") &&
|
|
|
|
fcp.relativePath.pathString.contains("workdir")) {
|
|
|
|
def segments = fcp.relativePath.segments
|
|
|
|
def pathSegments = segments[1..-1] as String[]
|
|
|
|
fcp.relativePath = new RelativePath(!fcp.file.isDirectory(), pathSegments)
|
|
|
|
} else if (fcp.relativePath.pathString.contains("META-INF")) fcp.exclude()
|
|
|
|
fcp.mode = 0755
|
2019-04-03 16:27:40 +03:00
|
|
|
}
|
2019-03-08 16:21:41 +03:00
|
|
|
}
|
|
|
|
|
2018-09-17 10:07:32 +03:00
|
|
|
task dumpLibs(type: Copy) {
|
2020-03-01 12:44:14 +03:00
|
|
|
duplicatesStrategy = 'EXCLUDE'
|
2020-03-11 18:28:22 +03:00
|
|
|
dependsOn tasks.hikari, tasks.launch4j
|
2019-04-03 16:27:40 +03:00
|
|
|
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) {
|
2020-03-01 12:44:14 +03:00
|
|
|
duplicatesStrategy = 'EXCLUDE'
|
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
|
|
|
}
|
|
|
|
|
2019-03-08 16:21:41 +03:00
|
|
|
task bundle(type: Zip) {
|
2020-03-01 12:44:14 +03:00
|
|
|
duplicatesStrategy = 'EXCLUDE'
|
2019-04-03 16:27:40 +03:00
|
|
|
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.jar
|
2020-03-01 12:51:12 +03:00
|
|
|
archiveFileName = 'LaunchServer.zip'
|
|
|
|
destinationDirectory = file("$buildDir")
|
2019-04-03 16:27:40 +03:00
|
|
|
from(tasks.dumpLibs.destinationDir) { into 'libraries' }
|
|
|
|
from(tasks.dumpCompileOnlyLibs.destinationDir) { into 'launcher-libraries-compile' }
|
2020-03-12 08:36:09 +03:00
|
|
|
from(tasks.jar)
|
2019-04-03 16:27:40 +03:00
|
|
|
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"
|
2020-03-11 18:40:27 +03:00
|
|
|
from parent.childProjects.Launcher.tasks.dumpLibs
|
2019-03-15 20:07:50 +03:00
|
|
|
}
|
|
|
|
|
2019-09-04 16:38:50 +03:00
|
|
|
assemble.dependsOn tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.dumpClientLibs, tasks.bundle, tasks.cleanjar
|
2019-08-10 21:53:12 +03:00
|
|
|
|
|
|
|
|
2019-08-12 23:20:28 +03:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
launchserverapi(MavenPublication) {
|
2019-08-10 21:53:12 +03:00
|
|
|
artifactId = 'launchserver-api'
|
2019-08-22 10:36:50 +03:00
|
|
|
artifact(cleanjar) {
|
|
|
|
classifier ""
|
|
|
|
}
|
2019-08-28 11:55:58 +03:00
|
|
|
artifact sourcesJar
|
|
|
|
artifact javadocJar
|
2019-08-12 23:20:28 +03:00
|
|
|
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'
|
|
|
|
}
|
|
|
|
}
|
2020-09-28 21:32:19 +03:00
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = 'gravita'
|
|
|
|
name = 'Gravita'
|
|
|
|
email = 'gravita@gravit.pro'
|
|
|
|
}
|
|
|
|
developer {
|
|
|
|
id = 'zaxar163'
|
|
|
|
name = 'Zaxar163'
|
|
|
|
email = 'zahar.vcherachny@yandex.ru'
|
|
|
|
}
|
|
|
|
}
|
2019-08-12 23:20:28 +03:00
|
|
|
|
|
|
|
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/'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-10 21:53:12 +03:00
|
|
|
}
|
2019-08-12 23:20:28 +03:00
|
|
|
|
2019-08-13 14:49:41 +03:00
|
|
|
signing {
|
2019-08-12 23:20:28 +03:00
|
|
|
sign publishing.publications.launchserverapi
|
2019-08-13 14:49:41 +03:00
|
|
|
}
|