diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index d906aee..8df9796 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -10,32 +10,32 @@
"rollForward": false
},
"gitversion.tool": {
- "version": "5.12.0",
+ "version": "6.7.0",
"commands": [
"dotnet-gitversion"
],
"rollForward": false
},
"thirdlicense": {
- "version": "1.4.0",
+ "version": "1.4.1",
"commands": [
"thirdlicense"
],
"rollForward": false
},
"dotnet-reportgenerator-globaltool": {
- "version": "5.5.1",
+ "version": "5.5.10",
"commands": [
"reportgenerator"
],
"rollForward": false
},
"docfx": {
- "version": "2.78.4",
+ "version": "2.78.5",
"commands": [
"docfx"
],
"rollForward": false
}
}
-}
+}
\ No newline at end of file
diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml
index 049828a..8e5da28 100644
--- a/.github/workflows/build-and-release.yml
+++ b/.github/workflows/build-and-release.yml
@@ -11,8 +11,7 @@ on:
tags: [ "v*" ]
env:
- TEST_RESOURCES_NAME: 'resources-0.zip'
- DOTNET_VERSIONS: 10.0.203
+ DOTNET_VERSIONS: 10.0.300
DOTNET_INSTALL_DIR: '/tmp/dotnet/'
jobs:
@@ -31,29 +30,11 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSIONS }}
- # Full test for master builds and PR of repo owners
- - name: "[Full] Build, test, and bundle"
- if: ${{ env.TEST_RESOURCES_URI != '' }}
- run: >
- dotnet run build.cs --
- --target=Default
- --target=Bundle
- --dotnet-configuration=Release
- --resource-uri=${{ env.TEST_RESOURCES_URI }}
- --resource-name=${{ env.TEST_RESOURCES_NAME }}
- --resource-usr=${{ env.TEST_RESOURCES_USR }}
- --resource-pwd=${{ env.TEST_RESOURCES_PWD }}
+ - name: "Build, test, and bundle"
+ run: dotnet run build.cs -- --target=Build-Bundle --dotnet-configuration=Release
env:
- TEST_RESOURCES_URI: ${{ secrets.TEST_RESOURCES_URI }}
- TEST_RESOURCES_USR: ${{ secrets.TEST_RESOURCES_USR }}
- TEST_RESOURCES_PWD: ${{ secrets.TEST_RESOURCES_PWD }}
-
- # Tests without resources for PR of external contributors
- - name: "[Basic] Build, test, and bundle"
- if: ${{ env.TEST_RESOURCES_URI == '' }}
- run: dotnet run build.cs -- --target=Default --target=Bundle --dotnet-configuration=Release
- env:
- TEST_RESOURCES_URI: ${{ secrets.TEST_RESOURCES_URI }}
+ PLEOPS_RESOURCES_URL: ${{ secrets.TEST_RESOURCES_URI }}
+ PLEOPS_RESOURCES_PWD: ${{ secrets.TEST_RESOURCES_PWD }}
- name: "Publish artifacts to CI"
uses: actions/upload-artifact@v7
diff --git a/.gitignore b/.gitignore
index 6e22c5c..6eed833 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,8 +4,7 @@
# Build outputs
obj/
bin/
-build/artifacts/
-build/temp/
+build/
/CHANGELOG.md
/CHANGELOG.NEXT.md
diff --git a/GitVersion.yml b/GitVersion.yml
index 1785a95..fabd68e 100644
--- a/GitVersion.yml
+++ b/GitVersion.yml
@@ -1,6 +1,6 @@
-mode: ContinuousDeployment
+workflow: GitHubFlow/v1
+mode: ContinuousDelivery
branches:
- master:
- regex: ^master$
- tag: preview
+ main:
+ label: preview
increment: Patch
diff --git a/JUSToolkit.slnx b/JUSToolkit.slnx
index 4594463..94588d6 100644
--- a/JUSToolkit.slnx
+++ b/JUSToolkit.slnx
@@ -13,7 +13,6 @@
-
diff --git a/build.cs b/build.cs
index e8d715b..cd0a3ad 100644
--- a/build.cs
+++ b/build.cs
@@ -1,6 +1,6 @@
#!/usr/bin/env dotnet run
#:property PublishAot=false
-#:package Cake.Frosting.PleOps.Recipe@1.0.4-preview.37
+#:package Cake.Frosting.PleOps.Recipe@1.0.4-preview.62
using System.Diagnostics.CodeAnalysis;
using Cake.Common.IO;
@@ -9,64 +9,36 @@
using Cake.Core.Diagnostics;
using Cake.Frosting;
using Cake.Frosting.PleOps.Recipe;
-using Cake.Frosting.PleOps.Recipe.Dotnet;
+using Cake.Frosting.PleOps.Recipe.Common;
return new CakeHost()
.AddAssembly(typeof(PleOpsBuildContext).Assembly)
- .UseContext()
+ .UseContext()
.UseLifetime()
.Run(args);
-public sealed class BuildContext : PleOpsBuildContext
-{
- public BuildContext(ICakeContext context)
- : base(context)
- {
- }
-
- public string? TestResourceUri { get; private set; }
-
- public string? TestResourceName { get; private set; }
-
- [LogIgnore]
- public string? TestResourceUsername { get; private set; }
-
- [LogIgnore]
- public string? TestResourcePassword { get; private set; }
-
- public override void ReadArguments()
- {
- base.ReadArguments();
-
- Arguments.SetIfPresent("resource-uri", x => TestResourceUri = x);
- Arguments.SetIfPresent("resource-name", x => TestResourceName = x);
- Arguments.SetIfPresent("resource-usr", x => TestResourceUsername = x);
- Arguments.SetIfPresent("resource-pwd", x => TestResourcePassword = x);
- }
-}
-
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
-public sealed class BuildLifetime : FrostingLifetime
+public sealed class BuildLifetime : FrostingLifetime
{
- public override void Setup(BuildContext context, ISetupContext info)
+ public override void Setup(PleOpsBuildContext context, ISetupContext info)
{
- context.WarningsAsErrors = false;
+ context.WarningsAsErrors = true;
context.DotNetContext.CoverageTarget = 0;
- context.DotNetContext.ApplicationProjects.Add(
- new ProjectPublicationInfo(
- "./src/JUS.CLI",
- [ "win-x64", "linux-x64", "osx-x64" ],
- "net10.0"));
-
context.ReadArguments();
context.DotNetContext.PreviewNuGetFeed = "https://pkgs.dev.azure.com/SceneGate/SceneGate/_packaging/SceneGate-Preview/nuget/v3/index.json";
+ context.DotNetContext.AddApplication("./src/JUS.CLI", [ "win-x64", "linux-x64", "osx-x64" ]);
+
+ context.ResourcesContext.ResourcesDirectory = Path.GetFullPath(Path.Combine("src", "JUS.Tests"));
+ context.ResourcesContext.DownloadUser = "not_needed";
+ context.ResourcesContext.DownloadFormat = ResourcesDownloadFormat.ZipBundle;
+ context.ResourcesContext.DownloadId = "resources-0.zip";
context.Print();
}
- public override void Teardown(BuildContext context, ITeardownContext info)
+ public override void Teardown(PleOpsBuildContext context, ITeardownContext info)
{
context.DeliveriesContext.Save();
}
@@ -75,6 +47,7 @@ public override void Teardown(BuildContext context, ITeardownContext info)
[TaskName("Default")]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.SetGitVersionTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.CleanArtifactsTask))]
+[IsDependentOn(typeof(DownloadJusTestFilesTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.DotnetTasks.BuildProjectTask))]
public sealed class DefaultTask : FrostingTask
{
@@ -89,6 +62,13 @@ public sealed class BundleTask : FrostingTask
{
}
+[TaskName("Build-Bundle")]
+[IsDependentOn(typeof(DefaultTask))]
+[IsDependentOn(typeof(BundleTask))]
+public sealed class BuildBundleTask : FrostingTask
+{
+}
+
[TaskName("Deploy")]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Common.SetGitVersionTask))]
[IsDependentOn(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.DotnetTasks.DeployProjectTask))]
@@ -97,24 +77,23 @@ public sealed class DeployTask : FrostingTask
{
}
-[TaskName("Download-TestFiles")]
+[TaskName("Download-JusTestFiles")]
[TaskDescription("Download the test resource files")]
-[IsDependeeOf(typeof(Cake.Frosting.PleOps.Recipe.Dotnet.TestTask))]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
-public class DownloadTestFilesTask : FrostingTask
+public class DownloadJusTestFilesTask : FrostingTask
{
- public override bool ShouldRun(BuildContext context) =>
- !string.IsNullOrEmpty(context.TestResourceUri);
+ public override bool ShouldRun(PleOpsBuildContext context) =>
+ !string.IsNullOrEmpty(context.ResourcesContext.DownloadAddress);
- public override void Run(BuildContext context)
+ public override void Run(PleOpsBuildContext context)
{
- string resourcesPath = Path.GetFullPath(Path.Combine("src", "JUS.Tests"));
-
- string resourceUri = string.Format(context.TestResourceUri!, context.TestResourceName);
+ ResourcesContext resourceInfo = context.ResourcesContext;
+ string resourceUri = string.Format(resourceInfo.DownloadAddress!, resourceInfo.DownloadId);
var downloadSettings = new DownloadFileSettings {
- Username = context.TestResourceUsername,
- Password = context.TestResourcePassword,
- UseDefaultCredentials = string.IsNullOrWhiteSpace(context.TestResourceUsername) || string.IsNullOrWhiteSpace(context.TestResourcePassword),
+ Username = resourceInfo.DownloadUser,
+ Password = resourceInfo.DownloadPassword,
+ UseDefaultCredentials = string.IsNullOrWhiteSpace(resourceInfo.DownloadUser)
+ || string.IsNullOrWhiteSpace(resourceInfo.DownloadPassword),
};
context.Log.Information(downloadSettings.UseDefaultCredentials
? "Download without credentials"
@@ -124,6 +103,6 @@ public override void Run(BuildContext context)
var compressedResources = context.DownloadFile(resourceUri, downloadSettings);
context.Log.Debug("Unzipping resource");
- context.Unzip(compressedResources, resourcesPath, true);
+ context.Unzip(compressedResources, context.ResourcesContext.ResourcesDirectory, true);
}
}
diff --git a/docs/articles/tool/install.md b/docs/articles/tool/install.md
index 559431e..dc635d7 100644
--- a/docs/articles/tool/install.md
+++ b/docs/articles/tool/install.md
@@ -18,6 +18,4 @@ Download the latest stable version from the
Preview versions can be downloaded from the project
[_Actions pipeline artifacts_](https://github.com/priverop/JUSToolkit/actions/workflows/build-and-release.yml).
-But they expire after a few days. You may want to follow the
-[source code README file](https://github.com/priverop/JUSToolkit) to build the
-latest version yourself.
+But they expire after a few days, so you may need to build it locally.
diff --git a/docs/articles/tool/scenegate.md b/docs/articles/tool/scenegate.md
index 351d6c3..b0d3459 100644
--- a/docs/articles/tool/scenegate.md
+++ b/docs/articles/tool/scenegate.md
@@ -11,8 +11,7 @@ In this guide we'll see how to import the JUSToolkit converters.
1. Download the [latest SceneGate release](https://code.pleonex.dev/SceneGate/SceneGate/releases).
2. Compile this tool (JUSToolkit) and copy `src/JUS.Tool/bin/Debug/net10.0/JUS.Tool.dll`,
-and `src/JUS.SceneGatePlugin/bin/Debug/net10.0/JUS.SceneGatePlugin.dll`, to the
-downloaded `SceneGate` folder, with the rest of .dll.
+ to the downloaded `SceneGate` folder, with the rest of .dll.
3. Run `SceneGate.Destktop`, open your legal dump of the game, select it, and
double click in the Suggested Converter `Binary2NitroRom`.
diff --git a/docs/images/icon_128.png b/docs/images/icon_128.png
new file mode 100644
index 0000000..14f4bf2
Binary files /dev/null and b/docs/images/icon_128.png differ
diff --git a/nuget.config b/nuget.config
index 9cc47fe..cf53fa8 100644
--- a/nuget.config
+++ b/nuget.config
@@ -14,12 +14,11 @@
-
-
+
+
-
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 070bb6f..a810155 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -18,7 +18,7 @@
MIT
https://github.com/priverop/JUSToolkit
https://github.com/priverop/JUSToolkit
-
+ icon.png
videogames;romhacking;translating
README.md
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index d3fb91f..132b2de 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -1,12 +1,11 @@
-
-
-
-
-
-
+
+
+
+
+
diff --git a/src/JUS.CLI/JUS/Graphics/DigCommands.cs b/src/JUS.CLI/JUS/Graphics/DigCommands.cs
index 4381c6a..7450a73 100644
--- a/src/JUS.CLI/JUS/Graphics/DigCommands.cs
+++ b/src/JUS.CLI/JUS/Graphics/DigCommands.cs
@@ -20,9 +20,9 @@
using JUS.Tool.Graphics;
using JUS.Tool.Graphics.Converters;
using JUS.Tool.Utils;
-using Texim.Games.Nitro.Backgrounds.ScreenMaps;
using Texim.Images;
using Texim.Images.Standard;
+using Texim.TileMaps;
using Yarhl.FileSystem;
using Yarhl.IO;
@@ -99,7 +99,7 @@ public static void ImportDig(string input, bool insertTransparent, string dig, s
Height = compressed.Tiles.Length / 8,
Pixels = compressed.Tiles,
};
- IScreenMap map = compressed.Map;
+ ITileMap map = compressed.Map;
var newDig = new Dig(originalDig, newImage);
@@ -158,7 +158,7 @@ public static void MergeDig(string[] input, bool insertTransparent, string dig,
Height = compressed.Tiles.Length / 8,
Pixels = compressed.Tiles,
};
- IScreenMap map = compressed.Map;
+ ITileMap map = compressed.Map;
// 3 - Clone original
mergedImage = new Dig(mergedImage, newImage);
diff --git a/src/JUS.SceneGatePlugin/JUS.SceneGatePlugin.csproj b/src/JUS.SceneGatePlugin/JUS.SceneGatePlugin.csproj
deleted file mode 100644
index 89af50b..0000000
--- a/src/JUS.SceneGatePlugin/JUS.SceneGatePlugin.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- SceneGate UI plugin for the JUS game formats.
-
- net10.0
-
- enable
- enable
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/JUS.Tool/BatchConverters/Demo2Alar3.cs b/src/JUS.Tool/BatchConverters/Demo2Alar3.cs
index ff46f54..705b87a 100644
--- a/src/JUS.Tool/BatchConverters/Demo2Alar3.cs
+++ b/src/JUS.Tool/BatchConverters/Demo2Alar3.cs
@@ -21,9 +21,9 @@
using JUS.Tool.Graphics;
using JUS.Tool.Graphics.Converters;
using JUS.Tool.Utils;
-using Texim.Games.Nitro.Backgrounds.ScreenMaps;
using Texim.Images;
using Texim.Images.Standard;
+using Texim.TileMaps;
using Yarhl.FileFormat;
using Yarhl.FileSystem;
using Yarhl.IO;
@@ -144,7 +144,7 @@ private void Transform(Node[] pngs, Node dig, Node[] atms)
Pixels = compressed.Tiles,
};
- IScreenMap map = compressed.Map;
+ ITileMap map = compressed.Map;
// 3 - Clone original
mergedImage = new Dig(mergedImage, newImage);
diff --git a/src/JUS.Tool/BatchConverters/Png2Alar3.cs b/src/JUS.Tool/BatchConverters/Png2Alar3.cs
index 8cb92fc..0d9911e 100644
--- a/src/JUS.Tool/BatchConverters/Png2Alar3.cs
+++ b/src/JUS.Tool/BatchConverters/Png2Alar3.cs
@@ -21,9 +21,9 @@
using JUS.Tool.Graphics;
using JUS.Tool.Graphics.Converters;
using JUS.Tool.Utils;
-using Texim.Games.Nitro.Backgrounds.ScreenMaps;
using Texim.Images;
using Texim.Images.Standard;
+using Texim.TileMaps;
using Yarhl.FileFormat;
using Yarhl.FileSystem;
using Yarhl.IO;
@@ -154,7 +154,7 @@ private void Transform(Node png, Node dig, Node atm)
Height = compressed.Tiles.Length / 8,
Pixels = compressed.Tiles,
};
- IScreenMap map = compressed.Map;
+ ITileMap map = compressed.Map;
// New Dig: original dig changing height, width and pixels
var newDig = new Dig(originalDig, newImage);
diff --git a/src/JUS.SceneGatePlugin/JusBinaryHeaderConverterMatcher.cs b/src/JUS.Tool/Discovery/JusBinaryHeaderConverterMatcher.cs
similarity index 87%
rename from src/JUS.SceneGatePlugin/JusBinaryHeaderConverterMatcher.cs
rename to src/JUS.Tool/Discovery/JusBinaryHeaderConverterMatcher.cs
index b10fd38..525354c 100644
--- a/src/JUS.SceneGatePlugin/JusBinaryHeaderConverterMatcher.cs
+++ b/src/JUS.Tool/Discovery/JusBinaryHeaderConverterMatcher.cs
@@ -2,12 +2,16 @@
using JUS.Tool.Containers.Converters;
using JUS.Tool.Graphics.Converters;
using JUS.Tool.Utils;
-using SceneGate.UI.Formats.Discovery;
+using Yarhl.FileFormat;
+using Yarhl.FileFormat.Discovery;
using Yarhl.FileSystem;
using Yarhl.IO;
-namespace JUS.SceneGatePlugin;
+namespace JUS.Tool.Discovery;
+///
+/// Discover compatible converters for binary formats based on their header bytes.
+///
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]
public sealed class JusBinaryHeaderConverterMatcher : IConverterMatcher
{
@@ -24,6 +28,7 @@ public sealed class JusBinaryHeaderConverterMatcher : IConverterMatcher
HeaderFormat.Create("DSTX", 1, 4),
];
+ ///
public ConverterMatcherResult Match(Node input, ConverterMatcherContext context)
{
if (input.Format is not IBinary) {
@@ -45,7 +50,7 @@ public ConverterMatcherResult Match(Node input, ConverterMatcherContext context)
// "should be" if header match, but we can't verify the game code
MatchingConfidence level = compatibleSoftware == true ? MatchingConfidence.Confident : MatchingConfidence.ShouldBe;
- object converter = compatibleFormat.ConverterFactory();
+ IConverter converter = compatibleFormat.ConverterFactory();
return new ConverterMatcherResult(level, compatibleFormat.ConverterType, converter);
}
@@ -60,7 +65,7 @@ private static bool MatchFormat(ConverterMatcherContext context, HeaderFormat fo
return false;
}
- if (context.Header.ReadAsciiString(0, 4) != format.Id) {
+ if (context.Header.ReadAscii(0, 4) != format.Id) {
return false;
}
@@ -80,10 +85,10 @@ private sealed record HeaderFormat(
byte? Version,
byte? Flags,
Type ConverterType,
- Func