forked from CoFH/ThermalCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
194 lines (170 loc) · 5.92 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url 'https://maven.minecraftforge.net/' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
plugins {
id 'java'
id 'maven-publish'
id 'net.covers1624.signing' version '1.1.4'
}
apply plugin: 'net.minecraftforge.gradle'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
sourceSets.main.resources.srcDirs += "src/main/generated"
def signProps = [:]
if (System.getenv('KEY_STORE')) {
println 'Using Env variables for jar signing.'
signProps['keyStore'] = System.getenv('KEY_STORE')
file(System.getenv('KEY_STORE_PROPS')).withReader {
def props = new Properties()
props.load(it)
signProps.putAll(props)
}
} else if (project.hasProperty('keyStore')) {
println 'Using Project properties for jar signing.'
signProps['keyStore'] = project.getProperty('keyStore')
signProps['storePass'] = project.getProperty('keyStorePass')
signProps['alias'] = project.getProperty('keyStoreAlias')
signProps['keyPass'] = project.getProperty('keyStoreKeyPass')
} else {
println 'No signing secrets found, build will not be signed.'
}
mod_version = "${mod_version}." + (System.getenv("BUILD_NUMBER") ?: "1")
version = "${mc_version}-${mod_version}"
group = 'com.teamcofh'
archivesBaseName = "${mod_id}_core"
repositories {
mavenLocal()
maven {
url 'https://maven.covers1624.net/'
}
maven { // TOP
url 'https://maven.tterrag.com/'
}
maven { // JEI
url 'https://dvs1.progwml6.com/files/maven/'
}
maven { // Patchouli
url 'https://maven.blamejared.com/'
}
maven { // Curios
url 'https://maven.theillusivec4.top/'
}
}
minecraft {
mappings channel: 'official', version: "${mc_version}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
data {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
args '--all', '--output', file('src/main/generated/'),
'--mod', archivesBaseName,
'--existing', sourceSets.main.resources.srcDirs[0]
mods {
Thermal {
sourceSets.main
}
}
}
}
}
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
implementation fg.deobf("com.teamcofh:cofh_core:${mc_version}-${cofh_core_version}")
// compile against the JEI API but do not include it at runtime
compileOnly fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}")
// at runtime, use the full JEI
runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-common:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-forge-${mc_version}:${crt_version}")
compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
}
signing {
if (!signProps.isEmpty()) {
jars {
sign jar
after 'reobfJar'
keyStore = signProps.keyStore
alias = signProps.alias
storePass = signProps.storePass
keyPass = signProps.keyPass
}
}
}
jar {
manifest {
attributes([
'Specification-Title' : "${mod_name}",
'Specification-Vendor' : 'Team CoFH',
'Specification-Version' : "${mc_version}",
'Implementation-Title' : "${mod_id}",
'Implementation-Vendor' : 'Team CoFH',
'Implementation-Version' : "${mod_version}",
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
task srcJar(type: Jar) {
build.dependsOn it
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
repositories {
if (System.getenv('MAVEN_PASS')) {
maven {
url 'https://nexus.covers1624.net/repository/cofh-releases/'
credentials {
username 'kinglemming'
password System.getenv('MAVEN_PASS')
}
}
}
}
publications {
mod(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact jar
artifact srcJar
pom {
name = archivesBaseName
description = archivesBaseName
url = "https://github.com/CoFH/${project.name}"
scm {
url = "https://github.com/CoFH/${project.name}"
connection = "scm:git:git://github.com/CoFH/${project.name}.git"
connection = "scm:git:[email protected]:CoFH/${project.name}.git"
}
issueManagement {
system = 'discord'
url = 'https://discord.gg/uRKrnbH'
}
licenses {
license {
name = 'Don\'t Be a Jerk v2'
url = "https://github.com/CoFH/${project.name}/blob/main/README.md"
distribution = 'repo'
}
}
developers {
developer {
id = 'teamcofh'
name = 'Team CoFH'
}
}
}
}
}
}