Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Feature/add TiC Tweaking Framework #2

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 140 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
def MAVEN_URL = System.getenv("maven_url") ?: ""
def MAVEN_USER = System.getenv("maven_user") ?: ""
def MAVEN_PASS = System.getenv("maven_pass") ?: ""

buildscript {
repositories {
mavenCentral()
Expand All @@ -16,7 +20,32 @@ buildscript {
}

repositories {
maven { // The repo from which to get waila
name "Mobius Repo"
url "http://mobiusstrip.eu/maven"
}
maven { // the repo from which to get NEI and stuff
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
maven {
name = "IGW"
url = "http://maven.k-4u.nl/"
}
maven {
name 'OpenComputers'
url = "http://maven.cil.li/"
}
maven {
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}

// This is a simple flatdir repository for "uploadArchives" when you don't have a remote repo to target
flatDir {
name "fileRepo"
dirs "repo"
}
}

ext.configFile = file "build.properties"
Expand All @@ -29,10 +58,12 @@ configFile.withReader {
}

apply plugin: 'forge'
version = config.mod_version
group = "com.nincraft.nincraftlib" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "NincraftLib"

// def versionInfo = getGitVersion()
version = "${config.minecraft_version}-${config.mod_version}+${System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"}" // "${versionInfo['NincraftLib.version']}"

group = "com.nincraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "NincraftLib"

minecraft {
version = config.minecraft_version + "-" + config.forge_version
Expand All @@ -43,8 +74,6 @@ minecraft {
replace "@MOD_VERSION@", "${config.mod_version}+${System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"}"
}

version = "${config.minecraft_version}-${config.mod_version}+${System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"}"

dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
Expand All @@ -58,6 +87,13 @@ dependencies {
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

compile fileTree(dir: 'lib', include: '*.jar')
compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.cclib_version}:dev"
compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.cccore_version}:dev"
compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.nei_version}:dev"
compile "mcp.mobius.waila:Waila:${config.waila_version}_${config.minecraft_version}"
compile "tconstruct:TConstruct:${config.minecraft_version}-${config.tconstruct_version}:deobf"
}

processResources
Expand Down Expand Up @@ -87,4 +123,102 @@ task devJar(type: Jar, dependsOn: 'classes') {

extension = 'jar'
classifier = 'dev'
}
}

// Configure an upload task. this is setup for uploading to files.minecraftforge.net. There are other examples around
uploadArchives {
repositories.mavenDeployer {

dependsOn 'build'

if (MAVEN_URL)
{
repository(url: MAVEN_URL) {
authentication(userName: MAVEN_USER, password: MAVEN_PASS)
}
}
else
{
// local repo folder. Might want to just use gradle install if you want to send it to maven-local
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}

// This is just the pom data for the maven repo
pom {
groupId = project.group
// Force the maven upload to use the <mcversion>-<version> syntax preferred at files
version = project.version // "${project.minecraft.version}-${project.version}"
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Nincrafty Things'
url 'https://github.com/Nincraft/NincraftLib'

scm {
url 'https://github.com/Nincraft/NincraftLib'
connection 'scm:git:git://github.com/Nincraft/NincraftLib.git'
developerConnection 'scm:git:[email protected]:Nincraft/NincraftLib.git'
}

issueManagement {
system 'github'
url 'https://github.com/Nincraft/NincraftLib/issues'
}

licenses {
license {
name 'GNU Public License (GPL), Version 3.0'
url 'http://www.gnu.org/licenses/gpl-3.0.txt'
distribution 'repo'
}
}

developers {
developer {
id 'Nincodedo'
name 'Nincodedo'
roles { role 'developer' }
}

developer {
id 'Undead_Zeratul'
name 'Undead_Zeratul'
roles { role 'developer' }
}
}
}
}
}
}

// This is a special task for pulling the version information from git and the environment (for BUILD_NUMBER)
def getGitVersion()
{
def out = [:]

// call git command.
def outStream = new ByteArrayOutputStream()
def result = exec {
executable = 'git'
args = [ 'describe', '--long', "--match=[^(jenkins)]*"]
standardOutput = outStream
}

def fullVersion = outStream.toString().trim()
def matcher = fullVersion =~ /(\d+).(\d+)-(\d+)-(.*)/

def maj = matcher[0][1]
def min = matcher[0][2]
def rev = matcher[0][3]
def bn = System.getenv("BUILD_NUMBER") ?: "SNAPSHOT"

out['NincraftLib.build.major.number'] = maj.toString()
out['NincraftLib.build.minor.number'] = min.toString()
out['NincraftLib.build.revision.number'] = rev.toString()
out['NincraftLib.build.githash'] = matcher[0][4].toString()
out['NincraftLib.build.number' ] = bn.toString()
out['NincraftLib.version' ] = "${maj}.${min}.${rev}.${bn}".toString()

return out
}
9 changes: 8 additions & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
minecraft_version=1.7.10
forge_version=10.13.4.1558-1.7.10
mod_version=0.1.1
mod_version=0.1.1

cccore_version=1.0.6.43
cclib_version=1.1.1.110
fmp_version=1.2.0.345
nei_version=1.0.4.107
tconstruct_version=1.8.8.build990
waila_version=1.5.10
Loading