Skip to content

Instantly share code, notes, and snippets.

@marchermans
Last active August 29, 2015 14:01
Show Gist options
  • Save marchermans/706ce9b6e2105695b0cc to your computer and use it in GitHub Desktop.
Save marchermans/706ce9b6e2105695b0cc to your computer and use it in GitHub Desktop.
Build.Gradle File for FTP Upload to Maven Repo
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'
}
}
configurations {
deployerJars
}
dependencies {
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2'
}
apply plugin: 'forge'
apply plugin: 'maven'
version = "0.0.1"
group= "com.Orion.OrionsBelt" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "OrionsBelt"
minecraft {
version = "1.7.2-10.12.1.1060"
assetDir = "eclipse/assets"
}
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'
}
}
task("uploadJars", type:uploadArchives ,dependsOn:build) {
description = "uploads JARs"
logger.lifecycle('Starting upload task! Upload to maven repo.')
logger.lifecycle('Upload to maven repo.')
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "ftp://maven.orionminecraft.com") {
authentication(userName: System.getenv()['FTPUserName'], password: System.getenv()['FTPPassword'])
}
}
}
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'
}
}
configurations {
deployerJars
}
dependencies {
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2'
}
apply plugin: 'forge'
apply plugin: 'maven'
version = "0.0.1"
group= "com.Orion.OrionsBelt" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "OrionsBelt"
minecraft {
version = "1.7.2-10.12.1.1060"
assetDir = "eclipse/assets"
}
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'
}
}
task("uploadJars", dependsOn:"build") {
description = "uploads JARs"
uploadArchives {
println 'Uploading to Maven Repo'
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: "ftp://maven.orionminecraft.com") {
authentication(userName: System.getenv()['FTPUserName'], password: System.getenv()['FTPPassword'])
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment