Skip to content

Commit 7065909

Browse files
Overhaul gradle build
1 parent fd01c17 commit 7065909

File tree

5 files changed

+50
-69
lines changed

5 files changed

+50
-69
lines changed

build.gradle

Lines changed: 36 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,55 @@
11
buildscript {
2-
repositories {
3-
jcenter()
4-
maven { url = "http://files.minecraftforge.net/maven" }
5-
}
6-
dependencies {
7-
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
8-
}
2+
repositories {
3+
jcenter()
4+
maven { url = "http://files.minecraftforge.net/maven" }
5+
}
6+
dependencies {
7+
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
8+
}
99
}
10+
1011
apply plugin: 'net.minecraftforge.gradle.forge'
12+
1113
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1214

1315

14-
version = "1.12.2-0.7.1e"
15-
group = "com.ferreusveritas.dynamictrees" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
16-
archivesBaseName = "DynamicTrees"
16+
version = "${mc_version}-${mod_version}"
17+
group = package_group
18+
archivesBaseName = mod_name
1719

1820
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
1921
compileJava {
20-
sourceCompatibility = targetCompatibility = '1.8'
22+
sourceCompatibility = targetCompatibility = '1.8'
2123
}
2224

2325
minecraft {
24-
version = "1.12.2-14.23.1.2555"
25-
runDir = "run"
26-
27-
// the mappings can be changed at any time, and must be in the following format.
28-
// snapshot_YYYYMMDD snapshot are built nightly.
29-
// stable_# stables are built at the discretion of the MCP team.
30-
// Use non-default mappings at your own risk. they may not always work.
31-
// simply re-run your setup task after changing the mappings to update your workspace.
32-
mappings = "snapshot_20170624"
33-
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
26+
version = "${mc_version}-${forge_version}"
27+
runDir = "run"
28+
29+
replace "@VERSION@", project.version
30+
replaceIn "ModConstants.java"
31+
32+
makeObfSourceJar = false
33+
34+
if (project.hasProperty('mappings_version'))
35+
mappings = project.mappings_version
3436
}
3537

3638
dependencies {
37-
// you may put jars on which you depend on in ./libs
38-
// or you may define them like so..
39-
//compile "some.group:artifact:version:classifier"
40-
//compile "some.group:artifact:version"
41-
42-
// real examples
43-
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
44-
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
45-
46-
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
47-
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
48-
49-
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
50-
// except that these dependencies get remapped to your current MCP mappings
51-
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
52-
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
53-
54-
// for more info...
55-
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
56-
// http://www.gradle.org/docs/current/userguide/dependency_management.html
5739

5840
}
5941

6042
processResources {
61-
// this will ensure that this task is redone when the versions change.
62-
inputs.property "version", project.version
63-
inputs.property "mcversion", project.minecraft.version
64-
65-
// replace stuff in mcmod.info, nothing else
66-
from(sourceSets.main.resources.srcDirs) {
67-
include 'mcmod.info'
68-
69-
// replace version and mcversion
70-
expand 'version':project.version, 'mcversion':project.minecraft.version
71-
}
72-
73-
// copy everything else except the mcmod.info
74-
from(sourceSets.main.resources.srcDirs) {
75-
exclude 'mcmod.info'
76-
}
77-
}
43+
inputs.property "version", project.version
44+
inputs.property "mcversion", project.minecraft.version
45+
46+
from(sourceSets.main.resources.srcDirs) {
47+
include 'mcmod.info'
48+
49+
expand 'version':project.version, 'mcversion':project.minecraft.version
50+
}
51+
52+
from(sourceSets.main.resources.srcDirs) {
53+
exclude 'mcmod.info'
54+
}
55+
}

gradle.properties

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
2-
# This is required to provide enough memory for the Minecraft decompilation process.
3-
org.gradle.jvmargs=-Xmx3G
1+
mod_name=DynamicTrees
2+
mod_version=0.7.1e
3+
package_group=com.ferreusveritas.dynamictrees
4+
5+
mc_version=1.12.2
6+
forge_version=14.23.1.2555
7+
mappings_version=snapshot_20170624
8+
9+
org.gradle.jvmargs=-Xmx3G

src/main/java/com/ferreusveritas/dynamictrees/DynamicTrees.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
* <p>
4545
* 2016-2017 Ferreusveritas
4646
* </p>
47-
*
48-
* @author ferreusveritas
49-
* @version 0.7.1e
5047
*
5148
*/
5249
@Mod(modid = ModConstants.MODID, version=ModConstants.VERSION,dependencies="after:computercraft;after:quark")

src/main/java/com/ferreusveritas/dynamictrees/ModConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
public class ModConstants {
44

55
public static final String MODID = "dynamictrees";
6-
public static final String VERSION = "0.7.1e";
6+
public static final String VERSION = "@VERSION@";
77

88
}

src/main/resources/mcmod.info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
{
33
"modid": "dynamictrees",
44
"name": "Dynamic Trees",
5-
"description": "Trees that grow.. forests that spread",
6-
"version": "0.7.1e",
7-
"mcversion": "1.12.2",
5+
"description": "Progressively growing trees.. forests that spread",
6+
"version": "${version}",
7+
"mcversion": "${mcversion}",
88
"url": "",
99
"updateUrl": "",
10-
"authorList": [ "Ferreus Veritas" ],
10+
"authorList": [ "FerreusVeritas" ],
1111
"credits": "",
1212
"logoFile": "",
1313
"screenshots": [],

0 commit comments

Comments
 (0)