-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
134 lines (110 loc) · 3.63 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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
mavenCentral()
maven {
name 'FancyGradle'
url 'https://gitlab.com/api/v4/projects/26758973/packages/maven'
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:5.+'
classpath group: 'wtf.gofancy.fancygradle', name: 'wtf.gofancy.fancygradle.gradle.plugin', version: '1.1.0-0'
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'wtf.gofancy.fancygradle'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
fancyGradle {
patches {
resources
coremods
asm
}
}
dependencies {
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'
//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'
}
idea {
module {
testOutputDir = file('output_tests')
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
minecraft {
mappings channel: 'snapshot', version: '20171003-1.12'
accessTransformer = file('src/main/resources/META-INF/ICBMClassic_at.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
}
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'
}
jar {
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"FMLAT": "ICBMClassic_at.cfg")
}
repositories {
mavenCentral()
}
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
}