-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
115 lines (92 loc) · 2.7 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
plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
wrapper {
gradleVersion = '7.4.2'
distributionType = Wrapper.DistributionType.BIN
}
allprojects {
description = 'Change the color of your personal sky.'
group = 'com.dscalzi'
ext {
name = 'SkyChanger'
author = 'Daniel Scalzi (TheKraken7)'
url = 'https://github.com/dscalzi/skychanger'
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.cadixdev.licenser'
apply plugin: 'maven-publish'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
def major = '5'
def minor = '0'
def spongeRevision = '1'
def bukkitRevision = '1'
def rev
if (project.name.endsWith('sponge')) {
rev = spongeRevision
} else if (project.name.endsWith('bukkit')) {
rev = bukkitRevision
} else {
rev = spongeRevision.toInteger() > bukkitRevision.toInteger() ? spongeRevision : bukkitRevision
}
version = "${major}.${minor}.${rev}"
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
configurations {
testImplementation.extendsFrom compileOnly
}
processResources {
from "../LICENSE.txt"
}
license {
exclude '**/config.yml', '**/plugin.yml'
header = rootProject.file('HEADER.txt')
properties {
name = 'Daniel D. Scalzi'
year = '2017-2021'
url = 'https://github.com/dscalzi/SkyChanger'
}
}
java {
withSourcesJar()
withJavadocJar()
}
javadoc {
options.encoding('UTF-8')
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
jar {
archiveBaseName.set(project.name)
manifest {
attributes 'Implementation-Version': archiveVersion, 'Specification-Version': archiveVersion
}
}
tasks.build.dependsOn tasks.shadowJar
tasks.assemble.dependsOn tasks.shadowJar
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/dscalzi/SkyChanger")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
}