Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
130 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,106 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
jcenter() | ||
maven { | ||
name = "forge" | ||
url = "http://files.minecraftforge.net/maven" | ||
name = "nallar" | ||
url = "https://repo.nallar.me/" | ||
} | ||
maven { | ||
name = "sonatype" | ||
url = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
name = "forge" | ||
url = "http://files.minecraftforge.net/maven" | ||
} | ||
} | ||
dependencies { | ||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' | ||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' | ||
} | ||
} | ||
apply plugin: 'net.minecraftforge.gradle.forge' | ||
apply plugin: 'idea' | ||
|
||
apply plugin: 'forge' | ||
|
||
// Extended project information | ||
ext.projectName = 'LogSpamMustDie' | ||
ext.inceptionYear = '2014' | ||
ext.packaging = 'jar' | ||
ext.url = 'http://nallar.me/minecraft' | ||
ext.description = 'Log Spam Must Die' | ||
ext.organization = 'nallar.me' | ||
ext.mcVersion = '1.7.10' | ||
ext.forgeVersion = "10.13.0.1208" | ||
ext.fullForgeVersion = mcVersion + "-" + forgeVersion | ||
|
||
minecraft { | ||
version = fullForgeVersion | ||
runDir = "eclipse/assets" | ||
configurations { | ||
bundledLibs | ||
compile { | ||
extendsFrom bundledLibs | ||
} | ||
} | ||
|
||
sourceCompatibility = '1.6' | ||
targetCompatibility = '1.6' | ||
|
||
version = mcVersion + '-SNAPSHOT' | ||
group = 'me.nallar' | ||
archivesBaseName = 'logspammustdie' | ||
ext.mcVersion = "1.10.2" | ||
ext.runMcVersion = "1.10.2" | ||
ext.forgeVersion = "12.18.1.2076" | ||
ext.forgeMappings = "snapshot_20160518" | ||
group = "me.nallar.modpatcherexample" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
archivesBaseName = "LogSpamMustDie" | ||
|
||
def calculateVersion() { | ||
def ver = project.runMcVersion | ||
if (System.env.BUILD_NUMBER != null) | ||
return ver + "-jenkins." + System.env.BUILD_NUMBER | ||
if (project.hasProperty("release")) | ||
return ver + '-' + project.release | ||
return ver + "-dev" | ||
} | ||
|
||
// Define variables | ||
ext.buildNumber = project.hasProperty("buildNumber") ? buildNumber : '0' | ||
ext.ciSystem = project.hasProperty("ciSystem") ? ciSystem : 'unknown' | ||
ext.commit = project.hasProperty("commit") ? commit : 'unknown' | ||
version = calculateVersion() | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url 'http://repo.nallar.me/' } | ||
maven { url = 'https://repo.nallar.me/' } | ||
} | ||
|
||
configurations { | ||
all { | ||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' | ||
} | ||
provided | ||
compile.extendsFrom provided | ||
configurations.all { | ||
resolutionStrategy.cacheChangingModulesFor 10, 'seconds' | ||
} | ||
|
||
dependencies { | ||
provided 'com.google.guava:guava:18.0' | ||
compile group:'me.nallar', name:'modpatcher', version:'1.7.10-SNAPSHOT', changing: true | ||
bundledLibs "me.nallar:ModPatcher:$mcVersion-SNAPSHOT:api" | ||
compile 'org.projectlombok:lombok:1.16.6' | ||
} | ||
|
||
jar { | ||
duplicatesStrategy = 'exclude' | ||
from((configurations.runtime - configurations.provided).filter{it.exists()}.collect { it.isDirectory() ? it : zipTree(it) }) { | ||
exclude "META-INF/**" | ||
exclude "mcmod.info" | ||
tasks.withType(JavaCompile) { | ||
sourceCompatibility = 7 | ||
targetCompatibility = 7 | ||
options.with { | ||
encoding = 'UTF-8' | ||
compilerArgs << "-Xlint:all" << '-Xlint:-path' << '-Xlint:-processing' | ||
} | ||
} | ||
|
||
minecraft { | ||
version = "${project.mcVersion}-${project.forgeVersion}" | ||
runDir = "run" | ||
mappings = project.forgeMappings | ||
|
||
replace "@MOD_VERSION@", project.version | ||
replace "@MC_VERSION@", runMcVersion | ||
} | ||
|
||
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' | ||
filesMatching("mcmod.info") { | ||
expand 'version': project.version, 'mcversion': runMcVersion | ||
} | ||
filesMatching("modpatcher.version") { | ||
expand 'version': project.version | ||
} | ||
} | ||
|
||
// replace version and mcversion | ||
expand 'version': project.version, 'mcversion': project.minecraft.version, 'name': project.projectName | ||
jar { | ||
from(configurations.bundledLibs.collect { it.isDirectory() ? it : zipTree(it) }) { | ||
exclude "META-INF/**" | ||
} | ||
|
||
// copy everything else, thats not the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } | ||
manifest.mainAttributes("FMLCorePlugin": "me.nallar.logspammustdie.CoreMod") | ||
} | ||
|
||
// Source compiler configuration | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs += [ '-Xlint:all', '-Xlint:-path' ] | ||
options.deprecation = true | ||
options.encoding = 'utf8' | ||
wrapper { | ||
gradleVersion = "3.0" | ||
def jvmOpts = "-Xmx2G" | ||
inputs.property("jvmOpts", jvmOpts) | ||
doLast { | ||
def optsEnvVar = "DEFAULT_JVM_OPTS" | ||
scriptFile.write scriptFile.text.replace("$optsEnvVar=\"\"", "$optsEnvVar=\"$jvmOpts\"") | ||
batchScript.write batchScript.text.replace("set $optsEnvVar=", "set $optsEnvVar=$jvmOpts") | ||
} | ||
} | ||
|
||
jar.manifest.mainAttributes( | ||
"Built-By": System.properties['user.name'], | ||
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")", | ||
"Implementation-Title": name, | ||
"Implementation-Version": version + "+" + ciSystem + "-b" + buildNumber + ".git-" + commit, | ||
"Implementation-Vendor": url, | ||
"FMLCorePlugin": "me.nallar.logspammustdie.CoreMod" | ||
) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Sep 11 03:36:50 BST 2014 | ||
#Fri Sep 02 11:18:03 BST 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.