-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
95 lines (83 loc) · 3.19 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
subprojects {
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'maven-publish'
// Group id and mod version
group = 'io.github.phantomloader'
version = phantomVersion
// Mojang ships Java 17 to end users in 1.18+
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
// Jar manifest attributes
jar {
manifest {
attributes([
"Specification-Title": rootProject.name,
"Specification-Vendor": 'HexagonNico',
"Specification-Version": project.version,
"Implementation-Title": project.name,
"Implementation-Version": project.jar.archiveVersion,
"Implementation-Vendor": 'HexagonNico',
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
// Sources and javadoc jars
java {
withJavadocJar()
withSourcesJar()
}
// Maven central publication
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = artifactId
version = project.version
from components.java
pom {
name = rootProject.name
description = 'A library that can automate the process of creating minecraft mods for multiple loaders'
url = 'https://github.com/PhantomLoader'
scm {
connection = 'git@github.com:PhantomLoader/PhantomLoader.git'
url = 'https://github.com/PhantomLoader/PhantomLoader'
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'HexagonNico'
name = 'Nicholas Amigoni'
email = 'nico.hex6@gmail.com'
}
}
repositories {
maven {
name = "Sonatype"
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
}
}
}
}
}
// The metadata includes mapped dependencies which are not reasonably consumable by other mod developers.
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
// Code signing
signing {
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}
}