Skip to content

Commit 2817339

Browse files
committed
Initial commit.
0 parents  commit 2817339

13 files changed

Lines changed: 752 additions & 0 deletions

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org>

build.gradle

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
// specify repositories and dependencies
2+
buildscript {
3+
repositories {
4+
jcenter()
5+
maven {
6+
name = "forge"
7+
url = "http://files.minecraftforge.net/maven"
8+
}
9+
}
10+
dependencies {
11+
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
12+
}
13+
}
14+
15+
// apply plugins
16+
apply plugin: project.mcVersion.equals("1.7.10") ? "forge" : "net.minecraftforge.gradle.forge"
17+
18+
// set java version
19+
sourceCompatibility = project.javaVersion
20+
targetCompatibility = project.javaVersion
21+
22+
version=getVersionFromJava(file("src/main/java/" + project.modClass))
23+
group=project.name.toLowerCase()
24+
archivesBaseName = project.name + "-" + project.mcVersion
25+
26+
// source directories
27+
sourceSets {
28+
main {
29+
java { srcDirs = ["$projectDir/src/main/java"] }
30+
resources { srcDirs = ["$projectDir/src/main/resources"] }
31+
}
32+
}
33+
34+
jar {
35+
manifest {
36+
attributes 'FMLCorePlugin': 'coolsquid.eventtimer.asm.EventTimerPlugin'
37+
attributes 'FMLCorePluginContainsFMLMod': 'true'
38+
}
39+
}
40+
41+
// set forge version and mappings
42+
minecraft {
43+
version = project.mcVersion + "-" + project.forgeVersion
44+
runDir = "run"
45+
mappings = project.mappings
46+
}
47+
48+
repositories {
49+
maven {
50+
url "http://www.ryanliptak.com/maven/"
51+
}
52+
}
53+
// include all files in /libs as dependencies
54+
dependencies {
55+
compile fileTree(dir: "libs", include: "*.jar,*.zip")
56+
deobfCompile "applecore:AppleCore:1.12.2-3.2.0+335.2dbab:api"
57+
}
58+
59+
// update mcmod.info
60+
processResources
61+
{
62+
// this will ensure that this task is redone when the versions change.
63+
inputs.property "version", project.version
64+
inputs.property "mcversion", project.mcVersion
65+
66+
// replace stuff in mcmod.info, nothing else
67+
from(sourceSets.main.resources) {
68+
include "mcmod.info"
69+
70+
// replace version and mcversion
71+
expand "version":project.version, "mcversion":project.minecraft.version
72+
}
73+
74+
// copy everything else, thats not the mcmod.info
75+
from(sourceSets.main.resources) {
76+
exclude "mcmod.info"
77+
}
78+
}
79+
80+
task sourcesJar(type: Jar, dependsOn: classes) {
81+
classifier = "sources"
82+
from sourceSets.main.java
83+
}
84+
85+
task devJar(type: Jar) {
86+
from sourceSets.main.output
87+
classifier = "dev"
88+
}
89+
90+
// make the dev and source jars
91+
artifacts {
92+
if (Boolean.parseBoolean(project.makeSourceJar)) {
93+
archives sourcesJar
94+
}
95+
if (Boolean.parseBoolean(project.makeDevJar)) {
96+
archives devJar
97+
}
98+
}
99+
100+
String getVersionFromJava(File file) {
101+
102+
String release = "0";
103+
String update = "0";
104+
String patch = "0";
105+
106+
String build = System.getenv("BUILD_NUMBER") ? System.getenv("BUILD_NUMBER") : "0";
107+
def outfile = "";
108+
def ln = System.getProperty("line.separator")
109+
110+
String prefix = "public static final String VERSION = \"";
111+
file.eachLine {
112+
String s ->
113+
114+
String v = s.trim();
115+
116+
if (v.startsWith(prefix)) {
117+
118+
v = v.substring(prefix.length(), v.length() - 2);
119+
String[] pts = v.split("\\.");
120+
121+
release = pts[0];
122+
update = pts[1];
123+
patch = pts[2];
124+
s = s.replaceAll(".0\";", ".${build}\";");
125+
}
126+
127+
outfile += (s + ln);
128+
}
129+
130+
file.write(outfile);
131+
132+
return "$release.$update.$patch";
133+
}

gradle.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name=EventTimer
2+
modClass=coolsquid/eventtimer/EventTimerMod.java
3+
mcVersion=1.12.2
4+
javaVersion=1.8
5+
forgeVersion=14.23.5.2836
6+
mappings=snapshot_20171003
7+
makeDevJar=true
8+
makeSourceJar=true

gradle/wrapper/gradle-wrapper.jar

53.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Jul 07 00:22:32 CEST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)