Skip to content

Commit

Permalink
simplify my life
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Sep 8, 2024
1 parent 75642a2 commit ed64f6b
Show file tree
Hide file tree
Showing 179 changed files with 701 additions and 1,631 deletions.
72 changes: 67 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import groovy.json.JsonGenerator
import groovy.json.JsonSlurper
import java.nio.charset.StandardCharsets

plugins {
Expand Down Expand Up @@ -36,11 +38,71 @@ allprojects {
}
}

badasintended()
cursemaven()
modrinth()
mavenLocal()
minecraft()
maven("https://libraries.minecraft.net")
maven("https://maven.bai.lol")
maven("https://server.bbkr.space/artifactory/libs-release")
maven("https://maven.shedaniel.me/")
maven("https://maven.jamieswhiteshirt.com/libs-release")
maven("https://maven.blamejared.com")
maven("https://mod-buildcraft.com/maven")
maven("https://maven.cafeteria.dev/releases")
maven("https://jitpack.io")
maven("https://maven.ladysnake.org/releases")
maven("https://maven.wispforest.io")
maven("https://mvn.devos.one/snapshots")
maven("https://maven.tterrag.com")
maven("https://maven.terraformersmc.com/releases")
maven("https://raw.githubusercontent.com/Fuzss/modresources/main/maven/")

maven("https://repo.spongepowered.org/repository/maven-public") {
content {
includeGroup("org.spongepowered")
}
}

maven("https://cursemaven.com") {
content {
includeGroup("curse.maven")
}
}

maven("https://api.modrinth.com/maven") {
content {
includeGroup("maven.modrinth")
}
}

ivy("https://www.curseforge.com/api/v1/mods") {
patternLayout {
artifact("[module]/files/[revision]/download")
}

metadataSources {
artifact()
}

content {
includeGroup("curse.api")
}
}

maven("https://modmaven.dev")
}

tasks.withType<ProcessResources> {
doLast {
val slurper = JsonSlurper()
val json = JsonGenerator.Options()
.disableUnicodeEscaping()
.build()
fileTree(outputs.files.asPath) {
include("**/*.json")
forEach {
val mini = json.toJson(slurper.parse(it, StandardCharsets.UTF_8.name()))
it.writeText(mini)
}
}
}
}
}

Expand Down
2 changes: 0 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ repositories {
dependencies {
implementation(platform("com.fasterxml.jackson:jackson-bom:2.16.0"))
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.16.0")

implementation("com.squareup:javapoet:1.13.0")
}
15 changes: 15 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ object deps {
const val minecraft = "com.mojang:minecraft:${versions.minecraft}"
const val mixinAp = "org.spongepowered:mixin:0.8.5:processor"

object common : DependencyPath {
override val prefix = "common"

object wthit : DependencyPath {
override val prefix = "common.wthit"

val api by json()
val runtime by json()
}

const val mixin = "org.spongepowered:mixin:0.8.5"
const val asmTree = "org.ow2.asm:asm-tree:9.6"
const val fabricLoaderEnv = "lol.bai:fabric-loader-environment:0.0.1"
}

object fabric : DependencyPath {
override val prefix = "fabric"

Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.fasterxml.jackson.databind.json.JsonMapper
import deps.common
import deps.fabric
import deps.forge
import org.gradle.api.DefaultTask
Expand Down Expand Up @@ -52,6 +53,11 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
action(VersionFetcherDsl(versionFetcher, loader, path))
}

fetcher(ModrinthVersionFetcher, "fabric", common.wthit) {
fetch(common.wthit::api, mrIds.wthit) { "mcp.mobius.waila:wthit-api:${it.version_number.replace("fabric", "mojmap")}" }
fetch(common.wthit::runtime, mrIds.wthit) { "mcp.mobius.waila:wthit:${it.version_number.replace("fabric", "mojmap")}" }
}

fetcher(ModrinthVersionFetcher, "fabric", fabric.wthit) {
fetch(fabric.wthit::api, mrIds.wthit) { "mcp.mobius.waila:wthit-api:${it.version_number}" }
fetch(fabric.wthit::runtime, mrIds.wthit) { "mcp.mobius.waila:wthit:${it.version_number}" }
Expand Down
94 changes: 0 additions & 94 deletions buildSrc/src/main/kotlin/GenFmjTask.kt

This file was deleted.

62 changes: 0 additions & 62 deletions buildSrc/src/main/kotlin/GenFmlEntrypointTask.kt

This file was deleted.

56 changes: 0 additions & 56 deletions buildSrc/src/main/kotlin/GenLanguageTask.kt

This file was deleted.

Loading

0 comments on commit ed64f6b

Please sign in to comment.