forked from p1ut0nium-git/Rough-Mobs-Revamped
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
111 lines (96 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
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "${minecraft_version}-${mod_version}"
group = mod_group
archivesBaseName = mod_id
sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft {
version = minecraft_version + "-" + forge_version
runDir = "run"
// Set version stored in Constants based upon gradle.properties
replace "@VERSION@", "${mod_version}"
replaceIn "Constants.java"
mappings = mappings_version
}
repositories {
maven { url 'https://maven.mcmoddev.com' }
maven {
name = "CurseForge"
url = "https://minecraft.curseforge.com/api/maven/"
}
}
dependencies {
compile "net.darkhax.gamestages:GameStages-${minecraft_version}:${gameStages_version}"
compile "net.darkhax.bookshelf:Bookshelf-${minecraft_version}:${bookshelf_version}"
compile "serene-seasons:SereneSeasons-${minecraft_version}:${sereneSeasons_version}:universal"
}
// Store properties into Manifest file.
jar {
manifest {
attributes([
'Timestamp': System.currentTimeMillis(),
"Specification-Title" : "${mod_id}",
"Specification-Vendor" : "${modVendor}",
"Specification-Version" : "${mod_version}",
"Implementation-Title" : project.archivesBaseName,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "${modVendor}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-With-Forge" : "${forge_version}",
"Supports-GameStages" : "${gameStages_version}",
"Signing-Fingerprint" : project.hasProperty('signSHA1') ? project.findProperty('signSHA1') : "unsigned"
])
}
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
// Create deobf dev jars
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
manifest {
attributes([
'Timestamp': System.currentTimeMillis(),
"Specification-Title" : "${mod_id}",
"Specification-Vendor" : "${modVendor}",
"Specification-Version" : "${mod_version}",
"Implementation-Title" : project.archivesBaseName,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "${modVendor}",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
"Built-With-Forge" : "${forge_version}",
"Supports-GameStages" : "${gameStages_version}",
"Signing-Fingerprint" : project.hasProperty('signSHA1') ? project.findProperty('signSHA1') : "unsigned"
])
}
}
artifacts {
archives deobfJar
}