-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
138 lines (112 loc) · 3.79 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
plugins {
id 'eclipse'
//https://github.com/JetBrains/gradle-idea-ext-plugin/wiki#delegating-runbuild-and-test-actions
id 'org.jetbrains.gradle.plugin.idea-ext' version "1.1.7"
id 'net.minecraftforge.gradle' version '5.1.+'
id 'wtf.gofancy.fancygradle' version '1.1.+'
}
version = '1.0'
group = 'com.builtbroken.sbm.armorsetter'
archivesBaseName = 'SBM-ArmorSetter'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
fancyGradle {
patches {
//https://gitlab.com/gofancy/fancygradle/-/wikis/IDE-Specific-Runs
resources
coremods
asm
mergetool
}
}
idea {
module {
outputDir = compileJava.destinationDir
testOutputDir = compileTestJava.destinationDir
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
import static org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
idea.project.settings {
delegateActions {
delegateBuildRunToGradle = false
testRunner = PLATFORM
}
}
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
//accessTransformer = file('src/main/resources/META-INF/NBTTool_at.cfg')
runs {
client {
workingDirectory project.file('run/client')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
server {
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
}
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
failFast = false
workingDir = './run/tests'
mkdir './run/tests'
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2859'
//Junit 5
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
//Mockito
testImplementation 'org.mockito:mockito-inline:4.3.1'
testImplementation 'org.mockito:mockito-core:4.3.1'
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "SBM - Armor Title",
"Specification-Vendor": "Built Broken Modding & Gaming",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"Built Broken Modding & Gaming",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')
task sourcesJar(type: Jar, dependsOn: classes) {
description = 'Creates a JAR containing the source code.'
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
description = 'Creates a JAR containing the JavaDocs.'
from javadoc.destinationDir
classifier = 'javadoc'
}
task deobfJar(type: Jar) {
description = 'Creates a JAR containing the non-obfuscated compiled code.'
from sourceSets.main.output
classifier = "deobf"
}
task forgelibJar(type: Jar) {
description = 'Creates a compiled JAR which also contains raw sources.'
from sourceSets.main.output
from sourceSets.main.allJava
classifier = 'forgelib'
}
//Adds the artifact types added by this script to the actual artifacts list.
artifacts {
archives sourcesJar
archives javadocJar
archives deobfJar
archives forgelibJar
}