forked from MinecraftForge/SrgUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (126 loc) · 3.97 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
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
133
134
135
136
137
138
139
140
141
142
buildscript {
repositories {
mavenLocal()
maven { url = 'https://maven.minecraftplus.org/' }
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
}
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.minecraftforge.gradleutils' version '1.+'
id 'com.github.ben-manes.versions' version '0.39.0'
}
group 'org.minecraftplus'
version = gradleutils.getTagOffsetVersion()
println('Version: ' + version)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
ext {
CHANGELOG = rootProject.file('build/changelog.txt')
}
repositories {
mavenLocal()
maven { url = 'https://maven.minecraftplus.org/' }
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
}
test {
useJUnitPlatform()
}
license {
header = file('LICENSE-header.txt')
ext {
project = 'SRG Utils'
}
}
dependencies {
testImplementation('org.junit.jupiter:junit-jupiter:5.8.2')
testImplementation('org.junit.jupiter:junit-jupiter-engine:5.8.2')
testImplementation('org.powermock:powermock-core:2.0.9')
testImplementation 'com.google.jimfs:jimfs:1.1'
compileOnly('com.google.code.findbugs:jsr305:3.0.2')
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
if (CHANGELOG.exists()) {
artifact(CHANGELOG) {
classifier = 'changelog'
}
}
artifact jar
artifact sourcesJar
pom {
name = 'SRG Utils'
description = 'Library for managing java obfuscation mappings in various formats.'
url = 'https://github.com/MinecraftPlus/SrgUtils'
scm {
url = 'https://github.com/MinecraftPlus/SrgUtils'
connection = 'scm:git:git://github.com/MinecraftPlus/SrgUtils.git'
developerConnection = 'scm:git:git@github.com:MinecraftPlus/SrgUtils.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MinecraftPlus/SrgUtils/issues'
}
licenses {
license {
name = 'LGPLv2.1'
url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt'
}
}
developers {
developer {
id = 'LexManos'
name = 'LexManos'
}
developer {
id = 'theWituch'
name = 'theWituch'
}
}
}
}
}
repositories {
maven {
name = "minecraftplus"
url = "https://maven.minecraftplus.org"
allowInsecureProtocol = false
if (project.version.toString().endsWith("-SNAPSHOT")) {
url = url.toString().concat("/snapshots")
} else {
url = url.toString().concat("/releases")
}
// To know how credentiials see https://docs.gradle.org/current/samples/sample_publishing_credentials.html
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}
dependencyUpdates.resolutionStrategy {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}