Skip to content

Commit

Permalink
Remap back to loom
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiancc committed May 28, 2024
1 parent 8665a94 commit 9a6c8dd
Show file tree
Hide file tree
Showing 33 changed files with 772 additions and 540 deletions.
73 changes: 46 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
}

architectury {
minecraft = rootProject.minecraft_version
minecraft = project.minecraft_version
}

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

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:@YARN_MAPPINGS@:v2"
}
allprojects {
group = rootProject.maven_group
version = rootProject.mod_version
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
subprojects {
apply plugin: 'dev.architectury.loom'
apply plugin: 'architectury-plugin'
apply plugin: 'maven-publish'

archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
group = rootProject.maven_group
base {
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
archivesName = "$rootProject.archives_name-$project.name"
}

repositories {
// Add repositories to retrieve artifacts from in here.
Expand All @@ -40,12 +31,40 @@ allprojects {
// for more information about repositories.
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release.set(21)
dependencies {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings "net.fabricmc:yarn:$rootProject.yarn_mappings:v2"
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

// Configure Maven publishing.
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = base.archivesName.get()
from components.java
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
24 changes: 7 additions & 17 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
architectury {
common(rootProject.enabled_platforms.split(","))
common rootProject.enabled_platforms.split(',')
}

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archives_base_name
from components.java
}
}
// We depend on Fabric Loader here to use the Fabric @Environment annotations,
// which get remapped to the correct annotations on each platform.
// Do NOT use other classes from Fabric Loader.
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
// Architectury API. This is optional, and you can comment it out if you don't need it.
modImplementation "dev.architectury:architectury:$rootProject.architectury_api_version"
}
Loading

0 comments on commit 9a6c8dd

Please sign in to comment.