ActuallyAdditions/build.gradle
2021-02-26 21:15:48 +00:00

173 lines
4.5 KiB
Groovy

buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'net.minecraftforge.gradle'
version = "$mod_version"
group = "de.ellpeck.actuallyadditions"
archivesBaseName = "ActuallyAdditions-$game_version"
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: 'snapshot', version: "${mcp_mappings}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
actuallyadditions {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
actuallyadditions {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
args '--mod', 'actuallyadditions', '--all', '--output', file('src/generated/resources/')
mods {
actuallyadditions {
source sourceSets.main
}
}
}
}
}
repositories {
maven {
// JEI
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
url = "https://www.cursemaven.com"
}
}
dependencies {
minecraft "net.minecraftforge:forge:${game_version}-${forge_version}"
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")
}
// not sure if this is still needed
processResources {
inputs.property('version', project.version)
from(sourceSets.main.resources.srcDirs) {
include 'META-INF/mods.toml'
expand 'version': project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'META-INF/mods.toml'
}
}
jar {
group = 'artifact'
manifest {
attributes(["Specification-Title" : "BuildingGadgets",
"Specification-Version" : "1",
"Implementation-Title" : project.archivesBaseName,
"Implementation-Version" : project.version,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
from sourceSets.main.output
}
task deobfJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'dev'
}
task apiJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'api'
include 'de/ellpeck/actuallyadditions/api/**'
}
javadoc {
include 'de/ellpeck/actuallyadditions/api/**'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
classifier 'javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier = 'sources'
}
artifacts {
archives deobfJar, sourcesJar, apiJar, javadocJar
}
publishing {
tasks.publish.dependsOn build
publications {
mavenJava(MavenPublication) {
groupId = group
artifactId = archivesBaseName
version = version
from components.java
artifact deobfJar
artifact sourcesJar
artifact apiJar
artifact javadocJar
pom.withXml {
def node = asNode()
if (node.dependencies.size() > 0)
node.remove(node.dependencies)
}
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}