-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (99 loc) · 2.82 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 'idea'
id 'java'
id 'maven-publish'
id 'org.checkerframework' version '0.5.+'
id 'org.cadixdev.licenser' version '0.6.1'
}
ext {
ENV = System.getenv()
MC_VERSION = '1.17.x'
VERSION = '0.1.0' // Not official released yet. Keep 0.1.0 until official released
BUILD = "${ENV.GITHUB_RUN_NUMBER ?: 'INTERNAL_BUILD'}"
}
group = 'org.pistonmc.api'
base.archivesName = 'plugin-api'
version = "$MC_VERSION-$VERSION${ENV.GITHUB_EVENT_NAME != 'workflow_dispatch' ? '-SNAPSHOT' : ".$BUILD"}"
repositories {
mavenCentral()
maven {
name 'forge-maven'
url 'https://maven.minecraftforge.net/'
}
}
configurations.compileOnly.canBeResolved = true
java {
toolchain.languageVersion = JavaLanguageVersion.of(16)
withSourcesJar()
withJavadocJar()
}
license {
header = project.file('HEADER')
properties {
year = '2021'
}
include('**/*.java')
}
checkerFramework {
checkers = [
'org.checkerframework.checker.nullness.NullnessChecker',
'org.checkerframework.common.value.ValueChecker',
]
}
dependencies {
compileOnly libs.bundles.compileonlys
implementation(libs.bundles.libs) {
exclude module: 'annotations'
exclude group: 'org.checkerframework'
}
implementation(libs.bundles.nontransitives) {
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
}
}
}