Skip to content

Commit 777ec1a

Browse files
authored
Migrate to .NET 10 and modernize build infrastructure (#14)
* Migrate to .NET 10 and modernize build infrastructure - Migrate all projects to .NET 10 (Hjson, CLI, sample, and tests) - Replace legacy .sln files with modern .slnx format - Update project file structure for net10 target framework - Remove legacy build system (Travis CI, build-mono script) - Add GitHub Actions CI/CD workflows (ci.yml, format.yml, release.yml) - Add developer container configuration (.devcontainer) - Add EditorConfig and VS Code workspace settings - Major refactoring of core library (HjsonReader, JsonWriter, etc.) - Add new converter API (HjsonConvert, HjsonAttributes) - Rewrite test suite with proper unit tests (HjsonConvertTests, ParserTests) - Simplify CLI and sample applications - Performance tunning - dotnet format Fixes #7 Fixes #10 Fixes #13
1 parent cfe6ed6 commit 777ec1a

56 files changed

Lines changed: 3597 additions & 2370 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "C# (.NET 10)",
3+
"image": "mcr.microsoft.com/dotnet/sdk:10.0",
4+
"updateRemoteUserUID": true,
5+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/${localWorkspaceFolderBasename},type=bind,Z",
6+
"runArgs": [
7+
"--userns=keep-id"
8+
],
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-dotnettools.csharp",
13+
"ms-dotnettools.vscode-dotnet-runtime",
14+
// "ms-dotnettools.csdevkit"
15+
]
16+
}
17+
}
18+
}

.editorconfig

Lines changed: 389 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '10.0.x' # Uses latest stable .NET
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
24+
- name: Build
25+
run: dotnet build --configuration Release --no-restore
26+
27+
- name: Test
28+
run: dotnet test test/test.csproj --configuration Release --no-build --verbosity normal

.github/workflows/format.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Format Check
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
format:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: '10.0.x'
20+
21+
- name: Format Check
22+
run: dotnet format --verify-no-changes

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on tags like v4.0.0 or v4.0.0-rc.1
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: '10.0.x'
19+
20+
- name: Extract version from tag
21+
id: version
22+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
23+
24+
- name: Restore dependencies
25+
run: dotnet restore Hjson/Hjson.csproj
26+
27+
- name: Pack Hjson
28+
run: dotnet pack Hjson/Hjson.csproj --configuration Release --no-restore -o ./artifacts /p:Version=${{ steps.version.outputs.VERSION }}
29+
30+
- name: Push to NuGet
31+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

.travis.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[csharp]": {
3+
"editor.defaultFormatter": "ms-dotnettools.csharp",
4+
"editor.formatOnSave": true,
5+
"editor.formatOnType": true,
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.csharp": "explicit"
8+
}
9+
}
10+
}

Hjson.nuspec

Lines changed: 0 additions & 22 deletions
This file was deleted.

Hjson.sln

Lines changed: 0 additions & 22 deletions
This file was deleted.

Hjson.slnx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Solution>
2+
<Project Path="Hjson/Hjson.csproj" />
3+
<Project Path="cli/cli.csproj" />
4+
<Project Path="test/test.csproj" Type="8bb2217d-0f2d-49d1-97bc-3654ed321f3b" />
5+
</Solution>

0 commit comments

Comments
 (0)