Skip to content

Commit

Permalink
Update for MC 1.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LunNova committed Sep 2, 2016
1 parent 054f69a commit 7136902
Show file tree
Hide file tree
Showing 10 changed files with 130 additions and 133 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -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
4 changes: 3 additions & 1 deletion .gitattributes
Expand Up @@ -2,6 +2,8 @@
# and leave all files detected as binary untouched.
* text=auto eol=lf

*.bat text eol=crlf

#
# The above will handle all files NOT found below
#
Expand Down Expand Up @@ -35,4 +37,4 @@
*.jpeg binary
*.png binary
*.so binary
*.war binary
*.war binary
25 changes: 2 additions & 23 deletions README.md
Expand Up @@ -13,9 +13,8 @@ Compiling
---------
LogSpamMustDie is built using Gradle.

* Install the java development kit
* Run `./gradlew setupDevWorkspace jar`

* Install JDK 8
* Run `./gradlew setupDevWorkspace jar`

Coding and Pull Request Formatting
----------------------------------
Expand All @@ -25,23 +24,3 @@ Coding and Pull Request Formatting
* Pull requests must be formatted properly.

Please follow the above conventions if you want your pull requests accepted.

Donations
----------------------------------

Bitcoin: [1BUjvwxxGH23Fkj7vdGtbrgLEF91u8npQu](bitcoin:1BUjvwxxGH23Fkj7vdGtbrgLEF91u8npQu)

Paypal: rossallan3+pp@googlemail.com

Contributors
----------------------------------

* [nallar](https://github.com/nallar/ "Ross Allan")
* Everyone who's helped with testing and reporting bugs :)

Acknowledgements
----------------------------------

YourKit is kindly supporting open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products: [YourKit Java Profiler](http://www.yourkit.com/java/profiler/index.jsp) and [YourKit .NET Profiler](http://www.yourkit.com/.net/profiler/index.jsp).

[Jenkins]: http://nallar.me/buildservice
137 changes: 69 additions & 68 deletions build.gradle
@@ -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 modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -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
57 changes: 31 additions & 26 deletions gradlew
Expand Up @@ -6,12 +6,30 @@
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS="-Xmx2G"

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -161,4 +161,9 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
14 changes: 4 additions & 10 deletions gradlew.bat
Expand Up @@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-Xmx2G

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

Expand Down Expand Up @@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down

0 comments on commit 7136902

Please sign in to comment.