Skip to content
Open
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
36 changes: 15 additions & 21 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fake-cli": {
"version": "6.1.4",
"commands": [
"fake"
]
},
"paket": {
"version": "10.3.1",
"commands": [
"paket"
]
},
"dotnet-fsharplint": {
"version": "0.26.10",
"commands": [
"dotnet-fsharplint"
]
}
"version": 1,
"isRoot": true,
"tools": {
"paket": {
"version": "10.3.1",
"commands": [
"paket"
]
},
"dotnet-fsharplint": {
"version": "0.26.10",
"commands": [
"dotnet-fsharplint"
]
}
}
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
insert_final_newline = true

[*.fs]
indent_size = 4
indent_style = space
fsharp_max_record_width = 60
fsharp_multiline_bracket_style = stroustrup
fsharp_space_before_uppercase_invocation = true

[src/Client/*.fs]
# Feliz style
fsharp_single_argument_web_mode=true
49 changes: 25 additions & 24 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ jobs:
strategy:
matrix:
os:
- name: macos-latest
- name: macos-14
rid: osx-arm64
run: ./build.sh
- name: ubuntu-latest
rid: linux-x64
run: ./build.sh
- name: windows-latest
rid: win-x64
run: ./build.cmd
dotnet: ["10.x"]
runs-on: ${{ matrix.os.name }}
Expand All @@ -31,48 +34,46 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet }}

- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Cache PlantUML
uses: actions/cache@v4
with:
path: tools/plantuml/plantuml.jar
key: plantuml-${{ hashFiles('tools/plantuml/manifest.txt') }}
path: tools/plantuml/native
key: plantuml-native-${{ matrix.os.rid }}-${{ hashFiles('tools/plantuml/manifest.txt') }}
enableCrossOsArchive: true

- name: Run tests
- name: Build
run: ${{ matrix.os.run }}

tests:
runs-on: macos-latest
name: "Check application"
strategy:
matrix:
os:
- name: macos-14
rid: osx-arm64
run: ./build.sh -t tests no-lint
- name: ubuntu-latest
rid: linux-x64
run: ./build.sh -t tests no-lint
- name: windows-latest
rid: win-x64
run: ./build.cmd -t tests no-lint
dotnet: ["10.x"]
runs-on: ${{ matrix.os.name }}

steps:
- uses: actions/checkout@v6

- name: Setup .NET Core
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x

- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
dotnet-version: ${{ matrix.dotnet }}

- name: Cache PlantUML
uses: actions/cache@v4
with:
path: tools/plantuml/plantuml.jar
key: plantuml-${{ hashFiles('tools/plantuml/manifest.txt') }}
path: tools/plantuml/native
key: plantuml-native-${{ matrix.os.rid }}-${{ hashFiles('tools/plantuml/manifest.txt') }}
enableCrossOsArchive: true

- name: Run tests
env:
DOTNET_ROLL_FORWARD: latestMajor
run: ./build.sh -t tests no-lint
run: ${{ matrix.os.run }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ output
.neo4j.json

# Downloaded local PlantUML renderer
tools/plantuml/plantuml.jar
tools/plantuml/native/

docs
dist
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project>

<!-- Deployed by Alma.Build; the next Bootstrap overwrites it. The build cannot set
`RuntimeIdentifier` from the command line, so it passes `AlmaBuildRuntimeIdentifier` instead. -->
<PropertyGroup Condition="'$(AlmaBuildRuntimeIdentifier)' != ''">
<RuntimeIdentifier>$(AlmaBuildRuntimeIdentifier)</RuntimeIdentifier>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions TUC.Console.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Solution>
<Folder Name="/tests/">
<Project Path="tests/tests.fsproj" />
</Folder>
<Project Path="TucConsole.fsproj" />
</Solution>
22 changes: 15 additions & 7 deletions TucConsole.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@
</ItemGroup>

<ItemGroup>
<Content Include="tools/plantuml/plantuml.jar">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<Link>plantuml/plantuml.jar</Link>
<PackagePath>contentFiles/any/any/plantuml/plantuml.jar</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="tools/plantuml/licenses/COPYING" Link="licenses/PlantUML/COPYING" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<Content Include="tools/plantuml/licenses/NOTICE" Link="licenses/PlantUML/NOTICE" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<Content Include="tools/plantuml/source-provenance.txt" Link="licenses/PlantUML/source-provenance.txt" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
<Content Include="tools/plantuml/native/linux-x64/plantuml.zip" Link="plantuml/native/linux-x64/plantuml.zip" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
<Content Include="tools/plantuml/native/win-x64/plantuml.zip" Link="plantuml/native/win-x64/plantuml.zip" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-arm64'">
<Content Include="tools/plantuml/native/osx-arm64/plantuml.zip" Link="plantuml/native/osx-arm64/plantuml.zip" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>

<Import Project=".paket\Paket.Restore.targets" />
Expand Down
10 changes: 8 additions & 2 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
APP="TucConsole"
NET="net10.0"

CONSOLE="bin/Debug/$NET/$APP.dll"
case "$(uname -s)-$(uname -m)" in
Linux-x86_64) RID="linux-x64" ;;
Darwin-arm64) RID="osx-arm64" ;;
*) echo "Unsupported platform: $(uname -s)-$(uname -m)" >&2; exit 1 ;;
esac

CONSOLE="bin/Debug/$NET/$RID/$APP.dll"
if [ ! -f "$CONSOLE" ]; then
CONSOLE="bin/Release/$NET/$APP.dll"
CONSOLE="bin/Release/$NET/$RID/$APP.dll"
fi

dotnet "$CONSOLE" "$@"
Empty file modified build.cmd
100755 → 100644
Empty file.
20 changes: 17 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@
set -eu
set -o pipefail

dotnet tool restore
dotnet tool run paket restore
run() {
if [ -n "${RTK_ACTIVE:-}" ]; then
local output
if ! output=$("$@" 2>&1); then
printf '%s\n' "$output" >&2
return 1
fi
else
"$@"
fi
}

run dotnet tool restore
run dotnet tool run paket restore
# pre-build so the `dotnet run --no-build` below emits no restore/build chatter
run dotnet build ./build/build.fsproj

# shellcheck disable=SC2068
FAKE_DETAILED_ERRORS=true dotnet run --project ./build/build.fsproj -- $@
FAKE_DETAILED_ERRORS=true dotnet run --no-build --project ./build/build.fsproj -- $@
38 changes: 17 additions & 21 deletions build/Build.fs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
// ========================================================================================================
// === F# / Project fake build ==================================================================== 1.6.0 =
// --------------------------------------------------------------------------------------------------------
// Options:
// - no-clean - disables clean of dirs in the first step (required on CI)
// - no-lint - lint will be executed, but the result is not validated
// ========================================================================================================

open Alma.Build
open Fake.Core
open Fake.Core.TargetOperators
open Fake.IO.FileSystemOperators
Expand All @@ -18,26 +11,29 @@ open Utils
let main args =
args |> Args.init

let runtimeTargets = [
OSXArm64
Windows
Linux
]

let spec =
Spec.defaultConsoleApplication runtimeTargets
|> Spec.mapConsoleApplication (fun spec -> {
spec with
RuntimeMode = RuntimeMode.AutoDetect
PublishSingleFile = false
})

Targets.init {
Project = {
Name = "TUC.Console"
Summary = "Console application for .tuc commands."
Git = Git.init ()
}
Specs =
Spec.defaultConsoleApplication [
OSX
Windows
Linux
]
Specs = spec
}

Target.create "PlantUml" (fun _ ->
match PlantUml.ensure () with
| PlantUml.Verified version -> Trace.tracefn "[PlantUML] Using verified v%s JAR." version
| PlantUml.Downloaded version -> Trace.tracefn "[PlantUML] Downloaded and verified v%s JAR." version
)

"PlantUml" ==> "Build" |> ignore
PlantUml.init runtimeTargets

args |> Args.run
Loading
Loading