Skip to content

Commit

Permalink
Merge branch 'master' into feature/i18n-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Mar 20, 2024
2 parents 849fb3c + 10c424e commit 4c0a270
Show file tree
Hide file tree
Showing 28 changed files with 577 additions and 61 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build & Publish

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
env:
ORG_GRADLE_PROJECT_branch: ${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v1

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: |
8
16
17
# Can't use setup-java for this because https://github.com/actions/setup-java/issues/366
- uses: actions/cache@v3
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
**/loom-cache
key: gradle-caches-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle.properties', 'gradle/*.versions.toml') }}
restore-keys: |
gradle-caches-${{ hashFiles('**/*.gradle*') }}
gradle-caches-
- name: Setup environment
run: |
echo "ORG_GRADLE_PROJECT_BUILD_ID=$(expr ${{ github.run_number }} + 290)" >> "$GITHUB_ENV"
# GitHub runners are limited to 7GB of RAM, so we'll limit our Gradle Daemon process to about half of that
# which is enough so long as parallel task execution is limited.
# We also need to limit the Kotlin Compiler Daemon to its default value (which it seems to be perfectly
# fine with) as otherwise it inherits the Gradle Daemon's jvmargs putting us above the runner limit.
# We also pin the amount of workers, so it doesn't break should GitHub increase the default available vCPUs.
# We write these to GRADLE_USER_HOME to overrule the local "gradle.properties" of the project.
mkdir -p "${GRADLE_USER_HOME:=$HOME/.gradle}"
echo "org.gradle.jvmargs=-Xmx2G -Dkotlin.daemon.jvm.options=-Xmx512M" >> "$GRADLE_USER_HOME/gradle.properties"
echo "org.gradle.workers.max=2" >> "$GRADLE_USER_HOME/gradle.properties"
- name: Build
run: ./gradlew build --stacktrace

- name: Publish
run: ./gradlew publish --stacktrace
if: env.ORG_GRADLE_PROJECT_nexus_user != null
env:
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
ORG_GRADLE_PROJECT_nexus_password: ${{ secrets.NEXUS_PASSWORD }}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,49 +54,49 @@ modImplementation(include("gg.essential:vigilance-$mcVersion-$mcPlatform:$buildN
<td>1.18.1</td>
<td>fabric</td>
<td>
<img alt="1.18.1-fabric" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.18.1-fabric/maven-metadata.xml">
<img alt="1.18.1-fabric" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.18.1-fabric/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.18.1</td>
<td>forge</td>
<td>
<img alt="1.18.1-forge" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.18.1-forge/maven-metadata.xml">
<img alt="1.18.1-forge" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.18.1-forge/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.17.1</td>
<td>fabric</td>
<td>
<img alt="1.17.1-fabric" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.17.1-fabric/maven-metadata.xml">
<img alt="1.17.1-fabric" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.17.1-fabric/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.17.1</td>
<td>forge</td>
<td>
<img alt="1.17.1-forge" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.17.1-forge/maven-metadata.xml">
<img alt="1.17.1-forge" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.17.1-forge/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.16.2</td>
<td>forge</td>
<td>
<img alt="1.16.2-forge" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.16.2-forge/maven-metadata.xml">
<img alt="1.16.2-forge" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.16.2-forge/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.12.2</td>
<td>forge</td>
<td>
<img alt="1.12.2-forge" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.12.2-forge/maven-metadata.xml">
<img alt="1.12.2-forge" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.12.2-forge/maven-metadata.xml">
</td>
</tr>
<tr>
<td>1.8.9</td>
<td>forge</td>
<td>
<img alt="1.8.9-forge" src="https://badges.modcore.net/badge/dynamic/xml?color=A97BFF&label=%20&query=%2Fmetadata%2Fversioning%2Flatest&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.8.9-forge/maven-metadata.xml">
<img alt="1.8.9-forge" src="https://img.shields.io/badge/dynamic/xml?color=A97BFF&label=%20&query=/metadata/versioning/versions/version[not(contains(text(),'%2B'))][last()]&url=https://repo.sk1er.club/repository/maven-releases/gg/essential/vigilance-1.8.9-forge/maven-metadata.xml">
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -183,4 +183,4 @@ tasks.reobfJar { dependsOn(tasks.shadowJar) }
## Examples

For examples of how to use Vigilance, refer to the example package within Vigilance for [annotation style](https://github.com/Sk1erLLC/Vigilance/blob/master/src/main/kotlin/gg/essential/vigilance/example/ExampleConfig.kt)
and [DSL style](https://github.com/Sk1erLLC/Vigilance/blob/master/src/main/kotlin/gg/essential/vigilance/example/ExampleConfigDSL.kt)
and [DSL style](https://github.com/Sk1erLLC/Vigilance/blob/master/src/main/kotlin/gg/essential/vigilance/example/ExampleConfigDSL.kt)
16 changes: 16 additions & 0 deletions api/Vigilance.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ public abstract class gg/essential/vigilance/Vigilant {
public fun <init> (Ljava/io/File;Ljava/lang/String;Lgg/essential/vigilance/data/PropertyCollector;Lgg/essential/vigilance/data/SortingBehavior;Lgg/essential/vigilance/i18n/I18nProvider;)V
public synthetic fun <init> (Ljava/io/File;Ljava/lang/String;Lgg/essential/vigilance/data/PropertyCollector;Lgg/essential/vigilance/data/SortingBehavior;Lgg/essential/vigilance/i18n/I18nProvider;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun addDependency (Ljava/lang/String;Ljava/lang/String;)V
public final fun addDependency (Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public final fun addDependency (Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;)V
public final fun addDependency (Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;Lkotlin/jvm/functions/Function1;)V
public final fun addDependency (Lkotlin/reflect/KProperty;Lkotlin/reflect/KProperty;)V
public final fun addInverseDependency (Ljava/lang/String;Ljava/lang/String;)V
public final fun addInverseDependency (Ljava/lang/reflect/Field;Ljava/lang/reflect/Field;)V
public final fun category (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public final fun dependsOn (Lkotlin/reflect/KProperty;Lkotlin/reflect/KProperty;)V
public final fun getCategories ()Ljava/util/List;
public final fun getCategoryFromSearch (Ljava/lang/String;)Lgg/essential/vigilance/data/Category;
public final fun getGuiTitle ()Ljava/lang/String;
public final fun getI18nProvider ()Lgg/essential/vigilance/i18n/I18nProvider;
protected fun getMigrations ()Ljava/util/List;
public final fun getSortingBehavior ()Lgg/essential/vigilance/data/SortingBehavior;
public final fun gui ()Lgg/essential/vigilance/gui/SettingsGui;
public final fun hiddenIf (Lkotlin/reflect/KProperty;Lkotlin/jvm/functions/Function0;)V
Expand Down Expand Up @@ -152,6 +157,10 @@ public final class gg/essential/vigilance/data/MethodBackedPropertyValue : gg/es
public fun invoke (Lgg/essential/vigilance/Vigilant;)V
}

public abstract interface class gg/essential/vigilance/data/Migration {
public abstract fun apply (Ljava/util/Map;)V
}

public abstract interface annotation class gg/essential/vigilance/data/Property : java/lang/annotation/Annotation {
public abstract fun allowAlpha ()Z
public abstract fun category ()Ljava/lang/String;
Expand Down Expand Up @@ -302,16 +311,20 @@ public final class gg/essential/vigilance/data/PropertyData {
public final fun getAttributes ()Lgg/essential/vigilance/data/PropertyAttributes;
public final fun getAttributesExt ()Lgg/essential/vigilance/data/PropertyAttributesExt;
public final fun getDataType ()Lgg/essential/vigilance/data/PropertyType;
public final fun getDependencyPredicate ()Lkotlin/jvm/functions/Function1;
public final fun getDependsOn ()Lgg/essential/vigilance/data/PropertyData;
public final fun getHasDependants ()Z
public final fun getInstance ()Lgg/essential/vigilance/Vigilant;
public final fun getInverseDependency ()Z
public final fun getValue ()Lgg/essential/vigilance/data/PropertyValue;
public fun hashCode ()I
public final fun isHidden ()Z
public final fun setAction (Lkotlin/jvm/functions/Function1;)V
public final fun setCallbackConsumer (Ljava/util/function/Consumer;)V
public final fun setDependencyPredicate (Lkotlin/jvm/functions/Function1;)V
public final fun setDependsOn (Lgg/essential/vigilance/data/PropertyData;)V
public final fun setHasDependants (Z)V
public final fun setInverseDependency (Z)V
public final fun setValue (Ljava/lang/Object;)V
public fun toString ()Ljava/lang/String;
}
Expand Down Expand Up @@ -528,9 +541,12 @@ public final class gg/essential/vigilance/gui/VigilancePalette {
public final fun getSuccess ()Ljava/awt/Color;
public final fun getText ()Ljava/awt/Color;
public final fun getTextActive ()Ljava/awt/Color;
public final fun getTextActiveShadow ()Ljava/awt/Color;
public final fun getTextDisabled ()Ljava/awt/Color;
public final fun getTextHighlight ()Ljava/awt/Color;
public final fun getTextShadow ()Ljava/awt/Color;
public final fun getTextShadowLight ()Ljava/awt/Color;
public final fun getTextShadowMid ()Ljava/awt/Color;
public final fun getTextWarning ()Ljava/awt/Color;
public final fun getTransparent ()Ljava/awt/Color;
public final fun getWarning ()Ljava/awt/Color;
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ apiValidation {
ignoredPackages.add("gg.essential.vigilance.example")
nonPublicMarkers.add("org.jetbrains.annotations.ApiStatus\$Internal")
}

tasks.test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env sh

# Need Java 16, and this seems to be the easiest way to do that per-branch for TeamCity
# Need Java 17, and this seems to be the easiest way to do that per-branch for TeamCity
if [ -n "$IS_CI" ]; then
JAVA_HOME=/usr/lib/jvm/java-16-oracle
JAVA_HOME=/usr/lib/jvm/jdk-17.0.2
fi

#
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pluginManagement {
maven("https://repo.essential.gg/repository/maven-public")
}
plugins {
val egtVersion = "0.1.9"
val egtVersion = "0.3.0"
id("gg.essential.defaults") version egtVersion
id("gg.essential.multi-version.root") version egtVersion
id("gg.essential.multi-version.api-validation") version egtVersion
Expand Down
13 changes: 2 additions & 11 deletions src/main/kotlin/gg/essential/vigilance/Vigilance.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
package gg.essential.vigilance

import gg.essential.elementa.effects.StencilEffect

object Vigilance {
private var initialized = false

@JvmStatic
fun initialize() {
if (initialized)
return

initialized = true
StencilEffect.enableStencil()
}
@Deprecated("It is no longer necessary to call this method.")
fun initialize() {}
}
6 changes: 6 additions & 0 deletions src/main/kotlin/gg/essential/vigilance/VigilanceConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ object VigilanceConfig {
private var textDisabled = Color(0x6A6A6A)
private var textWarning = Color(0xF5534F)
private var textShadow = Color(0x161618)
private var textShadowLight = Color(0x3F3F3F)
private var textShadowMid = Color(0x232323)
private var componentBackground = Color(0x232323)
private var componentBackgroundHighlight = Color(0x2F2F2F)
private var componentBorder = Color(0x474747)
Expand All @@ -62,6 +64,7 @@ object VigilanceConfig {
private var scrollbar = Color(0x545454)
private var mainBackground = Color(0x181818)
private var textActive = Color(0x2997FF)
private var textActiveShadow = Color(0x0A253F)

internal fun setAllInPalette() {
VigilancePalette.brightDividerState.set(brightDivider)
Expand Down Expand Up @@ -103,7 +106,10 @@ object VigilanceConfig {
VigilancePalette.dividerDark.set(dividerDark)
VigilancePalette.scrollbar.set(scrollbar)
VigilancePalette.textShadow.set(textShadow)
VigilancePalette.textShadowLight.set(textShadowLight)
VigilancePalette.textShadowMid.set(textShadowMid)
VigilancePalette.mainBackground.set(mainBackground)
VigilancePalette.textActive.set(textActive)
VigilancePalette.textActiveShadow.set(textActiveShadow)
}
}
Loading

0 comments on commit 4c0a270

Please sign in to comment.