Skip to content

Commit

Permalink
More work on 1.20.5 port
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Apr 24, 2024
1 parent 5242f17 commit a293c4d
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 72 deletions.
34 changes: 34 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
id 'signing'
id 'java-library'
alias libs.plugins.managedversioning
alias libs.plugins.modsdotgroovy
}

managedVersioning {
Expand Down Expand Up @@ -123,6 +124,39 @@ managedVersioning.apply()

println "Building: $version"

modsDotGroovy {
multiplatform.expose()
gather {
projectProperty('mod_id')
projectProperty('mod_name')
projectProperty('description')
}
}

import org.groovymc.modsdotgroovy.core.Platform

sourceSets.neoforge.modsDotGroovy {
platform = Platform.NEOFORGE
inferGather.set false
multiplatform.from(':', 'main')
gather {
minecraftVersion = libs.versions.minecraft.get()
platformVersion = libs.versions.neoforge.get()
}
enable()
}

sourceSets.fabric.modsDotGroovy {
platform = Platform.FABRIC
inferGather.set false
multiplatform.from(':', 'main')
gather {
minecraftVersion = libs.versions.minecraft.get()
platformVersion = libs.versions.fabric.loader.get()
}
enable()
}

dependencies {
compileOnly cLibs.bundles.compileonly
annotationProcessor cLibs.bundles.annotationprocessor
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ group=dev.lukebemish.dynamicassetgenerator
mod_name=Dynamic Asset Generator
mod_author=Luke Bemish
mod_id=dynamic_asset_generator

description=A tool for dynamically generating textures and other resources at runtime
# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
Expand Down
5 changes: 2 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ fabric_api = "0.97.6+1.20.5"

fabric_mixin = "0.13.3+mixin.0.8.5"

mdg_plugin = "1.4.3"
mdg_dsl = "1.5.1"
modsdotgroovy = "2.0.0-beta.22"

minotaur = "2.8.7"

Expand All @@ -35,6 +34,6 @@ owolib = { module = "io.wispforest:owo-lib", version.ref = "owolib" }
[plugins]

managedversioning = { id = "dev.lukebemish.managedversioning", version.ref = "managedversioning" }
mdg_plugin = { id = "org.groovymc.modsdotgroovy", version.ref = "mdg_plugin" }
modsdotgroovy = { id = "org.groovymc.modsdotgroovy", version.ref = "modsdotgroovy" }
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }
curseforgegradle = {id = "net.darkhax.curseforgegradle", version = "1.1.18"}
25 changes: 5 additions & 20 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ pluginManagement {
url "https://maven.architectury.dev/"
}

maven {
name = "Luke's Maven"
url = 'https://maven.lukebemish.dev/snapshots/'
}
// TODO: remove
mavenLocal()

mavenCentral()
gradlePluginPortal()
Expand All @@ -33,13 +31,13 @@ pluginManagement {

plugins {
id 'dev.lukebemish.conventions' version '0.1.9'
id 'dev.lukebemish.multisource' version '0.1.1-SNAPSHOT'
id 'dev.lukebemish.multisource' version '0.1.2-dirty'
}

rootProject.name = 'dynamicassetgenerator'

multisource.of(':') {
common('main', []) {
configureEach {
minecraft.add project.libs.minecraft
mappings.add loom.layered() {
officialMojangMappings()
Expand All @@ -48,24 +46,11 @@ multisource.of(':') {
})
}
}
common('main', []) {}
fabric('fabric', ['main']) {
minecraft.add project.libs.minecraft
mappings.add loom.layered() {
officialMojangMappings()
parchment(project.dependencies.variantOf(project.libs.parchment) {
artifactType('zip')
})
}
loader.add project.libs.fabric.loader
}
neoforge('neoforge', ['main']) {
minecraft.add project.libs.minecraft
mappings.add loom.layered() {
officialMojangMappings()
parchment(project.dependencies.variantOf(project.libs.parchment) {
artifactType('zip')
})
}
neoForge.add project.libs.neoforge
}
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "dev.lukebemish.dynamicassetgenerator.impl.fabriquilt.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"BuiltInPackSourceMixin"
],
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/mixin.dynamic_asset_generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "dev.lukebemish.dynamicassetgenerator.impl.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"PackRepositoryMixin",
"MultiPackResourceManagerMixin",
Expand Down
73 changes: 27 additions & 46 deletions src/main/resources/mods.groovy
Original file line number Diff line number Diff line change
@@ -1,71 +1,52 @@
import modsdotgroovy.Dependency

ModsDotGroovy.make {
MultiplatformModsDotGroovy.make {
modLoader = 'javafml'
loaderVersion = '[1,)'

license = 'LGPL-3.0-or-later'
issueTrackerUrl = 'https://github.com/lukebemishprojects/DynamicAssetGenerator/issues'

mod {
modId = this.buildProperties['mod_id']
displayName = this.buildProperties['mod_name']
version = this.version
modId = buildProperties.mod_id
displayName = buildProperties.mod_name
version = environmentInfo.version
displayUrl = 'https://github.com/lukebemishprojects/DynamicAssetGenerator'
contact {
sources = 'https://github.com/lukebemishprojects/DynamicAssetGenerator'
}
author = 'Luke Bemish'
description = buildProperties.description

description = 'A tool for generating asset and data resources at runtime from existing resources.'
authors = [this.buildProperties['mod_author'] as String]
entrypoints {
client = 'dev.lukebemish.dynamicassetgenerator.impl.fabriquilt.fabric.DynamicAssetGeneratorClientFabric'
main = 'dev.lukebemish.dynamicassetgenerator.impl.fabriquilt.fabric.DynamicAssetGeneratorFabric'
}

dependencies {
mod 'minecraft', {
def minor = this.libs.versions.minecraft.split(/\./)[1] as int
versionRange = "[${this.libs.versions.minecraft},1.${minor+1}.0)"
versionRange = ">=${libs.versions.minecraft}"
}

onForge {
neoforge = ">=${this.libs.versions.neoforge}"
onNeoForge {
neoforge = ">=${libs.versions.neoforge}"
}

onFabric {
mod 'fabricloader', {
versionRange = ">=${this.libs.versions.fabric.loader}"
versionRange = ">=${libs.versions.fabric_loader}"
}
mod 'fabric-api', {
versionRange = ">=${this.libs.versions.fabric.api.split(/\+/)[0]}"
}
}
}

onForge {
dependencies = dependencies.collect { dep ->
new Dependency() {
@Override
Map asForgeMap() {
def map = dep.asForgeMap()
map.remove('mandatory')
map.put('type', this.mandatory ? 'required' : 'optional')
return map
}
}
versionRange = ">=${libs.versions.fabric_api.split(/\+/)[0]}"
}
}

entrypoints {
onFabric {
entrypoint 'client', ['dev.lukebemish.dynamicassetgenerator.impl.fabriquilt.fabric.DynamicAssetGeneratorClientFabric']
entrypoint 'main', ['dev.lukebemish.dynamicassetgenerator.impl.fabriquilt.fabric.DynamicAssetGeneratorFabric']
}
}
}

onFabric {
mixin = [
'mixin.dynamic_asset_generator.json',
'mixin.dynamic_asset_generator_fabriquilt.json'
]
mixins {
mixin 'mixin.dynamic_asset_generator.json'
mixin 'mixin.dynamic_asset_generator_fabriquilt.json'
}
}
onForge {
mixins = [
['config':'mixin.dynamic_asset_generator.json']
]
onNeoForge {
mixins {
mixin 'mixin.dynamic_asset_generator.json'
}
}
}

0 comments on commit a293c4d

Please sign in to comment.