ActuallyAdditions/build.gradle

176 lines
4.6 KiB
Groovy
Raw Normal View History

2024-03-03 01:20:53 +01:00
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
2014-11-07 14:19:05 +01:00
}
2016-05-19 20:05:12 +02:00
2021-02-26 22:15:48 +01:00
version = "$mod_version"
2015-12-30 22:02:15 +01:00
group = "de.ellpeck.actuallyadditions"
2024-03-03 01:20:53 +01:00
base {
archivesName = "ActuallyAdditions-$game_version"
}
2014-11-07 14:19:05 +01:00
2020-11-07 14:38:30 +01:00
if (System.getenv('BUILD_NUMBER') != null) {
version += "." + System.getenv('BUILD_NUMBER')
2016-07-31 16:30:37 +02:00
}
2024-03-02 21:23:08 +01:00
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
2021-02-26 22:15:48 +01:00
2014-11-07 14:19:05 +01:00
minecraft {
2021-08-22 23:19:57 +02:00
mappings channel: 'parchment', version: "${parchment_version}-${game_version}"
2021-02-26 22:15:48 +01:00
// 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")
2021-02-26 22:15:48 +01:00
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/')
2021-02-26 22:15:48 +01:00
mods {
actuallyadditions {
source sourceSets.main
}
}
}
}
2014-11-07 14:19:05 +01:00
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
2015-04-26 20:07:57 +02:00
repositories {
2016-01-16 20:06:25 +01:00
maven {
2024-03-03 01:20:53 +01:00
url = "https://maven.blamejared.com"
2020-11-20 18:55:16 +01:00
}
maven {
2021-02-26 22:15:48 +01:00
url = "https://www.cursemaven.com"
}
2015-04-26 20:07:57 +02:00
}
dependencies {
2021-02-26 22:15:48 +01:00
minecraft "net.minecraftforge:forge:${game_version}-${forge_version}"
2024-03-03 01:20:53 +01:00
compileOnly fg.deobf("mezz.jei:jei-${game_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${game_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${game_version}-forge:${jei_version}")
2024-03-03 01:20:53 +01:00
runtimeOnly fg.deobf("curse.maven:the-one-probe-245211:4629624")
runtimeOnly fg.deobf("curse.maven:mekanism-268560:5125665")
2014-11-07 14:19:05 +01:00
}
2021-02-26 22:15:48 +01:00
// not sure if this is still needed
2021-11-21 21:34:08 +01:00
//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'
// }
//}
2015-01-05 22:50:20 +01:00
2020-11-20 18:55:16 +01:00
jar {
2021-02-26 22:15:48 +01:00
group = 'artifact'
manifest {
attributes(["Specification-Title" : "Actually Additions",
2021-02-26 22:15:48 +01:00
"Specification-Version" : "1",
"Implementation-Title" : project.archivesBaseName,
"Implementation-Version" : project.version,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
}
2020-11-20 18:55:16 +01:00
2021-02-26 22:15:48 +01:00
from sourceSets.main.output
2020-11-20 18:55:16 +01:00
}
2016-05-19 20:05:12 +02:00
task deobfJar(type: Jar) {
2020-11-20 18:46:34 +01:00
from sourceSets.main.output
from sourceSets.main.java
2024-03-03 01:20:53 +01:00
archiveClassifier.set('dev')
}
task apiJar(type: Jar) {
2020-11-20 18:46:34 +01:00
from sourceSets.main.output
from sourceSets.main.java
2024-03-03 01:20:53 +01:00
archiveClassifier.set('api')
2020-11-20 18:46:34 +01:00
include 'de/ellpeck/actuallyadditions/api/**'
2016-07-31 16:30:37 +02:00
}
javadoc {
include 'de/ellpeck/actuallyadditions/api/**'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
2024-03-03 01:20:53 +01:00
archiveClassifier.set('javadoc')
2016-07-31 16:30:37 +02:00
}
2020-11-20 18:46:34 +01:00
task sourcesJar(type: Jar) {
from sourceSets.main.java
2024-03-03 01:20:53 +01:00
archiveClassifier.set('sources')
2020-11-20 18:46:34 +01:00
}
2020-11-21 19:08:07 +01:00
artifacts {
archives deobfJar, sourcesJar, apiJar, javadocJar
}
2016-07-31 16:30:37 +02:00
publishing {
2020-11-21 19:08:07 +01:00
tasks.publish.dependsOn build
2016-07-31 16:30:37 +02:00
publications {
mavenJava(MavenPublication) {
2020-11-21 19:08:07 +01:00
groupId = group
2024-03-03 01:20:53 +01:00
artifactId = base.archivesName.get()
2020-11-21 19:08:07 +01:00
version = version
from components.java
artifact deobfJar
artifact sourcesJar
2020-11-20 19:02:53 +01:00
artifact apiJar
artifact javadocJar
2020-11-21 19:08:07 +01:00
pom.withXml {
def node = asNode()
if (node.dependencies.size() > 0)
node.remove(node.dependencies)
}
2016-07-31 16:30:37 +02:00
}
}
repositories {
maven {
2020-10-07 21:25:00 +02:00
url "file://" + System.getenv("local_maven")
2016-07-31 16:30:37 +02:00
}
}
2021-02-26 22:15:48 +01:00
}
2024-03-03 01:20:53 +01:00
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}