mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-10-25 20:22:25 +00:00
125 lines
2.7 KiB
Groovy
125 lines
2.7 KiB
Groovy
buildscript {
|
|
configurations.all {
|
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
|
}
|
|
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: 'scala'
|
|
apply plugin: 'forge'
|
|
|
|
file "build.properties" withReader {
|
|
def prop = new Properties()
|
|
prop.load(it)
|
|
ext.config = new ConfigSlurper().parse prop
|
|
}
|
|
|
|
if (project.hasProperty('forgeOverride')) {
|
|
config.forge.version = forgeOverride
|
|
}
|
|
|
|
if (project.hasProperty('buildnum')) {
|
|
ext.simpleVersion = "${config.bdlib.version}.${project.buildnum}"
|
|
} else {
|
|
ext.simpleVersion = "${config.bdlib.version}-DEV"
|
|
}
|
|
|
|
version = simpleVersion + '-mc' + config.minecraft.version
|
|
|
|
group = "net.bdew"
|
|
archivesBaseName = "bdlib"
|
|
|
|
minecraft {
|
|
version = "${config.minecraft.version}-${config.forge.version}"
|
|
replace("BDLIB_VER", simpleVersion.toString())
|
|
}
|
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
|
|
sourceSets {
|
|
main {
|
|
scala {
|
|
srcDir 'src'
|
|
}
|
|
resources {
|
|
srcDir 'resources'
|
|
}
|
|
output.resourcesDir = output.classesDir // Hack for IDEA
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "tokens", minecraft.replacements
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
include 'mcmod.info'
|
|
filter(ReplaceTokens, tokens: minecraft.replacements)
|
|
}
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
exclude 'mcmod.info'
|
|
}
|
|
}
|
|
|
|
task sourceJar(type: Jar) {
|
|
classifier "sources"
|
|
}
|
|
|
|
task deobfJar(type: Jar) {
|
|
from sourceSets.main.output
|
|
classifier "dev"
|
|
duplicatesStrategy "exclude"
|
|
}
|
|
|
|
afterEvaluate { project ->
|
|
// Fudge the inputs of source jars so we get the version after replacements
|
|
tasks.getByPath(":sourceJar").from(tasks.getByPath(":sourceMainScala").outputs.files)
|
|
}
|
|
|
|
artifacts {
|
|
archives sourceJar
|
|
archives deobfJar
|
|
}
|
|
|
|
apply plugin: 'maven-publish'
|
|
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
artifact deobfJar
|
|
artifact sourceJar
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url "file://var/www/maven"
|
|
}
|
|
}
|
|
}
|
|
|
|
apply plugin: 'curseforge'
|
|
|
|
curse {
|
|
projectId = config.curseforge.id
|
|
apiKey = project.hasProperty("curseForgeApiKey") ? project.curseForgeApiKey : ""
|
|
releaseType = 'alpha'
|
|
|
|
artifact = jar
|
|
changelog = project.hasProperty("changelog") ? project.changelog : "No changelog available"
|
|
|
|
additionalArtifact deobfJar
|
|
additionalArtifact sourceJar
|
|
} |