HarbingerCDN/server/build.gradle
2024-02-13 21:58:34 -07:00

140 lines
No EOL
3.3 KiB
Groovy

/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/8.0.2/userguide/building_java_projects.html
*/
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'application'
id 'idea'
id 'eclipse'
id 'maven-publish'
}
group = "dev.zontreck.playsync"
archivesBaseName = "PlaySyncServer"
configurations {
provided
compile.extendsFrom(provided)
runtime.extendsFrom(provided)
implementation.extendsFrom(provided)
}
application {
mainClass = "dev.zontreck.playsync.PlaySyncServer"
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
withSourcesJar()
withJavadocJar()
}
def determinePatchVersion = {
// get the name of the last tag
def tagInfo = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = tagInfo
}
tagInfo = tagInfo.toString()
if (!tagInfo.contains('-')) {
return 0
}
return tagInfo.split("-")[1]
}
version = determinePatchVersion()
version = "${apiVer}.${version}"
repositories {
// Use Maven Central for resolving dependencies.
// mavenCentral()
maven {
url = "https://maven.zontreck.com/repository/internal"
name = "Aria's Creations Caches"
}
maven {
url = "https://maven.zontreck.com/repository/zontreck"
name = "Aria's Creations"
}
}
dependencies {
provided "dev.zontreck:EventsBus:${Bus_API}.${Bus_Patch}"
provided "dev.zontreck:LibAC:${LibAC_API}.${LibAC_Patch}"
provided "org.mariadb.jdbc:mariadb-java-client:${MariaDB_JDBC_Version}"
provided "org.slf4j:log4j-over-slf4j:2.0.7"
provided "org.slf4j:slf4j-simple:2.0.7"
}
def MAVEN_PASSWORD_PROPERTY = "AriasCreationsMavenPassword"
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
artifact javadocJar
}
}
repositories {
maven {
url = "https://maven.zontreck.com/repository/zontreck"
name = "ariascreations"
if (project.findProperty(MAVEN_PASSWORD_PROPERTY) != null) {
credentials {
username = "admin"
password = project.findProperty(MAVEN_PASSWORD_PROPERTY)
}
}
}
}
}
test {
useJUnitPlatform()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
jar {
manifest {
attributes (
'Main-Class': application.mainClass,
'Multi-Release': 'true'
)
}
}
task jarjar(type: Jar) {
manifest {
attributes (
'Main-Class': application.mainClass,
'Multi-Release': 'true',
'Implementation-Version': version
)
}
archiveClassifier = "AIO"
duplicatesStrategy = "exclude"
from { configurations.provided.collect { it.isDirectory() ? it : zipTree(it) } }
exclude 'META-INF/*'
exclude 'META-INF/*'
exclude 'META-INF/*'
with jar
}
jarjar.dependsOn(jar, sourcesJar, javadocJar)