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
8 changes: 2 additions & 6 deletions .github/workflows/actions-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ jobs:
- name: Set up dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

- name: Install dependencies
run: |
dotnet tool install -g dotnet-script
dotnet-version: 10.0.x

- name: Run test
run: |
dotnet script build.csx -- test
dotnet run build.cs test
8 changes: 2 additions & 6 deletions .github/workflows/actions-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ jobs:
- name: Set up dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

- name: Install dependencies
run: |
dotnet tool install -g dotnet-script
dotnet-version: 10.0.x

- name: Run build
run: |
dotnet script build.csx
dotnet run build.cs

- name: Push to build branch
run: |
Expand Down
12 changes: 7 additions & 5 deletions build.csx → build.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env dotnet-script
#r "nuget: Microsoft.CodeAnalysis.CSharp, 4.7.0"
#r "nuget: HedgeModManager.CodeCompiler, 0.2.37"
#!/usr/bin/dotnet run
#:package Microsoft.CodeAnalysis.CSharp@4.*
#:package HedgeModManager.CodeCompiler@0.2.150

using HedgeModManager.CodeCompiler;
using System.Text;

var StartDirectory = Environment.CurrentDirectory;
var TestOnly = false;
var Failures = new List<string>();
Expand All @@ -13,7 +15,7 @@

Environment.CurrentDirectory = Path.Combine(StartDirectory, "Source");

foreach(var arg in Args)
foreach(var arg in args)
{
if (arg.Equals("test", StringComparison.OrdinalIgnoreCase))
{
Expand Down Expand Up @@ -120,7 +122,7 @@ string GetCodeFileName()
}

var outPath = Path.Combine(StartDirectory, "build", $"{GetCodeFileName()}.hmm");
Directory.CreateDirectory(Path.GetDirectoryName(outPath));
Directory.CreateDirectory(Path.GetDirectoryName(outPath)!);
File.WriteAllText(outPath, result);
}
}
Expand Down
Loading