Created
September 27, 2014 12:08
-
-
Save Ivorforce/e55d17f22f054a6fb08c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
name = "forge" | |
url = "http://files.minecraftforge.net/maven" | |
} | |
maven { | |
name = "sonatype" | |
url = "https://oss.sonatype.org/content/repositories/snapshots/" | |
} | |
} | |
dependencies { | |
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' | |
} | |
} | |
apply plugin: 'forge' | |
version = "1.0" | |
group = "ivorius.ivtoolkit" // http://maven.apache.org/guides/mini/guide-naming-conventions.html | |
archivesBaseName = "IvToolkit" | |
minecraft { | |
version = "1.7.10-10.13.0.1207" | |
assetDir = "eclipse/assets" | |
} | |
dependencies { | |
// you may put jars on which you depend on in ./libs | |
// or you may define them like so.. | |
//compile "some.group:artifact:version:classifier" | |
//compile "some.group:artifact:version" | |
// real examples | |
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env | |
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env | |
// for more info... | |
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html | |
// http://www.gradle.org/docs/current/userguide/dependency_management.html | |
} | |
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' | |
// replace version and mcversion | |
expand 'version':project.version, 'mcversion':project.minecraft.version | |
} | |
// copy everything else, thats not the mcmod.info | |
from(sourceSets.main.resources.srcDirs) { | |
// exclude 'mcmod.info' | |
} | |
} | |
sourceCompatibility = 1.7 | |
targetCompatibility = 1.7 | |
task sourceJar(type: Jar) { | |
from sourceSets.main.allSource | |
classifier = 'sources' | |
} | |
task deobfJar(type: Jar) { | |
from sourceSets.main.output | |
//Since this is now the main version, maven standards | |
classifier = '' | |
manifest { | |
} | |
} | |
artifacts { | |
archives sourceJar | |
archives deobfJar | |
} | |
jar { | |
classifier = 'universal' | |
} | |
uploadArchives() { | |
dependsOn reobf | |
if (project.mavenUrl != null) { | |
repositories { | |
logger.info('Publishing to files server') | |
mavenDeployer { | |
repository(url: project.mavenUrl) { | |
authentication(userName: project.mavenUser, password: project.mavenPassword) | |
} | |
addFilter('deobf') {artifact, file -> | |
artifact.attributes['classifier'] == 'dev' | |
} | |
pom('deobf').version = project.version | |
addFilter('sources') {artifact, file -> | |
artifact.attributes['classifier'] == 'sources' | |
} | |
pom('sources').version = project.version | |
addFilter('universal') {artifact, file -> | |
artifact.attributes['classifier'] == null | |
} | |
pom('universal').version = project.version | |
pom { | |
groupId = project.group | |
version = project.version | |
artifactId = project.archivesBaseName | |
project { | |
name project.archivesBaseName | |
packaging 'jar' | |
description 'Shared functionality for Ivorius\' mods' | |
url 'https://github.com/Ivorforce/IvToolkit' | |
scm { | |
url 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
connection 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
developerConnection 'scm:git:[email protected]:Ivorforce/IvToolkit.git' | |
} | |
issueManagement { | |
system 'github' | |
url 'https://github.com/Ivorforce/IvToolkit/issues' | |
} | |
licenses { | |
license { | |
name 'Apache 2.0' | |
url 'http://www.apache.org/licenses/LICENSE-2.0.html' | |
distribution 'repo' | |
} | |
} | |
developers { | |
developer { | |
id 'Ivorius' | |
name 'Ivorius' | |
roles { role 'developer' } | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
else { | |
logger.log(LogLevel.ERROR, 'No upload url (project.mavenUrl) defined!'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment