forked from retrooper/packetevents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
107 lines (87 loc) · 3.18 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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.0.0-SNAPSHOT'
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 {
//TODO UPDATE isRelease boolean to publish to correct repository, for now we publish all to snapshots url
boolean isRelease = false
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 = isRelease ? releaseUrl : snapshotUrl
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'
}
}