diff --git a/README.md b/README.md index 03107a1..0e7c994 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,30 @@ # MoreFood -All releases are currently located here: [MoreFood Releases](https://github.com/teammion/morefood/releases) +For more information visit the [Curse Project](http://minecraft.curseforge.com/projects/tm-morefood) ## How to contribute? -1. Get [Git](https://git-scm.com) -2. [Fork repository](https://github.com/teammion/morefood/fork) -3. Clone repository using git: `git clone [your-fork-url]` -4. Setup Minecraft Forge MDK: `./gardlew setupDecompWorkspace` -5. Setup your IDE: `./gradlew [idea|eclipse|...]` -6. Start coding -7. Push to your forked repository: `git push origin master` -8. [Create Pull Request](https://github.com/teammion/morefood/compare) -9. Repeate steps 6 to 9 - 1. To update your code add upstream-remote `git remote add upstream https://github.com/teammion/morefood.git` (This is only needed once) - 2. To update from upstram-remote: `git pull upstream master` +### Prerequisites + +- Node, NPM +- Git (On windows: Git Bash) + +### How to do it + +Since I'm using a customized build system, I should tell you how to use it. + +``` bash +# Setup gradle workspace and configure for IDE +npm run setup + +# Run Minecraft Client +npm run client + +# Run Minecraft Server +npm run server + +# Build project +npm run build +``` + +The version must be changed in the "package.json" file. diff --git a/build.gradle b/build.gradle index 1ef9a3f..f9efbba 100644 --- a/build.gradle +++ b/build.gradle @@ -21,11 +21,11 @@ plugins { } */ version = "1.0.0-rc.1" -group = "io.teammion.morefood" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +group = "io.teammion.morefood" archivesBaseName = "morefood" minecraft { - version = "1.10.2-12.18.0.2009" + version = "1.10.2-12.18.1.2014" runDir = "run" // the mappings can be changed at any time, and must be in the following format. diff --git a/build.sh b/build.sh index 11b1717..b75d31b 100755 --- a/build.sh +++ b/build.sh @@ -1,17 +1,8 @@ #!/usr/bin/env bash -# Get version -version="$(node <<< "console.log(require(\"./package.json\").version);")" +# Update +npm run update -# Write version -while IFS="" read line -do - if [ "${line:0:10}" == "version = " ] - then - old_version="${line}" - fi -done < build.gradle -sed -i "/${old_version}/c\version = \"${version}\"" build.gradle - -# Build +# Executing gradlew +echo "Executing gradlew..." ./gradlew clean build diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a616784..7a0845d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,4 @@ -#Sat Jul 09 09:54:48 CEST 2016 +#Sat Jul 16 16:09:28 CEST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/package.json b/package.json index 40a4ed4..efb6d54 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,11 @@ "version": "1.0.0-rc.1", "description": "This Minecraft Mod will add additional food to Mincraft to provide a healthy variety.", "scripts": { - "build": "./build.sh" + "setup": "./setup.sh", + "build": "./build.sh", + "update": "./update.sh", + "client": "./gradlew runClient", + "server": "./gradlew runServer" }, "repository": { "type": "git", diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..35047fc --- /dev/null +++ b/setup.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Update +npm run update +sed -i "/group = */c\group = \"io.teammion.morefood\"" build.gradle +sed -i "/group= */c\group = \"io.teammion.morefood\"" build.gradle +sed -i "/archivesBaseName = */c\archivesBaseName = \"morefood\"" build.gradle + +# IDE to configure for +read -p "IDE to configure for: [idea|eclipse] " ide +if [ ! "${ide,,}" == "idea" ] && [ ! "${ide,,}" == "eclipse" ] +then + ide="" + echo "No valid IDE! No IDE will be configured." +fi + +# Executing gradlew +echo "Executing gradlew..." +JAVA_OPTS="-Xmx2g" ./gradlew setupDecompWorkspace $ide diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..29fc5ef --- /dev/null +++ b/update.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +# Get version +version="$(node <<< "console.log(require(\"./package.json\").version);")" +echo "Version: $version" + +# Update build.gradle +echo "Updating build.gradle..." +while IFS="" read line +do + if [ "${line:0:10}" == "version = " ] + then + old_version="$line" + fi +done < build.gradle +sed -i "/$old_version/c\version = \"$version\"" build.gradle