ActuallyAdditions/build.gradle
2024-01-06 18:04:30 -06:00

181 lines
4.7 KiB
Groovy

buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
maven { url = 'https://maven.parchmentmc.org' }
maven { url "https://www.cursemaven.com" }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.parchmentmc:librarian:1.+'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven-publish'
version = "$mod_version"
group = "de.ellpeck.actuallyadditions"
archivesBaseName = "ActuallyAdditions-$game_version"
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
}
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
minecraft {
mappings channel: 'parchment', version: "${parchment_version}-${game_version}"
// 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("minecraft.api.auth.host", "https://0.0.0.0")
property("minecraft.api.account.host", "https://0.0.0.0")
property("minecraft.api.session.host", "https://0.0.0.0")
property("minecraft.api.services.host", "https://0.0.0.0")
mods {
actuallyadditions {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
mods {
actuallyadditions {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
args '--mod', 'actuallyadditions', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
actuallyadditions {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
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}")
runtimeOnly fg.deobf("curse.maven:TOP-245211:3319255")
runtimeOnly fg.deobf("curse.maven:MEK-268560:3590099")
}
// 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" : "Actually Additions",
"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")
}
}
}