mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 02:28:42 +00:00
172 lines
3.9 KiB
Groovy
172 lines
3.9 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
name = "GTMaven"
|
|
url = "https://gregtech.overminddl1.com/"
|
|
}
|
|
maven {
|
|
name = "sonatype"
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
}
|
|
maven {
|
|
url = "https://repo1.maven.org/maven2/"
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
tasks.withType(JavaCompile) {
|
|
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
|
|
}
|
|
}
|
|
|
|
apply plugin: 'eclipse'
|
|
eclipse {
|
|
classpath {
|
|
downloadJavadoc = true
|
|
downloadSources = true
|
|
}
|
|
}
|
|
|
|
def eclipseRuntimeClasspath = ""
|
|
def eclipseRuntimeClasspathTemplate = "<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry externalArchive="@@PATH@@" path="3" type="2"/> \"/>\n"
|
|
|
|
task eclipseForgeWorkspace(type: Copy) {
|
|
doFirst {
|
|
sourceSets.main.runtimeClasspath.collect {
|
|
eclipseRuntimeClasspath += eclipseRuntimeClasspathTemplate.replaceAll('@@PATH@@', it.toString())
|
|
""
|
|
}
|
|
}
|
|
from(".meta/eclipse/.metadata") {
|
|
include '**/*.template'
|
|
rename { it.replace '.template', '' }
|
|
filter { it.replaceAll('@@eclipseRuntimeClasspath@@', eclipseRuntimeClasspath) }
|
|
//rename '(.*).template', '$1'
|
|
}
|
|
from(".meta/eclipse/.metadata") {
|
|
exclude '**/*.launch'
|
|
}
|
|
into "eclipse/.metadata"
|
|
}
|
|
|
|
import org.apache.tools.ant.taskdefs.condition.Os
|
|
task eclipseForgeProject {
|
|
doLast {
|
|
if(!(new File("eclipse/Minecraft")).exists()) {
|
|
if(!Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
ant.symlink(resource: "../", link: "eclipse/Minecraft")
|
|
} else {
|
|
println("WINDOWS: Before loading this workspace with Eclipse, manually run this in an Elevated/Admin command prompt:")
|
|
println("mklink /D " + (new File("").absolutePath) + "/eclipse/Minecraft " + (new File("").absolutePath))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
eclipseForgeProject.dependsOn(eclipseForgeWorkspace)
|
|
|
|
tasks.eclipse.dependsOn(eclipseForgeProject)
|
|
|
|
apply plugin: 'idea'
|
|
idea {
|
|
module {
|
|
downloadJavadoc = true
|
|
downloadSources = true
|
|
}
|
|
}
|
|
|
|
apply plugin: 'forge'
|
|
|
|
version = "1.0.27"
|
|
group= "com.hbm"
|
|
archivesBaseName = "hbm"
|
|
|
|
minecraft {
|
|
version = "1.7.10-10.13.4.1614-1.7.10"
|
|
runDir = "instance"
|
|
}
|
|
|
|
sourceCompatibility = 1.7
|
|
targetCompatibility = 1.7
|
|
compileJava.options.bootClasspath = org.gradle.internal.jvm.Jvm.current().getJre().getHomeDir().toString() +"/lib/rt.jar"
|
|
compileJava {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
name = "gt"
|
|
url = "https://gregtech.overminddl1.com/"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev"
|
|
compile "codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev"
|
|
compile "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
|
|
}
|
|
|
|
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 sourceJar(type: Jar) {
|
|
manifest {}
|
|
classifier = 'sources'
|
|
from sourceSets.main.allSource
|
|
exclude 'assets/**'
|
|
}
|
|
|
|
task devJar(type: Jar) {
|
|
manifest {}
|
|
classifier = 'dev'
|
|
from sourceSets.main.output
|
|
}
|
|
|
|
artifacts {
|
|
archives devJar, sourceJar
|
|
}
|
|
|
|
if (!hasProperty("mavenUsername")) {
|
|
ext.mavenUsername="${System.getenv().MAVEN_USERNAME}"
|
|
}
|
|
|
|
if (!hasProperty("mavenPassword")) {
|
|
ext.mavenPassword="${System.getenv().MAVEN_PASSWORD}"
|
|
}
|
|
|
|
if (!hasProperty("mavenURL")) {
|
|
ext.mavenURL="${System.getenv().MAVEN_URL}"
|
|
}
|
|
|
|
uploadArchives {
|
|
repositories {
|
|
mavenDeployer {
|
|
uniqueVersion = false
|
|
repository(url: mavenURL) {
|
|
authentication(userName: mavenUsername, password: mavenPassword)
|
|
}
|
|
}
|
|
}
|
|
}
|