-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
206 lines (185 loc) · 6.07 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
195
196
197
198
199
200
201
202
203
204
205
206
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
}
}
plugins {
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "1.71.4"
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
version = "${minecraftVersion}-${project.api_version}"
if (System.getenv('BUILD_NUMBER') != null) {
version += "-" + System.getenv('BUILD_NUMBER')
}else{
System.setProperty("org.gradle.java.home", "C:/Program Files/AdoptOpenJDK/jdk-8.0.265.01-hotspot")
}
group = 'com.hrznstudio'
archivesBaseName = 'titanium'
def isReleaseBranch = System.getenv("GIT_BRANCH") == "release" || System.getenv("GIT_BRANCH") == "release-1.15" || System.getenv("GIT_BRANCH") == "release-1.16";
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
license {
header = project.file('HEADER')
ext {
year = Calendar.getInstance().get(Calendar.YEAR)
name = 'Horizon Studio'
email = '[email protected]'
mod = 'Titanium'
}
}
minecraft {
mappings channel: 'snapshot', version: '20200916-1.16.2'
runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
mods{
Titanium{
source sourceSets.main
}
}
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
workingDirectory project.file('run').canonicalPath
mods{
Titanium{
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.console.level', 'info'
args '--mod', 'titanium', '--all', '--output', file('src/main/resources'), '--input', file('src/main/resources')
mods{
Titanium{
source sourceSets.main
}
}
}
}
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
}
repositories {
mavenCentral()
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
maven {
url "https://maven.tterrag.com/"
}
maven {
url 'https://www.dogforce-games.com/maven/'
}
maven {
url "https://cursemaven.com"
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.16.5-36.2.8'
compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.1.121:api")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.1.121")
implementation fg.deobf("curse.maven:industrial-foregoing-266515:5334823")
}
jar {
manifest {
attributes(["Specification-Title": project.name,
"Specification-Vendor": "Horizon Studio",
"Specification-Version": "2.0",
"Implementation-Title": project.name,
"Implementation-Version": "${project.api_version}",
"Implementation-Vendor" :"Horizon Studio",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Maven-Artifact": "${group}:${archivesBaseName}:${version}",
"ModSide": "BOTH",
],)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task deobfJar(type:Jar) {
from sourceSets.main.output
classifier 'deobf'
}
artifacts {
archives sourcesJar
archives javadocJar
archives deobfJar
}
publish.dependsOn(project.tasks.getByName("assemble"))
publish.mustRunAfter(project.tasks.getByName("build"))
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
artifact javadocJar
artifact deobfJar
}
}
repositories {
if(isReleaseBranch) {
maven {
url "file://" + System.getenv("local_maven")
}
} else {
mavenLocal()
}
}
}
tasks.curseforge.enabled = System.env["CURSE_API"] != null
curseforge {
if (System.env["CURSE_API"] != null){
apiKey = System.env["CURSE_API"]
}
project {
id = '287342'
changelog = "https://github.com/InnovativeOnlineIndustries/Titanium/blob/changelog/CHANGELOG.md"
changelogType = 'markdown'
releaseType = 'beta'
addGameVersion '1.16.3'
addGameVersion '1.16.4'
addGameVersion '1.16.5'
mainArtifact(jar){
}
}
}
task makeChangelog(type: GitChangelogTask) {
//fromRepo = file("../../home/runner/work/Titanium/Titanium")
file = new File("CHANGELOG.md")
untaggedName = "Version ${project.version}"
fromCommit = "6a5a3df3665643ea181873312e3801db7c662686"
fromRef = "refs/tags/2.4.0"
toRef = "release-1.16"
templateContent = file("changelog.mustache").getText("UTF-8")
}