Skip to content

Commit

Permalink
Switch to a taskfile with coreutils and remove the justfile to remain…
Browse files Browse the repository at this point in the history
… shell agnostic.
  • Loading branch information
fgimian committed Jan 7, 2025
1 parent 7772ceb commit c063670
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 66 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Setup Just
uses: extractions/setup-just@v2
- name: Setup Task
uses: arduino/setup-task@v2
with:
version: 3.x

- name: Restore dependencies, build, test & distribute using Just
run: just configuration=${{ matrix.configuration }} distribute
- name: Restore dependencies, build, test & distribute
run: task distribute
env:
CONFIGURATION: ${{ matrix.configuration }}

- name: Upload coverage
if: ${{ matrix.configuration == 'Release' }}
Expand Down
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,41 @@ OSC settings.
After cloning the source code from GitHub, follow the steps below:

1. Install the [.NET 7.0 SDK](https://dotnet.microsoft.com/download).
2. Install [Just](https://github.com/casey/just)
3. Open a terminal and build the project
2. Install Task and the cross-platform coreutils using WinGet

```
just configuration=Release distribute
winget install Task.Task uutils.coreutils
```
4. You'll now find an installer under the **artifacts** sub-directory
3. Build the project using the default **Debug** configuration and create the installer
You may find various other build targets by simply typing `just` with no arguments.
```
task distribute
```
You may set the **CONFIGURATION** environment variable to **Release** to create a release
build.
You'll now find an installer under the **artifacts** sub-directory.
You may find various other build targets by simply typing `task` with no arguments.
## Building the Icon
The icon is built from an SVG. Start by installing ImageMagick and Inkscape using WinGet.
You may follow the steps below to build the icon from the provided SVG:
```
winget install ImageMagick.ImageMagick Inkscape.Inkscape
```
1. Install ImageMagick and Inkscape using WinGet
Then ensure you add **C:\Program Files\Inkscape\bin** to your **Path** environment variable
and build the icon as follows:
```
winget install ImageMagick.ImageMagick Inkscape.Inkscape
```
2. Add **C:\Program Files\Inkscape\bin** to your **Path** environment variable
3. Build the icon
```
just icon
```
```
task icon
```
## License
Expand Down
66 changes: 66 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: '3'

vars:
CONFIGURATION: '{{default "Debug" .CONFIGURATION}}'
tasks:
clean:
desc: Clean all object and binary files along with test output.
cmd: coreutils rm -rf .coverage src/*/TestResults src/*/bin/{{.CONFIGURATION}} src/*/obj/{{.CONFIGURATION}}

icon:
desc: Create the application icon.
vars:
SIZES: [16, 32, 48, 128, 256]
cmds:
- for:
var: SIZES
cmd: inkscape -w {{.ITEM}} -h {{.ITEM}} -o {{.ITEM}}.png TotalMixVC.svg
- magick {{range .SIZES}}{{.}}.png {{end}}-compress none src/TotalMixVC/Icons/TotalMixVC.ico
- coreutils rm *.png

restore:
desc: Restore the required tools and project dependencies.
cmds:
- dotnet tool restore
- dotnet restore

build:
desc: Build the application.
cmd: dotnet build --configuration {{.CONFIGURATION}} --no-restore
deps:
- restore

test:
desc: Test the application and produce a coverage report.
cmds:
- >-
dotnet test
--configuration {{.CONFIGURATION}}
--logger xunit
--verbosity normal
--no-build
--collect:"XPlat Code Coverage"
- >-
dotnet reportgenerator
-reports:src/**/coverage.cobertura.xml
-targetdir:.coverage
"-reporttypes:Cobertura;lcov;Html"
-filefilters:-*.g.cs
deps:
- build

publish:
desc: Publish the application ready for distribution.
cmd: >-
dotnet publish src/TotalMixVC
--configuration {{.CONFIGURATION}}
--runtime win-x64
--self-contained
deps:
- test

distribute:
desc: Create an installer for distribution.
cmd: iscc /Oartifacts /DAppBuildConfiguration={{.CONFIGURATION}} TotalMixVC.iss
deps:
- publish
48 changes: 0 additions & 48 deletions justfile

This file was deleted.

0 comments on commit c063670

Please sign in to comment.