forked from TheMeinerLP/LuckPerms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
132 lines (117 loc) · 4.71 KB
/
build.gradle
File metadata and controls
132 lines (117 loc) · 4.71 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
plugins {
alias(libs.plugins.licenser) apply false
id 'org.cyclonedx.bom' version '3.0.1'
alias(libs.plugins.loom) apply false
}
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'dev.yumi.gradle.licenser'
group = 'me.lucko.luckperms'
version = '5.6-SNAPSHOT'
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.release = 11
}
tasks.withType(Test).configureEach {
testLogging {
events = [TestLogEvent.PASSED, TestLogEvent.FAILED, TestLogEvent.SKIPPED]
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
}
jar {
from '../LICENSE.txt'
}
def determinePatchVersion = {
def tagInfo = providers.exec {
commandLine 'git', 'describe', '--tags'
}.standardOutput.asText.get().trim()
return tagInfo.contains('-') ? tagInfo.split('-')[1] : 0
}
project.ext.majorVersion = '5'
project.ext.minorVersion = '6'
project.ext.patchVersion = determinePatchVersion()
project.ext.apiVersion = project.ext.majorVersion + '.' + project.ext.minorVersion
project.ext.fullVersion = project.ext.apiVersion + '.' + project.ext.patchVersion
license {
rule(rootProject.file("HEADER.txt"))
exclude '*.xml'
}
repositories {
// Fix issue with lwjgl-freetype not being found on macOS / ForgeGradle issue
//
// Could not resolve all files for configuration ':_compileJava_1'.
// Could not find lwjgl-freetype-3.3.3-natives-macos-patch.jar (org.lwjgl:lwjgl-freetype:3.3.3).
maven {
url "https://libraries.minecraft.net"
content {
includeModule("org.lwjgl", "lwjgl-freetype")
}
}
mavenCentral()
maven { url 'https://repo.lucko.me/' }
maven { url 'https://libraries.minecraft.net/' }
}
}
// Publish every remaining LuckPerms platform/loader module to the
// OneLiteFeather repository as net.luckperms:<dashed-path>. The six modules
// that already define their own publication (api, common, loader-utils,
// minestom, minestom-app, minestom-loader) are intentionally excluded.
def olfExtraPublishPaths = [
':bukkit', ':bukkit:loader', ':bukkit-legacy', ':bukkit-legacy:loader',
':bungee', ':bungee:loader', ':velocity',
':fabric', ':forge', ':forge:loader', ':neoforge', ':neoforge:loader',
':sponge', ':sponge:loader', ':sponge:sponge-service', ':sponge:sponge-service-proxy',
':nukkit', ':nukkit:loader',
':standalone', ':standalone:app', ':standalone:loader',
':hytale', ':hytale:loader', ':hytale:loader-with-deps',
':common:minecraft'
] as Set
subprojects {
afterEvaluate { proj ->
if (!olfExtraPublishPaths.contains(proj.path)) {
return
}
def shadowTask = proj.tasks.findByName('shadowJar')
def hasJavaComponent = proj.components.findByName('java') != null
if (shadowTask == null && !hasJavaComponent) {
return
}
proj.publishing {
publications {
if (findByName('mavenJava') == null && findByName('maven') == null && findByName('olf') == null) {
olf(MavenPublication) {
groupId = 'net.luckperms'
artifactId = proj.path.substring(1).replace(':', '-')
version = proj.version
if (shadowTask != null) {
artifact(shadowTask)
} else {
from proj.components.java
}
}
}
}
repositories {
maven {
name = 'OneLiteFeatherRepository'
def snapshotsRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-snapshots')
def releasesRepoUrl = uri('https://repo.onelitefeather.dev/onelitefeather-releases')
url = proj.version.toString().contains('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials(PasswordCredentials) {
username = System.getenv('ONELITEFEATHER_MAVEN_USERNAME')
password = System.getenv('ONELITEFEATHER_MAVEN_PASSWORD')
}
authentication {
basic(BasicAuthentication)
}
}
}
}
}
}