-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
95 lines (70 loc) · 3.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
// The properties in gradle.properties are automcatically loaded.
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
// Version of ForgeGradle to use for this project.
classpath "net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT"
}
}
apply plugin: "forge"
// Defines the version to display as part of your jar file name, and in the ingame mod info.
// Naming convention is up to you I personally recommend <minecraft version>-<mod version> as per Semantic versioning (see http://semver.org/).
// Eg. 1.7.10-1.0
// The example here is using the mcversion and modversion set in gradle.properties
version = "$mcversion-$modversion"
// The group name used in the mod, also used to determine which package to look for the mod in.
// Consult http://maven.apache.org/guides/mini/guide-naming-conventions.html for convention, normally tld.domain.project
// Eg. dk.philiphansen.basemod - That is the project "basemod" under the domain philiphansen.dk
group = "dk.philiphansen.basemod"
// The base name of the jar file, that is the name without the version appended.
// Eg. basemod - Will result in "basemod-version.number.jar" when the file is generated.
archivesBaseName = "basemod"
minecraft {
// The version of minecraft + forge to build and run the mod against.
// Eg. 1.7.10-10.13.2.1236 for Minecraft version 1.7.10, with Minecraft Forge version 10.13.2.1236
// The example here loads the minecraft version and forge version from gradle.properties
version = "$mcversion-$forgeversion"
// The directory in which to generate the Minecraft files, when the game is run from within your IDE.
runDir = "run"
// Replace all string instances of "${version}" in the Java source code, allowing you to automatically set the
// version number in the Mod annotation.
replace '${version}', project.version
}
processResources {
// Replace ${version} and ${mcversion} strings in the mcmod.info file, with the relevant version numbers set in this file.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include "mcmod.info"
expand "version":project.version, "mcversion":project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "mcmod.info"
}
}
// This task creates a jar file containing the source files of this project
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
// This classifier is standard and should not be changed
classifier = 'sources'
}
// This task creates a jar file containing the unobfuscated class files of the project
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
// This section enables the last two tasks
artifacts {
archives sourcesJar
archives deobfJar
}