forked from Vankka/EnhancedLegacyText
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
111 lines (90 loc) · 2.96 KB
/
build.gradle
File metadata and controls
111 lines (90 loc) · 2.96 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
plugins {
id 'java-library'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.0'
}
group 'dev.vankka'
version '2.0.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
api 'net.kyori:adventure-api:4.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'net.kyori:adventure-text-serializer-plain:4.9.2'
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
jar {
finalizedBy licenseFormat
}
license {
header = rootProject.file('LICENSE_HEADER')
properties {
String inception = '2021'
String currentYear = Calendar.getInstance().get(Calendar.YEAR)
year = inception == currentYear ? currentYear : inception + "-" + currentYear
}
include '**/*.java' // only java files
}
if (System.getenv('SONATYPE_KEY') == null && !project.hasProperty("signing.keyId")) {
// Don't even bother with signing/publishing if neither of these are set
return
}
task publishProject {
apply plugin: 'maven-publish'
apply plugin: 'signing'
dependsOn tasks.build
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = project.name
packaging = 'jar'
description = 'An alternative input format for Adventure'
url = 'https://github.com/Vankka/EnhancedLegacyText'
scm {
connection = 'scm:git:https://github.com/Vankka/EnhancedLegacyText.git'
developerConnection = 'scm:git:https://github.com/Vankka/EnhancedLegacyText.git'
url = 'https://github.com/Vankka/DependencyDownload'
}
licenses {
license {
name = 'MIT License'
url = 'https://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'Vankka'
}
}
}
}
}
signing {
sign publishing.publications.maven
def key = System.getenv('SONATYPE_KEY')
if (key != null) {
useInMemoryPgpKeys(key, System.getenv('SONATYPE_KEY_PASS'))
}
}
repositories {
maven {
credentials {
username findProperty('ossrhUsername')
password findProperty('ossrhPassword')
}
url version.endsWith('-SNAPSHOT') ? 'https://s01.oss.sonatype.org/content/repositories/snapshots/' : 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
}
}
}
finalizedBy publish
}