-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (94 loc) · 2.77 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
plugins {
id 'idea'
id 'java'
id 'maven-publish'
}
ext {
ENV = System.getenv()
MC_VERSION = '1.16.x'
VERSION = '0.1.0'
BUILD = "${ENV.GITHUB_RUN_NUMBER ?: 'INTERNAL_BUILD'}"
}
group = 'org.pistonmc.api'
base.archivesName = 'mod-api'
version = "$MC_VERSION-$VERSION${ENV.GITHUB_EVENT_NAME != 'workflow_dispatch' ? '-SNAPSHOT' : ".$BUILD"}"
repositories {
mavenCentral()
maven {
name 'Piston Plugin API GitHub Registry'
url 'https://maven.pkg.github.com/PistonMinecraft/Piston-PluginAPI'
credentials {
username = ENV.GPR_USERNAME ?: ENV.GITHUB_ACTOR
password = ENV.GPR_TOKEN
}
}
maven {
name 'forge-maven'
url 'https://maven.minecraftforge.net/'
}
}
configurations.compileOnly.canBeResolved = true
java {
toolchain.languageVersion = JavaLanguageVersion.of(16)
withSourcesJar()
withJavadocJar()
}
dependencies {
implementation "org.pistonmc.api:plugin-api:$MC_VERSION-$VERSION.+"
compileOnly libs.bundles.compileonlys
implementation(libs.bundles.libs) {
exclude group: 'org.ow2.asm'
exclude group: 'org.apache.logging.log4j'
exclude module: 'jopt-simple'
}
// implementation(libs.bundles.shared.nontransitive.libs) {
// transitive = false
// }
annotationProcessor libs.bundles.annotations
}
tasks.withType(JavaCompile) {
options.encoding 'UTF-8'
options.compilerArgs.add '-Xplugin:Manifold'
}
tasks.withType(Javadoc) {
options.encoding 'UTF-8'
options.locale 'en_US' // This doesn't work, don't know why
classpath += configurations.annotationProcessor
configurations.compileOnly.resolve().each {
if(it.name.startsWith('manifold-javadoc-agent')) {
options.jFlags("-javaagent:${it.absolutePath}")
}
}
}
tasks.withType(Jar) {
manifest.attributes([
'Specification-Title': project.name,
'Specification-Version': project.ext.MC_VERSION,
'Specification-Vendor': 'PistonMC',
'Implementation-Title': project.name,
'Implementation-Version': project.ext.VERSION,
'Implementation-Vendor': 'PistonMC',
])
}
publishing {
repositories {
maven {
name "${project.name}-GitHub-Registry"
url "https://maven.pkg.github.com/PistonMinecraft/${project.name}"
credentials {
username = ENV.GPR_USERNAME ?: ENV.GITHUB_ACTOR
password = ENV.GPR_TOKEN
}
}
maven {
name 'localrepo'
url layout.buildDirectory.dir('localrepo')
}
}
publications {
maven(MavenPublication) {
artifactId = base.archivesName.get()
from components.java
}
}
}