-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
110 lines (87 loc) · 1.93 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
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'checkstyle'
id 'com.diffplug.spotless' version '6.12.0'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
def ENV = System.getenv()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
checkstyle {
configFile = project.rootProject.file('checkstyle.xml')
toolVersion = project.checkstyle_tool_version
}
spotless {
java {
licenseHeaderFile(rootProject.file('HEADER'))
}
}
repositories {
mavenCentral()
maven {
name = 'FlexVer'
url = 'https://repo.sleeping.town/'
}
}
configurations {
include
implementation {
extendsFrom include
}
}
dependencies {
include "com.unascribed:flexver-java:${project.flexver_version}"
testCompileOnly "org.jetbrains:annotations:${project.jetbrains_annotations_version}"
testImplementation "org.junit.jupiter:junit-jupiter:${project.junit_jupiter_version}"
}
test {
useJUnitPlatform()
}
java {
withSourcesJar()
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = 8
}
}
shadowJar {
// Has stupid defaults, make our own
enabled = false
}
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task fatJar(type: ShadowJar) {
from sourceSets.main.output
manifest {
attributes('Automatic-Module-Name': "${project.group}.${archivesBaseName}")
}
archiveClassifier = 'fat'
configurations = [project.configurations.include]
relocate 'com.unascribed.flexver', 'net.fabricmc.semver.impl.lib.flexver'
outputs.upToDateWhen { false }
}
build.dependsOn(fatJar)
publishing {
publications {
mavenJava(MavenPublication) {
artifact(jar)
artifact(fatJar)
artifact(sourcesJar)
}
}
repositories {
if (ENV.MAVEN_URL) {
maven {
name 'fabric'
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
}
}