More preparations
This commit is contained in:
parent
cc6f6b8949
commit
4e61176322
4 changed files with 376 additions and 207 deletions
413
build.gradle
413
build.gradle
|
@ -1,207 +1,206 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
maven {
|
maven {
|
||||||
name = "ForgeFS"
|
name = "ForgeFS"
|
||||||
url = "http://files.minecraftforge.net/maven"
|
url = "http://files.minecraftforge.net/maven"
|
||||||
}
|
}
|
||||||
maven {
|
maven {
|
||||||
name = "sonatype"
|
name = "sonatype"
|
||||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
deployJars
|
deployJars
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: "maven"
|
apply plugin: "fml"
|
||||||
apply plugin: "fml"
|
|
||||||
|
repositories {
|
||||||
repositories {
|
mavenLocal()
|
||||||
mavenLocal()
|
flatDir {
|
||||||
flatDir {
|
name "fileRepo"
|
||||||
name "fileRepo"
|
dirs "repo"
|
||||||
dirs "repo"
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// define the properties file
|
||||||
// define the properties file
|
ext.configFile = file "build.properties"
|
||||||
ext.configFile = file "build.properties"
|
|
||||||
|
configFile.withReader {
|
||||||
configFile.withReader {
|
// read config. it shall from now on be referenced as simply config or as project.config
|
||||||
// read config. it shall from now on be referenced as simply config or as project.config
|
def prop = new Properties()
|
||||||
def prop = new Properties()
|
prop.load(it)
|
||||||
prop.load(it)
|
project.ext.config = new ConfigSlurper().parse prop
|
||||||
project.ext.config = new ConfigSlurper().parse prop
|
}
|
||||||
}
|
|
||||||
|
group = "biomesoplenty"
|
||||||
group = "biomesoplenty"
|
version = config.mod_version
|
||||||
version = config.mod_version
|
archivesBaseName = "BiomesOPlenty"
|
||||||
archivesBaseName = "BiomesOPlenty"
|
|
||||||
|
minecraft {
|
||||||
minecraft {
|
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
|
||||||
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
|
assetDir = "run/assets"
|
||||||
assetDir = "run/assets"
|
|
||||||
|
replaceIn "BiomesOPlenty.java"
|
||||||
replaceIn "BiomesOPlenty.java"
|
replace "1.42.666.42.1", config.forge_version
|
||||||
replace "1.42.666.42.1", config.forge_version
|
}
|
||||||
}
|
|
||||||
|
// add some stuff to the version
|
||||||
// add some stuff to the version
|
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
|
||||||
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
|
|
||||||
|
jenkins {
|
||||||
jenkins {
|
job = 'BiomesOPlenty'
|
||||||
job = 'BiomesOPlenty'
|
}
|
||||||
}
|
|
||||||
|
processResources {
|
||||||
processResources {
|
// replace stuff in the files we want.
|
||||||
// replace stuff in the files we want.
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
include '**/*.info'
|
||||||
include '**/*.info'
|
include '**/*.properties'
|
||||||
include '**/*.properties'
|
|
||||||
|
// replaces
|
||||||
// replaces
|
expand ([
|
||||||
expand ([
|
'modid': project.archivesBaseName,
|
||||||
'modid': project.archivesBaseName,
|
'mod_version': project.config.mod_version,
|
||||||
'mod_version': project.config.mod_version,
|
'minecraft_version': project.config.minecraft_version,
|
||||||
'minecraft_version': project.config.minecraft_version,
|
'build_number': project.config.build_number,
|
||||||
'build_number': project.config.build_number,
|
'worldcore_version': project.config.worldcore_version
|
||||||
'worldcore_version': project.config.worldcore_version
|
])
|
||||||
])
|
}
|
||||||
}
|
|
||||||
|
// copy everything else, thats we didnt do before
|
||||||
// copy everything else, thats we didnt do before
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
exclude '**/*.info'
|
||||||
exclude '**/*.info'
|
exclude '**/*.properties'
|
||||||
exclude '**/*.properties'
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
jar {
|
||||||
jar {
|
manifest {
|
||||||
manifest {
|
attributes 'FMLCorePlugin': 'biomesoplenty.asm.BOPLoadingPlugin'
|
||||||
attributes 'FMLCorePlugin': 'biomesoplenty.asm.BOPLoadingPlugin'
|
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
}
|
||||||
}
|
classifier = 'universal'
|
||||||
classifier = 'universal'
|
}
|
||||||
}
|
|
||||||
|
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
|
||||||
import net.minecraftforge.gradle.tasks.dev.ChangelogTask
|
import net.minecraftforge.gradle.common.Constants
|
||||||
import net.minecraftforge.gradle.common.Constants
|
import net.minecraftforge.gradle.delayed.*
|
||||||
import net.minecraftforge.gradle.delayed.*
|
|
||||||
|
task createChangelog(type: ChangelogTask) {
|
||||||
task createChangelog(type: ChangelogTask) {
|
def jobName = "${System.getenv().JOB_NAME}"
|
||||||
def jobName = "${System.getenv().JOB_NAME}"
|
def buildNumber = "${System.getenv().BUILD_NUMBER}"
|
||||||
def buildNumber = "${System.getenv().BUILD_NUMBER}"
|
|
||||||
|
setServerRoot(new DelayedString(project, 'http://ci.jenkins.minecraftforge.net/'))
|
||||||
setServerRoot(new DelayedString(project, 'http://ci.jenkins.minecraftforge.net/'))
|
setJobName(new DelayedString(project, jobName.toString()));
|
||||||
setJobName(new DelayedString(project, jobName.toString()));
|
setAuthName(new DelayedString(project, 'console_script'));
|
||||||
setAuthName(new DelayedString(project, 'console_script'));
|
setAuthPassword(new DelayedString(project, 'dc6d48ca20a474beeac280a9a16a926e'));
|
||||||
setAuthPassword(new DelayedString(project, 'dc6d48ca20a474beeac280a9a16a926e'));
|
setTargetBuild({buildNumber.toString()});
|
||||||
setTargetBuild({buildNumber.toString()});
|
setOutput(new DelayedFile(project, 'build/distributions/' + project.getName() + '-' + project.version + '-changelog.txt'));
|
||||||
setOutput(new DelayedFile(project, 'build/distributions/' + project.getName() + '-' + project.version + '-changelog.txt'));
|
}
|
||||||
}
|
|
||||||
|
tasks.build.dependsOn('createChangelog')
|
||||||
tasks.build.dependsOn('createChangelog')
|
|
||||||
|
task sourceJar(type: Jar) {
|
||||||
task sourceJar(type: Jar) {
|
from sourceSets.main.allJava
|
||||||
from sourceSets.main.allJava
|
classifier = 'sources'
|
||||||
classifier = 'sources'
|
}
|
||||||
}
|
|
||||||
|
task apiZip(type: Zip) {
|
||||||
task apiZip(type: Zip) {
|
from(sourceSets.main.java)
|
||||||
from(sourceSets.main.java)
|
{
|
||||||
{
|
include "biomesoplenty/api/*"
|
||||||
include "biomesoplenty/api/*"
|
}
|
||||||
}
|
classifier = 'api'
|
||||||
classifier = 'api'
|
}
|
||||||
}
|
|
||||||
|
task deobfJar(type: Jar) {
|
||||||
task deobfJar(type: Jar) {
|
from sourceSets.main.output
|
||||||
from sourceSets.main.output
|
classifier = 'deobf'
|
||||||
classifier = 'deobf'
|
}
|
||||||
}
|
|
||||||
|
artifacts {
|
||||||
artifacts {
|
archives sourceJar
|
||||||
archives sourceJar
|
archives deobfJar
|
||||||
archives deobfJar
|
archives apiZip
|
||||||
archives apiZip
|
}
|
||||||
}
|
|
||||||
|
uploadArchives {
|
||||||
uploadArchives {
|
repositories {
|
||||||
repositories {
|
add getProject().repositories.mavenLocal()
|
||||||
add getProject().repositories.mavenLocal()
|
}
|
||||||
}
|
repositories.mavenDeployer {
|
||||||
repositories.mavenDeployer {
|
configuration = configurations.deployJars
|
||||||
configuration = configurations.deployJars
|
|
||||||
|
if (project.hasProperty("filesmaven")) {
|
||||||
if (project.hasProperty("filesmaven")) {
|
logger.info('Publishing to files server')
|
||||||
logger.info('Publishing to files server')
|
repository(url: project.filesmaven.url) {
|
||||||
repository(url: project.filesmaven.url) {
|
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
|
||||||
authentication(userName: project.filesmaven.username, privateKey: project.filesmaven.key)
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
logger.info('Publishing to repo folder')
|
||||||
logger.info('Publishing to repo folder')
|
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
||||||
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
|
}
|
||||||
}
|
|
||||||
|
pom {
|
||||||
pom {
|
groupId = project.group
|
||||||
groupId = project.group
|
version = project.version
|
||||||
version = project.version
|
artifactId = project.archivesBaseName
|
||||||
artifactId = project.archivesBaseName
|
}
|
||||||
}
|
pom.project {
|
||||||
pom.project {
|
name project.archivesBaseName
|
||||||
name project.archivesBaseName
|
packaging 'jar'
|
||||||
packaging 'jar'
|
description 'Biomes O Plenty'
|
||||||
description 'Biomes O Plenty'
|
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
|
||||||
|
scm {
|
||||||
scm {
|
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
||||||
url 'https://github.com/Glitchfiend/BiomesOPlenty'
|
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
|
||||||
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
|
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
|
||||||
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
|
}
|
||||||
}
|
|
||||||
|
issueManagement {
|
||||||
issueManagement {
|
system 'github'
|
||||||
system 'github'
|
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
|
||||||
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
|
}
|
||||||
}
|
|
||||||
|
licenses {
|
||||||
licenses {
|
license {
|
||||||
license {
|
name 'Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported'
|
||||||
name 'Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported'
|
url 'http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US'
|
||||||
url 'http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US'
|
distribution 'repo'
|
||||||
distribution 'repo'
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
developers {
|
||||||
developers {
|
developer {
|
||||||
developer {
|
id 'Adubbz'
|
||||||
id 'Adubbz'
|
name 'Adubbz'
|
||||||
name 'Adubbz'
|
roles { role 'developer' }
|
||||||
roles { role 'developer' }
|
}
|
||||||
}
|
developer {
|
||||||
developer {
|
id 'Amnet'
|
||||||
id 'Amnet'
|
name 'Amnet'
|
||||||
name 'Amnet'
|
roles { role 'developer' }
|
||||||
roles { role 'developer' }
|
}
|
||||||
}
|
developer {
|
||||||
developer {
|
id 'Forstride'
|
||||||
id 'Forstride'
|
name 'Forstride'
|
||||||
name 'Forstride'
|
roles { role 'developer' }
|
||||||
roles { role 'developer' }
|
}
|
||||||
}
|
developer {
|
||||||
developer {
|
id 'ted80'
|
||||||
id 'ted80'
|
name 'ted80'
|
||||||
name 'ted80'
|
roles { role 'developer' }
|
||||||
roles { role 'developer' }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#Wed Jul 02 15:54:47 CDT 2014
|
||||||
|
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
|
164
gradlew
vendored
Executable file
164
gradlew
vendored
Executable file
|
@ -0,0 +1,164 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=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.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
Loading…
Reference in a new issue