mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
213 lines
7.8 KiB
Groovy
213 lines
7.8 KiB
Groovy
def mainClassName = "pro.gravit.launchserver.Main"
|
|
def mainAgentName = "pro.gravit.launchserver.StarterAgent"
|
|
|
|
evaluationDependsOn(':Launcher')
|
|
|
|
repositories {
|
|
maven {
|
|
url "https://oss.sonatype.org/content/repositories/snapshots"
|
|
}
|
|
maven {
|
|
url "https://jcenter.bintray.com/"
|
|
}
|
|
maven {
|
|
url "https://jitpack.io/"
|
|
}
|
|
}
|
|
|
|
sourceCompatibility = '21'
|
|
targetCompatibility = '21'
|
|
|
|
configurations {
|
|
compileOnlyA
|
|
bundleOnly
|
|
bundle
|
|
hikari
|
|
pack
|
|
launch4j
|
|
bundleOnly.extendsFrom bundle
|
|
api.extendsFrom bundle, hikari, pack, launch4j
|
|
}
|
|
|
|
jar {
|
|
dependsOn parent.childProjects.Launcher.tasks.assemble
|
|
from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
from(parent.childProjects.Launcher.tasks.shadowJar)
|
|
from(parent.childProjects.Launcher.tasks.genRuntimeJS)
|
|
manifest.attributes("Main-Class": mainClassName,
|
|
"Premain-Class": mainAgentName,
|
|
"Multi-Release": "true",
|
|
"Can-Redefine-Classes": "true",
|
|
"Can-Retransform-Classes": "true",
|
|
"Can-Set-Native-Method-Prefix": "true"
|
|
)
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events "passed", "skipped", "failed"
|
|
}
|
|
}
|
|
|
|
tasks.register('sourcesJar', Jar) {
|
|
from sourceSets.main.allJava
|
|
archiveClassifier.set('sources')
|
|
}
|
|
|
|
tasks.register('javadocJar', Jar) {
|
|
from javadoc
|
|
archiveClassifier.set('javadoc')
|
|
}
|
|
|
|
tasks.register('cleanjar', Jar) {
|
|
dependsOn jar
|
|
archiveClassifier.set('clean')
|
|
manifest.attributes("Main-Class": mainClassName,
|
|
"Premain-Class": mainAgentName,
|
|
"Automatic-Module-Name": "launchserver"
|
|
)
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
|
|
dependencies {
|
|
pack project(':LauncherAPI')
|
|
bundle group: 'me.tongfei', name: 'progressbar', version: '0.9.2'
|
|
bundle group: 'com.github.Marcono1234', name: 'gson-record-type-adapter-factory', version: 'v0.2.0'
|
|
bundle group: 'org.fusesource.jansi', name: 'jansi', version: rootProject['verJansi']
|
|
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-codec-http', version: rootProject['verNetty']
|
|
bundle group: 'io.netty', name: 'netty-transport-classes-epoll', version: rootProject['verNetty']
|
|
bundle group: 'io.netty', name: 'netty-transport-native-epoll', version: rootProject['verNetty'], classifier: 'linux-x86_64'
|
|
bundle group: 'org.slf4j', name: 'slf4j-api', version: rootProject['verSlf4j']
|
|
bundle group: 'com.mysql', name: 'mysql-connector-j', version: rootProject['verMySQLConn']
|
|
bundle group: 'org.postgresql', name: 'postgresql', version: rootProject['verPostgreSQLConn']
|
|
bundle group: 'com.guardsquare', name: 'proguard-base', version: rootProject['verProguard']
|
|
bundle group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j']
|
|
bundle group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-impl', version: rootProject['verLog4j']
|
|
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']
|
|
annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'])
|
|
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
|
|
|
|
hikari 'io.micrometer:micrometer-core:1.8.4'
|
|
hikari('com.zaxxer:HikariCP:5.0.1') {
|
|
exclude group: 'javassist'
|
|
exclude group: 'io.micrometer'
|
|
exclude group: 'org.slf4j'
|
|
}
|
|
|
|
compileOnlyA group: 'com.google.guava', name: 'guava', version: rootProject['verGuavaC']
|
|
// Do not update (laggy deps).
|
|
compileOnlyA 'log4j:log4j:1.2.17'
|
|
compileOnlyA 'org.apache.logging.log4j:log4j-core:2.14.1'
|
|
}
|
|
|
|
tasks.register('hikari', Copy) {
|
|
duplicatesStrategy = 'EXCLUDE'
|
|
into "$buildDir/libs/libraries/hikaricp"
|
|
from configurations.hikari
|
|
}
|
|
|
|
tasks.register('launch4j', Copy) {
|
|
duplicatesStrategy = 'EXCLUDE'
|
|
into "$buildDir/libs/libraries/launch4j"
|
|
from(configurations.launch4j.collect {
|
|
it.isDirectory() ? it : ((it.getName().startsWith("launch4j") && it.getName().contains("workdir")) ? zipTree(it) : it)
|
|
})
|
|
includeEmptyDirs false
|
|
eachFile { FileCopyDetails fcp ->
|
|
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
|
|
}
|
|
}
|
|
|
|
tasks.register('dumpLibs', Copy) {
|
|
duplicatesStrategy = 'EXCLUDE'
|
|
dependsOn tasks.hikari, tasks.launch4j
|
|
into "$buildDir/libs/libraries"
|
|
from configurations.bundleOnly
|
|
}
|
|
|
|
tasks.register('dumpCompileOnlyLibs', Copy) {
|
|
duplicatesStrategy = 'EXCLUDE'
|
|
into "$buildDir/libs/launcher-libraries-compile"
|
|
from configurations.compileOnlyA
|
|
}
|
|
|
|
tasks.register('bundle', Zip) {
|
|
duplicatesStrategy = 'EXCLUDE'
|
|
dependsOn parent.childProjects.Launcher.tasks.build, tasks.dumpLibs, tasks.dumpCompileOnlyLibs, tasks.jar
|
|
archiveFileName = 'LaunchServer.zip'
|
|
destinationDirectory = file("$buildDir")
|
|
from(tasks.dumpLibs.destinationDir) { into 'libraries' }
|
|
from(tasks.dumpCompileOnlyLibs.destinationDir) { into 'launcher-libraries-compile' }
|
|
from(tasks.jar)
|
|
from(parent.childProjects.Launcher.tasks.dumpLibs) { into 'launcher-libraries' }
|
|
}
|
|
|
|
tasks.register('dumpClientLibs', Copy) {
|
|
dependsOn parent.childProjects.Launcher.tasks.build
|
|
into "$buildDir/libs/launcher-libraries"
|
|
from parent.childProjects.Launcher.tasks.dumpLibs
|
|
}
|
|
|
|
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://gravitlauncher.com'
|
|
licenses {
|
|
license {
|
|
name = 'GNU General Public License, Version 3.0'
|
|
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
id = 'gravita'
|
|
name = 'Gravita'
|
|
email = 'gravita@gravit.pro'
|
|
}
|
|
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://gravitlauncher.com/'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
signing {
|
|
sign publishing.publications.launchserverapi
|
|
}
|