Skip to content

Commit

Permalink
✨ Started porting to XinexLib instead of Architectury API.
Browse files Browse the repository at this point in the history
  • Loading branch information
XyperCode committed Dec 12, 2024
1 parent b4da684 commit b6773ac
Show file tree
Hide file tree
Showing 184 changed files with 1,069 additions and 2,798 deletions.
149 changes: 13 additions & 136 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,145 +1,22 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "org.jetbrains.kotlin.jvm" version "1.7.10"
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
// see https://fabricmc.net/develop/ for new versions
id 'fabric-loom' version '1.7-SNAPSHOT' apply false
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
id 'net.neoforged.moddev' version '0.1.110' apply false
}
repositories {
gradlePluginPortal()
}

architectury {
minecraft = minecraft_version
}

version mod_version

Object getIngameVersion() {
return mod_version
}

Object getModDescription() {
return mod_description
}

subprojects {
apply plugin: "dev.architectury.loom"

loom {
silentMojangMappingsLicense()
}

repositories {
mavenCentral()

maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}

maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}

maven {
name = 'BlameJared Maven (CrT / Bookshelf)'
url = 'https://maven.blamejared.com'
}
maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org'
}

maven {
name 'Quilt (Release)'
url 'https://maven.quiltmc.org/repository/release/'
}

maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
mkdir file("build/tmp/javadoc/collect")
mkdir file("build/docs/javadoc")

maven {
url "https://jitpack.io"
content {
includeGroup "com.github.Nuix"
}
}
evaluationDependsOn(":common")

maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven { url "https://maven.architectury.dev/" }
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.21.1:2024.11.17@zip")
}

implementation 'com.github.Nuix:jnode-fs:v1.0.1'

// layered
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:@YARN_MAPPINGS@:v2"
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

archivesBaseName = rootProject.archives_base_name
version = rootProject.version
group = rootProject.maven_group
tasks.register("javadoc", Copy) {
dependsOn "common:javadoc"

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://maven.parchmentmc.org" }
maven { url "https://maven.jab125.dev" }
flatDir { dir "$rootProject.projectDir/libs/" }
doFirst {
mkdir file("build/docs/javadoc")
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}

java {
withSourcesJar()
}

gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "9999"
}
}
}

void setupRepositories(RepositoryHandler repositories) {
//repositories.mavenLocal() // uncomment for testing
def ENV = System.getenv()
if (ENV.MAVEN_URL) {
repositories.maven {
url ENV.MAVEN_URL
credentials {
username ENV.MAVEN_USERNAME
password ENV.MAVEN_PASSWORD
}
}
}
from(project(":common").javadoc.outputs)
into(file("build/docs/javadoc"))
}
4 changes: 4 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id 'groovy-gradle-plugin'
}

144 changes: 144 additions & 0 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
plugins {
id 'java-library'
id 'maven-publish'
}

base {
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
withSourcesJar()
withJavadocJar()
}

repositories {
flatDir {
dir rootProject.file("libs")
}
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net'
}
maven {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
filter { includeGroupAndSubgroups('org.spongepowered') }
}
exclusiveContent {
forRepositories(maven {
name = 'ParchmentMC'
url = 'https://maven.parchmentmc.org/'
},
maven {
name = "NeoForge"
url = 'https://maven.neoforged.net/releases'
})
filter { includeGroup('org.parchmentmc.data') }
}
maven {
name = 'BlameJared'
url = 'https://maven.blamejared.com'
}
maven {
name = 'Modrinth'
url = 'https://api.modrinth.com/maven'
}
maven {
name = "Ladysnake Mods"
url = 'https://maven.ladysnake.org/releases'
}
maven {
name = "Fuzs Mod Resources"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
name = "Jitpack"
url = 'https://jitpack.io'
}
mavenCentral()
}

// Declare capabilities on the outgoing configurations.
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant ->
configurations."$variant".outgoing {
capability("$group:${base.archivesName.get()}:$version")
capability("$group:$mod_id-${project.name}-${minecraft_version}:$version")
capability("$group:$mod_id:$version")
}
publishing.publications.configureEach {
suppressPomMetadataWarningsFor(variant)
}
}

sourcesJar {
from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" }
}
}

jar {
from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" }
}

manifest {
attributes(['Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version': project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Built-On-Minecraft' : minecraft_version])
}
}

processResources {
var expandProps = ['version' : version,
'group' : project.group, //Else we target the task's group.
'minecraft_version' : minecraft_version,
'minecraft_version_range' : minecraft_version_range,
'fabric_version' : fabric_version,
'fabric_loader_version' : fabric_loader_version,
'mod_name' : mod_name,
'mod_author' : mod_author,
'mod_id' : mod_id,
'license' : license,
'description' : project.description,
'neoforge_version' : neoforge_version,
'neoforge_loader_version_range': neoforge_loader_version_range,
"forge_version" : forge_version,
"forge_loader_version_range" : forge_loader_version_range,
'credits' : credits,
'java_version' : java_version]

filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) {
expand expandProps
}
inputs.properties(expandProps)
}

publishing {
publications {
register('mavenJava', MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url System.getenv('local_maven_url')
}
}
}
44 changes: 44 additions & 0 deletions buildSrc/src/main/groovy/multiloader-loader.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id 'multiloader-common'
}

configurations {
commonJava {
canBeResolved = true
}
commonResources {
canBeResolved = true
}
}

dependencies {
compileOnly(project(':common')) {
capabilities {
requireCapability "$group:$mod_id"
}
}
commonJava project(path: ':common', configuration: 'commonJava')
commonResources project(path: ':common', configuration: 'commonResources')
}

tasks.named('compileJava', JavaCompile) {
dependsOn(configurations.commonJava)
source(configurations.commonJava)
}

processResources {
dependsOn(configurations.commonResources)
from(configurations.commonResources)
}

tasks.named('javadoc', Javadoc).configure {
dependsOn(configurations.commonJava)
source(configurations.commonJava)
}

tasks.named('sourcesJar', Jar) {
dependsOn(configurations.commonJava)
from(configurations.commonJava)
dependsOn(configurations.commonResources)
from(configurations.commonResources)
}
Loading

0 comments on commit b6773ac

Please sign in to comment.