Last active
August 29, 2015 14:01
-
-
Save marchermans/706ce9b6e2105695b0cc to your computer and use it in GitHub Desktop.
Build.Gradle File for FTP Upload to Maven Repo
This file contains 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' | |
} | |
} | |
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']) | |
} | |
} | |
} |
This file contains 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' | |
} | |
} | |
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