105 lines
3.1 KiB
Groovy
105 lines
3.1 KiB
Groovy
plugins {
|
|
id 'java'
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'com.github.johnrengelman.shadow' version '7.1.0' apply(false)
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion = "7.3.1"
|
|
distributionType = Wrapper.DistributionType.ALL
|
|
}
|
|
|
|
|
|
subprojects {
|
|
apply plugin: 'java'
|
|
apply plugin: 'java-library'
|
|
apply plugin: 'maven-publish'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
|
|
group = 'com.github.retrooper'
|
|
description = project.name
|
|
version = '2.2.0'//TODO UPDATE - ADD "-SNAPSHOT" if we are dealing with snapshot versions
|
|
project.ext.nettyVersion = '4.1.72.Final'
|
|
project.ext.adventureVersion = '4.14.0'
|
|
project.ext.adventureDependencies=["net.kyori:adventure-api:${adventureVersion}",
|
|
"net.kyori:adventure-text-serializer-gson:${adventureVersion}",
|
|
"net.kyori:adventure-text-serializer-legacy:${adventureVersion}",
|
|
"net.kyori:adventure-nbt:${adventureVersion}"]
|
|
|
|
java.sourceCompatibility = JavaVersion.VERSION_1_8
|
|
java.targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url = 'https://oss.sonatype.org/content/groups/public/' }
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly 'org.jetbrains:annotations:23.0.0'
|
|
}
|
|
|
|
tasks {
|
|
shadowJar {
|
|
archiveFileName.set("packetevents-${project.name}-${project.version}.jar")
|
|
}
|
|
|
|
build {
|
|
dependsOn(shadowJar)
|
|
}
|
|
|
|
task sourceJar(type: Jar) {
|
|
from sourceSets.main.allJava
|
|
}
|
|
|
|
withType(JavaCompile) {
|
|
options.encoding = 'UTF-8'
|
|
}
|
|
|
|
jar.configure {
|
|
archiveClassifier = 'default'
|
|
}
|
|
|
|
shadowJar.configure {
|
|
archiveClassifier = null
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
groupId = "com.github.retrooper.packetevents"
|
|
artifactId = project.name
|
|
version = project.version
|
|
|
|
from components.java
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
def snapshotUrl = "https://repo.codemc.io/repository/maven-snapshots/"
|
|
def releaseUrl = "https://repo.codemc.io/repository/maven-releases/"
|
|
|
|
// Check which URL should be used
|
|
url = project.version.endsWith("SNAPSHOT") ? snapshotUrl : releaseUrl
|
|
|
|
def mavenUsername = System.getenv("retrooper_username") ? System.getenv("retrooper_username") : null
|
|
def mavenPassword = System.getenv("retrooper_password") ? System.getenv("retrooper_password") : null
|
|
|
|
if(mavenUsername != null && mavenPassword != null) {
|
|
credentials {
|
|
username = mavenUsername
|
|
password = mavenPassword
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//So that SNAPSHOT is always the latest SNAPSHOT
|
|
configurations.all {
|
|
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
|
|
}
|
|
}
|