mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-10-25 20:22:22 +00:00
Include missed scripts (#2216)
This commit is contained in:
1 parent
2a8c8756d3
commit
10922edca3
3 files changed
+59
No files matched your search
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# usage: companion-version.sh <name> <catalog-key>; TAG is <name>-v<version>[-N] or unset
|
||||
set -euo pipefail
|
||||
|
||||
name="${1:?name required}"
|
||||
key="${2:?catalog key required}"
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
||||
base="$(sed -nE "s/^$key = \"(.*)\"\$/\\1/p" gradle/libs.versions.toml)"
|
||||
[[ -n "$base" ]] || { echo "$key not found" >&2; exit 1; }
|
||||
|
||||
tag="${TAG:-}"
|
||||
if [[ -z "$tag" ]]; then
|
||||
echo "$base"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
version="${tag#"$name"-v}"
|
||||
if [[ "$version" == "$tag" || ( "$version" != "$base" && ! "$version" =~ ^"$base"-[1-9][0-9]*$ ) ]]; then
|
||||
echo "bad tag '$tag': want $name-v$base[-N]" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "$version"
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# usage: release-companion-jar.sh <jar> <notes>; TAG is <name>-v<version>
|
||||
set -euo pipefail
|
||||
|
||||
: "${TAG:?TAG required}"
|
||||
jar="${1:?jar required}"
|
||||
notes="${2:?notes required}"
|
||||
|
||||
gh release create "$TAG" "$jar" --latest=false --title "angelica-${TAG%%-v*} ${TAG#*-v}" --notes "$notes"
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.gtnewhorizons.angelica.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
class GLVersionChoiceTest {
|
||||
|
||||
@Test
|
||||
void zeroAndBelowTheFloorAreAuto() {
|
||||
assertEquals(GLVersionChoice.AUTO, GLVersionChoice.of(0, 46));
|
||||
assertEquals(GLVersionChoice.AUTO, GLVersionChoice.of(32, 46));
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonexistentVersionsRoundDown() {
|
||||
assertEquals(GLVersionChoice.GL33, GLVersionChoice.of(34, 46));
|
||||
assertEquals(GLVersionChoice.GL33, GLVersionChoice.of(39, 46));
|
||||
assertEquals(GLVersionChoice.GL45, GLVersionChoice.of(45, 46));
|
||||
}
|
||||
|
||||
@Test
|
||||
void ceilingCaps() {
|
||||
assertEquals(GLVersionChoice.GL41, GLVersionChoice.of(46, 41));
|
||||
assertEquals(GLVersionChoice.GL33, GLVersionChoice.of(41, 33));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user