Launcher/LaunchServer/build.gradle

190 lines
6.8 KiB
Groovy
Raw Normal View History

2023-12-20 00:45:41 +03:00
def mainClassName = "pro.gravit.launchserver.Main"
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 {
2021-03-20 12:49:49 +03:00
url "https://jcenter.bintray.com/"
2019-04-03 16:27:40 +03:00
}
2021-11-09 10:12:31 +03:00
maven {
url "https://jitpack.io/"
}
2018-09-17 10:07:32 +03:00
}
2023-09-20 15:11:33 +03:00
sourceCompatibility = '21'
targetCompatibility = '21'
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 {
dependsOn parent.childProjects.Launcher.tasks.assemble
2019-04-03 16:27:40 +03:00
from { configurations.pack.collect { it.isDirectory() ? it : zipTree(it) } }
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
)
2018-09-17 10:07:32 +03:00
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
2023-04-03 09:04:12 +03:00
tasks.register('sourcesJar', Jar) {
from sourceSets.main.allJava
2021-09-14 14:05:36 +03:00
archiveClassifier.set('sources')
}
2023-04-03 09:04:12 +03:00
tasks.register('javadocJar', Jar) {
from javadoc
2021-09-14 14:05:36 +03:00
archiveClassifier.set('javadoc')
}
2023-04-03 09:04:12 +03:00
tasks.register('cleanjar', Jar) {
dependsOn jar
2021-09-14 14:05:36 +03:00
archiveClassifier.set('clean')
manifest.attributes("Main-Class": mainClassName,
2023-12-20 00:45:41 +03:00
"Automatic-Module-Name": "launchserver"
)
from sourceSets.main.output
}
2018-09-17 10:07:32 +03:00
dependencies {
pack project(':LauncherAPI')
2024-05-30 18:28:23 +03:00
bundle group: 'me.tongfei', name: 'progressbar', version: '0.10.1'
2020-04-05 10:27:04 +03:00
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']
2024-05-30 18:28:23 +03:00
bundle group: 'org.bouncycastle', name: 'bcprov-jdk18on', version: rootProject['verBcpkix']
2024-05-31 19:30:19 +03:00
bundle group: 'org.bouncycastle', name: 'bcpkix-jdk18on', version: rootProject['verBcpkix']
bundle group: 'org.ow2.asm', name: 'asm-commons', version: rootProject['verAsm']
2023-12-20 00:45:41 +03:00
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']
2024-04-24 22:09:17 +03:00
bundle group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: rootProject['verMariaDBConn']
bundle group: 'org.postgresql', name: 'postgresql', version: rootProject['verPostgreSQLConn']
bundle group: 'com.h2database', name: 'h2', version: rootProject['verH2Conn']
2021-03-20 12:49:49 +03:00
bundle group: 'com.guardsquare', name: 'proguard-base', version: rootProject['verProguard']
2021-09-04 09:03:33 +03:00
bundle group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j']
2023-12-20 00:45:41 +03:00
bundle group: 'org.apache.logging.log4j', name: 'log4j-slf4j2-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']
2024-07-05 11:55:54 +03:00
bundle group: 'com.google.code.gson', name: 'gson', version: rootProject['verGson']
annotationProcessor(group: 'org.apache.logging.log4j', name: 'log4j-core', version: rootProject['verLog4j'])
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: rootProject['verJunit']
2024-07-05 10:15:22 +03:00
hikari 'io.micrometer:micrometer-core:1.13.1'
hikari('com.zaxxer:HikariCP:5.1.0') {
2019-04-03 16:27:40 +03:00
exclude group: 'javassist'
exclude group: 'io.micrometer'
exclude group: 'org.slf4j'
}
2018-09-17 10:07:32 +03:00
}
2023-04-03 09:04:12 +03:00
tasks.register('hikari', 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
}
2023-04-03 09:04:12 +03:00
tasks.register('dumpLibs', Copy) {
2020-03-01 12:44:14 +03:00
duplicatesStrategy = 'EXCLUDE'
dependsOn tasks.hikari
2019-04-03 16:27:40 +03:00
into "$buildDir/libs/libraries"
from configurations.bundleOnly
2018-09-17 10:07:32 +03:00
}
2023-04-03 09:04:12 +03:00
tasks.register('dumpCompileOnlyLibs', 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
}
2023-04-03 09:04:12 +03:00
tasks.register('bundle', 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' }
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
}
2023-04-03 09:04:12 +03:00
tasks.register('dumpClientLibs', 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
}
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'
2023-01-11 14:16:38 +03:00
url = 'https://gravitlauncher.com'
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'
}
}
scm {
connection = 'scm:git:https://github.com/GravitLauncher/Launcher.git'
developerConnection = 'scm:git:ssh://git@github.com:GravitLauncher/Launcher.git'
2023-01-11 14:16:38 +03:00
url = 'https://gravitlauncher.com/'
}
}
}
}
}
signing {
sign publishing.publications.launchserverapi
}