Skip to content

Commit

Permalink
refactor!: rebrand as TheConfigLib
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Shatunov <[email protected]>
  • Loading branch information
Prototik committed Dec 26, 2023
1 parent 450dbad commit 88c75db
Show file tree
Hide file tree
Showing 342 changed files with 3,639 additions and 3,696 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --no-daemon
- uses: actions/upload-artifact@v3
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew releaseMod --no-daemon
env:
XANDER_MAVEN_USER: ${{ secrets.REPO_USERNAME }}
XANDER_MAVEN_PASS: ${{ secrets.REPO_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
8 changes: 3 additions & 5 deletions .github/workflows/snapshot-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew publishAllPublicationsToSnapshotsRepository --no-daemon
run: ./gradlew publish --no-daemon
env:
XANDER_MAVEN_USER: ${{ secrets.REPO_USERNAME }}
XANDER_MAVEN_PASS: ${{ secrets.REPO_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
run
build
/.idea
/.idea/*
!/.idea/icon.png
.gradle
!.gitkeep
/.architectury-transformer
Binary file added .idea/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 7 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,23 @@
<center><div align="center">

![](https://raw.githubusercontent.com/isXander/YetAnotherConfigLib/1.19/src/main/resources/yacl-128x.png)

# YetAnotherConfigLib
# TheConfigLib

![Enviroment](https://img.shields.io/badge/Enviroment-Client-purple)
[![Java 17](https://img.shields.io/badge/Language-Java%2017-9B599A.svg?color=orange)](https://www.oracle.com/news/announcement/oracle-releases-java-17-2021-09-14)
[![Discord](https://img.shields.io/discord/780023008668287017?color=blue&logo=discord&label=Discord)](https://short.isxander.dev/discord)

[![Modrinth](https://img.shields.io/modrinth/dt/1eAoo2KR?color=00AF5C&label=downloads&logo=modrinth)](https://modrinth.com/mod/yacl)
[![CurseForge](https://cf.way2muchnoise.eu/full_667299_downloads.svg)](https://curseforge.com/minecraft/mc-mods/yacl)

[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/isxander)
[//]: # ([![Modrinth]&#40;https://img.shields.io/modrinth/dt/1eAoo2KR?color=00AF5C&label=downloads&logo=modrinth&#41;]&#40;https://modrinth.com/mod/yacl&#41;)
[//]: # ([![CurseForge]&#40;https://img.shields.io/curseforge/dt/667299?logo=curseforge&color=E04E14&#41;]&#40;https://curseforge.com/minecraft/mc-mods/yacl&#41;)

Yet Another Config Lib, like, what were you expecting?

[![](https://www.bisecthosting.com/partners/custom-banners/08bbd3ff-5c0d-4480-8738-de0f070a04dd.png)](https://bisecthosting.com/xander)
The Config Lib, one and only config library for your mods!

</div></center>

## Why does this mod even exist?

This mod was made to fill a hole in this area of Fabric modding. The existing main config libraries don't achieve what I want from them:

- **[Cloth Config API](https://modrinth.com/mod/cloth-config)**:<br/>**It's stale.** The developer of cloth has clarified that they are likely not going to add any more features. They don't want to touch it. ([citation](https://user-images.githubusercontent.com/43245524/206530322-3ae46008-5356-468e-9a73-63b859364d4e.png))
- **[SpruceUI](https://github.com/LambdAurora/SpruceUI)**:<br/>**It isn't designed for configuration.** In this essence the design feels cluttered. Further details available in [this issue](https://github.com/isXander/Zoomify/issues/85).
- **[MidnightLib](https://modrinth.com/mod/midnightlib)**:<br/>**It has cosmetics among other utilities.** It may not be large but some players (including me) wouldn't want cosmetics out of nowhere.
- **[OwoLib](https://modrinth.com/mod/owo-lib)**:<br/>**It's content focused.** It does a lot of other things as well as config, adding to the size.

As you can see, there's sadly a drawback with all of them and this is where YetAnotherConfigLib comes in.
## Development environment setup

## How is YACL better?
Below described artifacts provide in this maven repository:

YACL has the favour of hindsight. Whilst developing this fresh library, I can make sure that it does everything right:

- **Client sided library.** YACL is built for client mods only, making it a smaller size.
- **Easy API.** YACL takes inspiration from [Sodium's](https://modrinth.com/mod/sodium) internal configuration library.
- **It's styled to fit in Minecraft.** YACL's GUI is designed to fit right in.
### Architectury Loom / Fabric Loom

## Usage

[The wiki](https://github.com/isXander/YetAnotherConfigLib/wiki/Usage) contains a full documentation on how to use YACL.

## Screenshots

<center><div align="center">

![java_A3zdbksGkC](https://user-images.githubusercontent.com/43245524/206924832-293b0780-2a8c-4b09-8765-155318d09ed9.png)

</div></center>

## License

Expand Down
195 changes: 149 additions & 46 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,82 +1,183 @@
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.eclipse.jgit.internal.storage.file.FileRepository

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.eclipse.jgit:org.eclipse.jgit:6.8.0.202311291450-r")
}
}

plugins {
base
alias(libs.plugins.architectury.plugin)
alias(libs.plugins.architectury.loom) apply false

alias(libs.plugins.minotaur) apply false
alias(libs.plugins.cursegradle) apply false
alias(libs.plugins.github.release)
alias(libs.plugins.grgit)
}

architectury {
minecraft = libs.versions.minecraft.get()
}

version = "3.3.1+1.20.4"
val branch: Provider<String> = provider {
FileRepository(layout.projectDirectory.asFile).branch
}

val isBeta = "beta" in version.toString()
val changelogText = rootProject.file("changelogs/${project.version}.md").takeIf { it.exists() }?.readText() ?: "No changelog provided."
val snapshotVer = "${grgit.branch.current().name.replace('/', '.')}-SNAPSHOT"

allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "architectury-plugin")
base {
archivesName = "the-config-lib"
}

version = rootProject.version
group = "dev.isxander"
if ("GITHUB_ACTIONS" in System.getenv().keys) {
version = "$version-SNAPSHOT"
}

if (System.getenv().containsKey("GITHUB_ACTIONS")) {
version = "$version+$snapshotVer"
}
subprojects {
version = rootProject.version

pluginManager.withPlugin("base") {
val base = the<BasePluginExtension>()

base.archivesName.set("yet-another-config-lib-${project.name}")
base.archivesName.convention(rootProject.base.archivesName)
}

ext["changelogText"] = changelogText
ext["isBeta"] = isBeta

repositories {
mavenCentral()
maven("https://maven.isxander.dev/releases")
maven("https://maven.isxander.dev/snapshots")
maven("https://maven.quiltmc.org/repository/release")
maven("https://maven.neoforged.net/releases")
maven("https://maven.parchmentmc.org")
maven("https://api.modrinth.com/maven") {
name = "Modrinth"
content {
maven("https://maven.aur.rocks/releases") {
name = "kkIncReleases"
mavenContent {
releasesOnly()
}
}
maven("https://maven.aur.rocks/snapshots") {
name = "kkIncSnapshots"
mavenContent {
snapshotsOnly()
}
}
mavenCentral {
mavenContent {
excludeGroup("com.twelvemonkeys")
excludeGroup("com.twelvemonkeys.common")
excludeGroup("com.twelvemonkeys.imageio")
}
}
maven("https://maven.neoforged.net/releases") {
name = "NeoForged"
}
exclusiveContent {
forRepository {
maven("https://api.modrinth.com/maven") {
name = "Modrinth"
}
}
filter {
includeGroup("maven.modrinth")
}
}
exclusiveContent {
forRepository {
maven("https://maven.parchmentmc.org") {
name = "ParchmentMC"
}
}
filter {
includeGroupByRegex("^org.parchmentmc(\\..+)?$")
}
}
}

pluginManager.withPlugin("publishing") {
val publishing = the<PublishingExtension>()
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "architectury-plugin")

pluginManager.withPlugin("org.gradle.java-base") {
val java: JavaPluginExtension by extensions

java.apply {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release = 17
}
}

pluginManager.withPlugin("dev.architectury.loom") {
val loom: LoomGradleExtensionAPI by extensions

loom.apply {
silentMojangMappingsLicense()
}

dependencies {
"minecraft"(libs.minecraft)
"mappings"(loom.layered {
officialMojangMappings()
parchment(libs.parchment)
})
}
}

pluginManager.withPlugin("org.gradle.publishing") {
val publishing: PublishingExtension by extensions

publishing.repositories {
val username = "XANDER_MAVEN_USER".let { System.getenv(it) ?: findProperty(it) }?.toString()
val password = "XANDER_MAVEN_PASS".let { System.getenv(it) ?: findProperty(it) }?.toString()
val username = "MAVEN_USER".let { System.getenv(it) ?: findProperty(it) }?.toString()
val password = "MAVEN_PASS".let { System.getenv(it) ?: findProperty(it) }?.toString()
if (username != null && password != null) {
maven(url = "https://maven.isxander.dev/releases") {
name = "Releases"
maven("https://maven.aur.rocks/releases") {
name = "kkIncReleases"
mavenContent {
releasesOnly()
}
credentials {
this.username = username
this.password = password
}
}
maven(url = "https://maven.isxander.dev/snapshots") {
name = "Snapshots"
maven("https://maven.aur.rocks/snapshots") {
name = "kkIncSnapshots"
mavenContent {
snapshotsOnly()
}
credentials {
this.username = username
this.password = password
}
}
} else {
println("Xander Maven credentials not satisfied.")
}
}

publishing.publications.withType<MavenPublication>().configureEach {
pom {
description.convention(provider { project.description })

licenses {
license {
name.set("GNU Lesser General Public License")
url.set("https://www.gnu.org/licenses/lgpl-3.0.html")
distribution.set("repo")
}
}

developers {
developer {
id.set("Prototik")
name.set("Sergey Shatunov")
email.set("[email protected]")
}
}
}
}
}
Expand All @@ -87,17 +188,18 @@ githubRelease {

val githubProject: String by rootProject
val split = githubProject.split("/")
owner(split[0])
repo(split[1])
tagName("${project.version}")
targetCommitish(grgit.branch.current().name)
body(changelogText)
prerelease(isBeta)
owner = split[0]
repo = split[1]
tagName = project.version.toString()
targetCommitish = branch
body = changelogText
prerelease = isBeta
releaseAssets(
{ findProject(":fabric")?.tasks?.get("remapJar")?.outputs?.files },
{ findProject(":fabric")?.tasks?.get("remapSourcesJar")?.outputs?.files },
{ findProject(":forge")?.tasks?.get("remapJar")?.outputs?.files },
{ findProject(":forge")?.tasks?.get("remapSourcesJar")?.outputs?.files },
listOf(":fabric", ":forge", ":neoforge").mapNotNull { findProject(it) }.flatMap { project ->
listOf("remapJar", "remapSourcesJar").map { taskName ->
{ project.tasks[taskName].outputs.files }
}
}
)
}

Expand All @@ -110,6 +212,7 @@ tasks.register("releaseMod") {
tasks.register("buildAll") {
group = "mod"

findProject(":fabric")?.let { dependsOn(it.tasks["build"]) }
findProject(":forge")?.let { dependsOn(it.tasks["build"]) }
listOf(":fabric", ":forge", ":neoforge").mapNotNull { findProject(it) }.forEach { project ->
dependsOn(project.tasks["build"])
}
}
6 changes: 6 additions & 0 deletions changelogs/4.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TheConfigLib v4.0.0 for 1.20.4

- Bring back MinecraftForge support
- Migrate to `dev.tcl` package
- Removed deprecated APIs
- Fix crash on production neoforge
Loading

0 comments on commit 88c75db

Please sign in to comment.