Skip to content

Commit

Permalink
Just going to throw this on a branch so i have easy access to it
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Jan 2, 2024
1 parent cb5f95a commit eb77064
Show file tree
Hide file tree
Showing 114 changed files with 6,011 additions and 167 deletions.
253 changes: 101 additions & 152 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,181 +1,130 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
// id 'io.github.juuxel.loom-vineflower' version '1.11.0'
id 'maven-publish'
id 'me.fallenbreath.yamlang' version '1.2.1'
id 'dev.architectury.loom' version '1.2-SNAPSHOT' apply(false)
id 'me.fallenbreath.yamlang' version '1.2.1' apply(false)
}

version = project.mod_version
group = project.maven_group
version = "${mod_version}+${minecraft_version}";

loom {
accessWidenerPath = file("src/main/resources/do-a-barrel-roll.accesswidener")
subprojects {
apply plugin: 'java'
apply plugin: 'me.fallenbreath.yamlang'

splitEnvironmentSourceSets()

mods {
"do_a_barrel_roll" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}

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.

// Personal maven for cicada and backup mirrors of some dependencies.
maven { url = "https://maven.enjarai.dev/mirrors" }
maven { url = "https://maven.enjarai.dev/releases" }

maven {
url = "https://www.cursemaven.com"
allowInsecureProtocol = true
}

// Mod Menu.
maven { url 'https://maven.terraformersmc.com' }
repositories {
// Personal maven for cicada and backup mirrors of some dependencies.
maven { url "https://maven.enjarai.dev/mirrors" }
maven { url "https://maven.enjarai.dev/releases" }

// MidnightControls.
maven { url = "https://aperlambda.github.io/maven" }
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
// Mod Menu.
maven { url 'https://maven.terraformersmc.com' }

// Cloth Config.
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
// Cloth Config.
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }

// Jitpack for Mixin Extras.
maven {
url 'https://jitpack.io'
content {
includeGroup 'com.github.llamalad7'
// Jitpack for Mixin Extras.
maven {
url 'https://jitpack.io'
content {
includeGroup 'com.github.llamalad7'
}
}
}

// YACL/Controlify
maven { url = "https://maven.isxander.dev/releases" }
maven { url = "https://maven.quiltmc.org/repository/release/" }

// Mod Menu
maven { url "https://maven.terraformersmc.com/releases" }

// Permissions API
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// YACL/Controlify
maven { url "https://maven.isxander.dev/releases" }
maven { url "https://maven.quiltmc.org/repository/release/" }

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Mod Menu
maven { url "https://maven.terraformersmc.com/releases" }

include modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
exclude group: "net.fabricmc.fabric-api"
// Permissions API
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

modImplementation("dev.isxander.yacl:yet-another-config-lib-fabric:${project.yacl_version}") {
exclude group: "net.fabricmc"
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
withSourcesJar()
withJavadocJar()
}

modCompileOnly("dev.isxander:controlify:${project.controlify_version}") {
exclude group: "net.fabricmc"
exclude group: "maven.modrinth"
exclude group: "com.github.CaffeineMC"
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,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version
])
}
}

// Mod Menu integration.
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

// Mixin Extras for extra compatibility.
implementation("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")
annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")
clientAnnotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:${project.mixin_extras_version}")

include(implementation("com.github.bawnorton.mixinsquared:mixinsquared-fabric:${project.mixin_squared_version}"))
annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:${project.mixin_squared_version}")
clientAnnotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:${project.mixin_squared_version}")

include(modImplementation("me.lucko:fabric-permissions-api:${project.permissions_api_version}"))
}

base {
archivesName = project.archives_base_name
}

version = "${rootProject.mod_version}+${rootProject.minecraft_version}-fabric"

processResources {
inputs.property "version", "${rootProject.mod_version}+${rootProject.minecraft_version}"

filesMatching("fabric.mod.json") {
expand "version": "${rootProject.mod_version}+${rootProject.minecraft_version}"
sourcesJar {
from(rootProject.file("LICENSE")) {
rename { "${it}_${mod_name}" }
}
}
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

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
}

jar {
from("LICENSE") {
rename { "${it}_${base.archivesName.get()}"}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.getRelease().set(17)
}
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
}
plugins.withId('dev.architectury.loom') {
loom {
accessWidenerPath = project(":common").file("src/main/resources/${mod_id}.accesswidener")
}
}

// configure the maven publication
publishing {
repositories {
maven {
name = "enjaraiMaven"
url = "https://maven.enjarai.nl/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
processResources {
var replaceProperties = [
minecraft_version : minecraft_version,

forge_minecraft_version_range : forge_minecraft_version_range,
forge_version : forge_version,
forge_version_range : forge_version_range,
loader_version_range : loader_version_range,

fabric_minecraft_version_range: fabric_minecraft_version_range,

fabric_version : fabric_version,
fabric_loader_version : fabric_loader_version,
forge_fabric_version : forge_fabric_version,
forge_fabric_loader_version : forge_fabric_loader_version,

mod_id : mod_id,
mod_name : mod_name,
mod_version : version, // findProperty('mod_version') ?: project.jar.archiveVersion,
mod_license : mod_license,
mod_author : mod_author,
mod_credits : mod_credits,
mod_description : mod_description,
mod_url : mod_url,
mod_sources_url : mod_sources_url,
mod_issue_tracker_url : mod_issue_tracker_url,
]
inputs.properties replaceProperties
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) {
expand replaceProperties
}
}

publications {
mavenJava(MavenPublication) {
groupId = project.maven_group
artifactId = archivesBaseName
version = project.version

from components.java
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
}

yamlang {
targetSourceSets = [sourceSets.main]
inputDir = 'assets/do_a_barrel_roll/lang'
yamlang {
targetSourceSets = [sourceSets.main]
inputDir = "assets/${mod_id}/lang"
}
}
49 changes: 49 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
id 'java'
id 'idea'
id 'maven-publish'
id 'dev.architectury.loom'
}

base {
archivesName = "${mod_name}-common-${minecraft_version}"
}

loom {
splitEnvironmentSourceSets()

mods {
"do_a_barrel_roll" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
}

dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings "net.fabricmc:yarn:${yarn_version}:v2"

modCompileOnly "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
modCompileOnly "net.fabricmc:fabric-loader:${fabric_loader_version}"

modImplementation("dev.isxander.yacl:yet-another-config-lib-common:${project.yacl_version}") {
exclude group: "net.fabricmc"
}

implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:${project.mixin_squared_version}"))
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
Loading

0 comments on commit eb77064

Please sign in to comment.