BiomesOPlenty/build.gradle

189 lines
5.3 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
2019-01-09 01:33:02 +00:00
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
2019-05-04 04:59:07 +00:00
plugins {
2019-12-26 08:53:01 +00:00
id "com.matthewprenger.cursegradle" version "1.4.0"
2019-05-04 04:59:07 +00:00
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'idea'
2019-05-04 04:59:07 +00:00
apply plugin: 'maven'
2015-12-17 11:17:18 +00:00
2019-12-24 10:08:51 +00:00
repositories { mavenLocal() }
2014-10-05 01:07:24 +00:00
group = "com.github.glitchfiend.biomesoplenty"
2015-06-19 09:58:24 +00:00
archivesBaseName = "BiomesOPlenty"
2014-10-04 14:37:48 +00:00
2019-05-04 05:57:04 +00:00
def getGitHash = {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
2019-05-04 07:27:07 +00:00
version = "${minecraft_version}-${mod_version}.${System.getenv().BUILD_NUMBER}"
2014-10-04 14:37:48 +00:00
minecraft {
2021-04-24 00:19:47 +00:00
mappings channel: 'official', version: minecraft_version
2019-05-25 05:24:40 +00:00
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2019-01-09 01:33:02 +00:00
runs {
client = {
workingDirectory = project.file("run").canonicalPath
source sourceSets.main
2019-01-09 01:33:02 +00:00
}
server = {
workingDirectory = project.file("run").canonicalPath
source sourceSets.main
2019-01-09 01:33:02 +00:00
}
}
}
2019-08-10 09:42:27 +00:00
processResources {
from (sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'
expand 'version': project.version
}
}
2019-05-04 05:57:04 +00:00
jar {
classifier = 'universal'
}
dependencies {
2019-04-30 05:39:42 +00:00
minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version
2019-05-04 04:59:07 +00:00
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
from (sourceSets.main.output) {
include 'LICENSE.txt'
}
classifier = 'sources'
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
}
task apiJar(type: Jar) {
from(sourceSets.main.allJava) {
include 'biomesoplenty/api/**'
}
from (sourceSets.main.output) {
include 'LICENSE.txt'
include 'biomesoplenty/api/**'
}
classifier = 'api'
}
def changelog_file = rootProject.file("build/BiomesOPlenty-${version}-changelog.txt")
2019-05-04 04:59:07 +00:00
curseforge {
if (project.hasProperty('curseApiKey')) {
apiKey = project.getProperty('curseApiKey')
project {
id = '220318'
2019-05-25 03:49:23 +00:00
if (changelog_file.exists()) {
changelog = changelog_file
}
2020-07-13 00:48:45 +00:00
releaseType = 'beta'
mainArtifact(jar) {
displayName = "Biomes O' Plenty ${version}"
}
2019-05-25 03:43:58 +00:00
addArtifact sourcesJar
addArtifact deobfJar
addArtifact apiJar
2019-05-04 04:59:07 +00:00
}
}
}
artifacts {
if (changelog_file.exists()) {
archives changelog_file
2019-05-04 04:59:07 +00:00
}
archives jar
2019-05-04 04:59:07 +00:00
archives sourcesJar
archives deobfJar
archives apiJar
}
uploadArchives {
repositories {
mavenDeployer {
if (project.hasProperty('forgeMavenPassword')) {
repository(url: "https://files.minecraftforge.net/maven/manage/upload") {
authentication(userName: project.getProperty('forgeMavenUsername'), password: project.getProperty('forgeMavenPassword'))
}
}
else {
// local repo folder. Might wanna juset use gradle install if you wanans end it to maven-local
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'Biomes O Plenty'
url 'https://github.com/Glitchfiend/BiomesOPlenty'
scm {
url 'https://github.com/Glitchfiend/BiomesOPlenty'
connection 'scm:git:git://github.com/Glitchfiend/BiomesOPlenty.git'
developerConnection 'scm:git:git@github.com:Glitchfiend/BiomesOPlenty.git'
}
issueManagement {
system 'github'
url 'https://github.com/Glitchfiend/BiomesOPlenty/issues'
}
licenses {
license {
name 'Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International Public License'
url 'http://creativecommons.org/licenses/by-nc-nd/4.0/'
distribution 'repo'
}
}
developers {
developer {
id 'Adubbz'
name 'Adubbz'
roles { role 'developer' }
}
developer {
id 'Forstride'
name 'Forstride'
roles { role 'developer' }
}
}
}
}
}
}
}