Files
UniMixins/build.gradle
T
2023-11-22 03:38:44 +01:00

122 lines
2.7 KiB
Groovy

/** The root of the build. Exposed for flexibility, but you shouldn't edit it
unless you have to. Edit project.gradle instead. */
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
url = "https://jitpack.io"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.11'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0' apply false
}
allprojects {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'maven-publish'
// For some reason this is needed when using Gradle 6.9 (but not if using 4.4.1)
repositories {
mavenCentral()
mavenLocal()
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
maven {
name = "forge"
url = "https://maven.minecraftforge.net/"
}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven/'
}
maven {
url = "https://mvn.falsepattern.com/releases"
}
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
url 'https://jitpack.io'
}
}
apply from: "${project.rootDir}/buildscript/forge-1.7.gradle"
dependencies {
// TODO only include IFMLLoadingPlugin, Mod and ComparableVersion
compileOnly "net.minecraftforge:forge:1.12.2-14.23.5.2860:universal"
}
if(project.name.startsWith("module-") && project.name != "module-mixin" && project.name != "module-common") {
if(project.name != "module-all") {
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
}
afterEvaluate {
if(project.name != "module-all") {
task devJar(type: Jar) {
classifier = 'dev'
def jarTask = (jar.enabled ? jar : shadowJar)
from zipTree(jarTask.getOutputs().getFiles().getSingleFile())
manifest = jarTask.manifest
dependsOn jarTask
}
}
reobf.dependsOn devJar
artifacts {
archives tasks."sourcesJar"
archives tasks."devJar"
}
publishing {
publications {
create("maven", MavenPublication) {
artifact jar.enabled ? jar : shadowJar
artifact source: tasks."sourcesJar", classifier: 'sources'
artifact source: tasks."devJar", classifier: 'dev'
artifactId = archivesBaseName.substring(1)
version = jar.version
}
}
}
project.tasks.forEach {
if(it.name.startsWith("publish") && it.name.contains("PublicationTo")) {
it.dependsOn reobf
}
}
}
}
// Put license, credits and readme in jar
delete "$projectDir/build/tmp/license"
copy {
from "$projectDir"
into "$projectDir/build/tmp/license"
include "CREDITS", "LICENSE*", "README*"
}
sourceSets.main.resources.srcDir("build/tmp/license")
}