Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
29 changes: 5 additions & 24 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# Build outputs
obj/
bin/
build/artifacts/
build/temp/
build/
/CHANGELOG.md
/CHANGELOG.NEXT.md

Expand Down
8 changes: 4 additions & 4 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mode: ContinuousDeployment
workflow: GitHubFlow/v1
mode: ContinuousDelivery
branches:
master:
regex: ^master$
tag: preview
main:
label: preview
increment: Patch
1 change: 0 additions & 1 deletion JUSToolkit.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<File Path="src/Tests.runsettings" />
</Folder>
<Project Path="src/JUS.CLI/JUS.CLI.csproj" />
<Project Path="src/JUS.SceneGatePlugin/JUS.SceneGatePlugin.csproj" />
<Project Path="src/JUS.Tests/JUS.Tests.csproj" />
<Project Path="src/JUS.Tool/JUS.Tool.csproj" />
</Solution>
87 changes: 33 additions & 54 deletions build.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<BuildContext>()
.UseContext<PleOpsBuildContext>()
.UseLifetime<BuildLifetime>()
.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<BuildContext>
public sealed class BuildLifetime : FrostingLifetime<PleOpsBuildContext>
{
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();
}
Expand All @@ -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
{
Expand All @@ -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))]
Expand All @@ -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<BuildContext>
public class DownloadJusTestFilesTask : FrostingTask<PleOpsBuildContext>
{
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"
Expand All @@ -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);
}
}
4 changes: 1 addition & 3 deletions docs/articles/tool/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 1 addition & 2 deletions docs/articles/tool/scenegate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Binary file added docs/images/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@

<packageSource key="SceneGate-Preview">
<package pattern="Texim*" />
<!-- <package pattern="Yarhl*" />-->
<package pattern="SceneGate.*" />
<package pattern="Yarhl*" />
<!-- <package pattern="SceneGate.Ekona" />-->
</packageSource>

<packageSource key="PleOps-Preview">
<package pattern="PleOps.Forgejo.Client" />
<package pattern="Cake.Frosting.PleOps.Recipe" />
</packageSource>
</packageSourceMapping>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/priverop/JUSToolkit</PackageProjectUrl>
<RepositoryUrl>https://github.com/priverop/JUSToolkit</RepositoryUrl>
<!-- <PackageIcon>icon.png</PackageIcon> -->
<PackageIcon>icon.png</PackageIcon>
<PackageTags>videogames;romhacking;translating</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
Expand Down
11 changes: 5 additions & 6 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project>
<!-- Centralize dependency management -->
<ItemGroup>
<PackageVersion Include="SceneGate.UI.Formats" Version="0.1.1-preview.17" />
<PackageVersion Include="Yarhl" Version="4.1.0" />
<PackageVersion Include="Yarhl.Media.Text" Version="4.1.0" />
<PackageVersion Include="Texim" Version="0.1.0-preview.321" />
<PackageVersion Include="Texim.Games" Version="0.1.0-preview.321" />
<PackageVersion Include="SceneGate.Ekona" Version="1.1.1-preview.87" />
<PackageVersion Include="Yarhl" Version="4.1.1-preview.9" />
<PackageVersion Include="Yarhl.Media.Text" Version="4.1.1-preview.9" />
<PackageVersion Include="Texim" Version="0.1.0-preview.327" />
<PackageVersion Include="Texim.Games" Version="0.1.0-preview.327" />
<PackageVersion Include="SceneGate.Ekona" Version="1.2.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.0" />
<PackageVersion Include="FluentAssertions" Version="7.2.1" />
<PackageVersion Include="nunit" Version="4.5.1" />
Expand Down
6 changes: 3 additions & 3 deletions src/JUS.CLI/JUS/Graphics/DigCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down
25 changes: 0 additions & 25 deletions src/JUS.SceneGatePlugin/JUS.SceneGatePlugin.csproj

This file was deleted.

4 changes: 2 additions & 2 deletions src/JUS.Tool/BatchConverters/Demo2Alar3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Loading