forked from maruohon/malilib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
156 lines (130 loc) · 3.66 KB
/
Copy pathbuild.gradle
File metadata and controls
156 lines (130 loc) · 3.66 KB
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
buildscript {
repositories {
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.liteloader'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'maven-publish'
minecraft {
version = project.minecraft_version
mappings = project.mappings_version
runDir = 'minecraft'
makeObfSourceJar = false
ext.mod_version = project.mod_version
if (mod_version.endsWith('-dev')) {
mod_version = mod_version + "." + new Date().format('yyyyMMdd.HHmmss')
}
replaceIn "MaLiLibReference.java"
replace "@MOD_VERSION@", mod_version
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
sourceSets {
main {
ext.refMap = 'mixins.' + project.mod_id + '.refmap.json'
}
}
group = project.mod_id // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = project.mod_file_name + '-' + project.minecraft_version_out
version = project.minecraft.mod_version
/**
* This section allows you to customise the generated litemod.json file
*/
litemod {
json {
name = project.mod_id
displayName = project.mod_name
mcversion = project.minecraft_version
version = project.minecraft.mod_version
author = project.author
// Uncomment any of the following lines and fill in your own details as required
//dependsOn = [ 'modid', 'othermod' ]
//requiredAPIs = [ 'someapi' ]
//tweakClass = 'name.of.tweaker.here'
mixinConfigs = [ 'mixins.' + project.mod_id + '.json' ]
}
}
/**
* This section allows you to customise your generated jar (litemod) file. By
* default it includes the generated litemod.json file, however if you prefer to
* include your own file from resources, simply remove the line below.
*/
jar {
// Remove the "-mc1.12" suffix from the file name
classifier = ""
// Don't append a 'mod-' filename prefix >_>
baseName = archivesBaseName
from litemod.outputs
/*
manifest.mainAttributes (
'Built-By': System.properties['user.name'],
'Created-By': System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
'Implementation-Title': project.mod_id,
'Implementation-Version': project.version
)
*/
}
mixin {
defaultObfuscationEnv notch
}
//tasks.withType(Jar)*.baseName = archivesBaseName
processResources
{
// Exclude the GIMP image files
exclude '**/*.xcf'
exclude '**/xcf'
// this will ensure that this task is redone when the versions change.
inputs.property "mod_version", project.minecraft.mod_version
inputs.property "minecraft_version", project.minecraft_version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'mod_version': project.minecraft.mod_version, 'minecraft_version': project.minecraft_version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
// This classifier is standard and should not be changed
classifier = 'deobf'
}
// This section enables the last two tasks
artifacts {
//archives sourcesJar
archives deobfJar
}
tasks.publish.dependsOn build
publishing {
publications {
mavenJava(MavenPublication) {
artifactId project.archivesBaseName
from components.java
artifact deobfJar
artifact sourceJar
}
}
repositories {
maven {
url "$projectDir/../../CommonMaven"
}
}
}