diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..361484f1
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+*.ico filter=lfs diff=lfs merge=lfs -text
diff --git a/.github/workflows/CheckPullRequest.yml b/.github/workflows/CheckPullRequest.yml
index d236df3b..9675f5bd 100644
--- a/.github/workflows/CheckPullRequest.yml
+++ b/.github/workflows/CheckPullRequest.yml
@@ -3,28 +3,14 @@ name: Check pull request
on: [pull_request]
jobs:
- checkWinFormsBuild:
- name: Check windows forms build
- runs-on: windows-latest
- steps:
- - name: Clone repository
- uses: actions/checkout@v2
- - name: Install nuget
- uses: nuget/setup-nuget@v1
- - name: Nuget restore
- run: nuget restore
- shell: powershell
- - name: Setup msbuild
- uses: microsoft/setup-msbuild@v1.0.2
- - name: Build project
- run: msbuild .\src\XmlFormatter\XmlFormatter.csproj /t:Build /p:Configuration=Release
- shell: powershell
checkAvaloniaBuild:
name: Check Avalonia build
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Restore
run: dotnet restore
shell: powershell
diff --git a/.github/workflows/CreateLiveBuild.yml b/.github/workflows/CreateLiveBuild.yml
index 9d313a0c..ab3fa205 100644
--- a/.github/workflows/CreateLiveBuild.yml
+++ b/.github/workflows/CreateLiveBuild.yml
@@ -6,56 +6,14 @@ on:
- '*.*.*'
jobs:
- createWinFormsBuild:
- name: Create Windows forms build
- runs-on: windows-latest
- steps:
- - name: Clone repository
- uses: actions/checkout@v2
- - name: Get release tag
- run: echo "RELEASE_VERSION=$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- - name: Check release version
- run: echo ${{ env.RELEASE_VERSION }}
- - name: Install nuget
- uses: nuget/setup-nuget@v1
- - name: Nuget restore
- run: nuget restore
- shell: powershell
- - name: Setup msbuild
- uses: microsoft/setup-msbuild@v1.0.2
- - name: Prepare version
- run: echo ${{ env.RELEASE_VERSION }} | Out-File -FilePath .\src\XmlFormatter\Version.txt -Encoding utf8
- - name: Check version file
- run: Get-Content -Path .\src\XmlFormatter\Version.txt
- - name: Build project
- run: |
- msbuild .\src\XmlFormatter\XmlFormatter.csproj /t:Build /p:Configuration=Release
- msbuild .\src\JsonPlugin\JsonPlugin.csproj /t:Build /p:Configuration=Release
- msbuild .\src\CorePlugin\CorePlugin.csproj /t:Build /p:Configuration=Release
- shell: powershell
- - name: Move artifact files
- run: |
- mkdir upload-artifacts\
- mkdir plugins\
- mv .\src\CorePlugin\bin\Release\netstandard2.0\CorePlugin.dll plugins\
- mv .\src\JsonPlugin\bin\Release\netstandard2.0\JsonPlugin.dll plugins\
- mv .\src\JsonPlugin\bin\Release\netstandard2.0\Newtonsoft.Json.dll plugins\
- mv .\src\XmlFormatter\bin\Release\** upload-artifacts\
- mv LICENSE upload-artifacts\
- mv README.md upload-artifacts\
- - name: Upload build artifact
- uses: actions/upload-artifact@v2
- with:
- name: WinFormBuildArtifact
- path: |
- upload-artifacts/
- plugins/
createAvaloniaBuildWindows:
name: Create Avalonia build for Windows
runs-on: windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Get release tag
run: echo "RELEASE_VERSION=$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Check release version
@@ -93,6 +51,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Get release tag
run: echo "RELEASE_VERSION=$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Check release version
@@ -130,6 +90,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Get release tag
run: echo "RELEASE_VERSION=$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Check release version
@@ -161,37 +123,6 @@ jobs:
path: |
upload-artifacts/
plugins/
- createWinFormsZip:
- name: Create WinForm zip
- needs: ["createWinFormsBuild"]
- runs-on: ubuntu-latest
- steps:
- - name: Download artifacts
- uses: actions/download-artifact@v2
- with:
- name: WinFormBuildArtifact
- path: dist
- - name: Prepare Formatter
- run: |
- mkdir dist/upload-artifacts/Plugins
- mv dist/plugins/CorePlugin.dll dist/upload-artifacts/Plugins
- - name: Create zips
- run: |
- cd dist/upload-artifacts
- zip -r LatestDevelopment_WinFormsXmlFormatter.zip .
- cd ../plugins/
- zip -r LatestDevelopment_WinFormsJsonPlugin.zip .
- - name: Move artifact
- run: |
- mkdir upload-artifacts/
- mv dist/upload-artifacts/LatestDevelopment_WinFormsXmlFormatter.zip upload-artifacts/
- mv dist/plugins/LatestDevelopment_WinFormsJsonPlugin.zip upload-artifacts/
- - name: Upload WinForms build artifact
- uses: actions/upload-artifact@v2
- with:
- name: WinFormZipArtifact
- path: |
- upload-artifacts/
createAvaloniaZipWindows:
name: Create Avalonia Windows zip
needs: ["createAvaloniaBuildWindows"]
@@ -287,7 +218,7 @@ jobs:
upload-artifacts/
uploadRelease:
name: Upload releases
- needs: ["createWinFormsZip", "createAvaloniaZipWindows", "createAvaloniaZipLinux", "createAvaloniaZipDarwin"]
+ needs: ["createAvaloniaZipWindows", "createAvaloniaZipLinux", "createAvaloniaZipDarwin"]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
@@ -309,16 +240,6 @@ jobs:
body: You cannot update this version from within the application!
draft: true
prerelease: true
- - name: Upload WinForm XmlFormatter zip
- id: upload-win-form-formatter-zip
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: dist/WinFormZipArtifact/LatestDevelopment_WinFormsXmlFormatter.zip
- asset_name: LatestDevelopment_WinFormsXmlFormatter.zip
- asset_content_type: application/zip
- name: Upload WinForm JsonPlugin zip
id: upload-win-form-json-plugin-zip
uses: actions/upload-release-asset@v1
diff --git a/.github/workflows/LatestBuild.yml b/.github/workflows/LatestBuild.yml
index 04f312e4..3dafa43f 100644
--- a/.github/workflows/LatestBuild.yml
+++ b/.github/workflows/LatestBuild.yml
@@ -17,6 +17,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Install nuget
uses: nuget/setup-nuget@v1
- name: Nuget restore
@@ -53,6 +55,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Build project
run: |
dotnet publish .\src\XmlFormatterOsIndependent\ -c Release -r win-x64 --self-contained true
@@ -82,6 +86,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Build project
run: |
dotnet publish .\src\XmlFormatterOsIndependent\ -c Release -r linux-x64 --self-contained true
@@ -111,6 +117,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v2
+ with:
+ lfs: true
- name: Build project
run: |
dotnet publish .\src\XmlFormatterOsIndependent\ -c Release -r osx-x64 --self-contained true
@@ -266,6 +274,7 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ env.REF_CHECKOUT_BRANCH }}
+ lfs: true
- name: Download artifacts
uses: actions/download-artifact@v2
with:
diff --git a/XmlFormatter.sln b/XmlFormatter.sln
index 1cfe41bb..df7b7ca6 100644
--- a/XmlFormatter.sln
+++ b/XmlFormatter.sln
@@ -3,12 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33414.496
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlFormatter", "src\XmlFormatter\XmlFormatter.csproj", "{0EAED5C3-DAB2-4919-9C26-EAD4D8222BD0}"
- ProjectSection(ProjectDependencies) = postProject
- {4FC9F80F-73AB-4647-8A7D-0F6284CD9258} = {4FC9F80F-73AB-4647-8A7D-0F6284CD9258}
- {CF65B491-2BA5-4F7A-968F-35E21DE5CC7D} = {CF65B491-2BA5-4F7A-968F-35E21DE5CC7D}
- EndProjectSection
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XmlFormatterModel", "src\XMLFormatterModel\XmlFormatterModel.csproj", "{F2245AAE-DFAF-41CC-8AF2-D3836B558847}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPlugin", "src\JsonPlugin\JsonPlugin.csproj", "{CF65B491-2BA5-4F7A-968F-35E21DE5CC7D}"
diff --git a/src/CorePlugin/CorePlugin.csproj b/src/CorePlugin/CorePlugin.csproj
index 606bb156..cbdd4728 100644
--- a/src/CorePlugin/CorePlugin.csproj
+++ b/src/CorePlugin/CorePlugin.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ net6.0
+ enable
@@ -18,4 +19,8 @@
+
+
+
+
diff --git a/src/JsonPlugin/JsonFormatter.cs b/src/JsonPlugin/JsonFormatter.cs
index 503dc654..7d41e66a 100644
--- a/src/JsonPlugin/JsonFormatter.cs
+++ b/src/JsonPlugin/JsonFormatter.cs
@@ -1,8 +1,8 @@
-using Newtonsoft.Json;
-using PluginFramework.DataContainer;
+using PluginFramework.DataContainer;
using PluginFramework.Formatter;
using System;
using System.IO;
+using System.Text.Json;
using System.Threading.Tasks;
namespace JsonPlugin
@@ -34,14 +34,14 @@ public JsonFormatter()
///
public override bool ConvertToFlat(string filePath, string outputName)
{
- FormatFile(filePath, outputName, Formatting.None);
+ FormatFile(filePath, outputName, false);
return true;
}
///
public override bool ConvertToFormatted(string filePath, string outputName)
{
- FormatFile(filePath, outputName, Formatting.Indented);
+ FormatFile(filePath, outputName, true);
return true;
}
@@ -51,7 +51,7 @@ public override bool ConvertToFormatted(string filePath, string outputName)
/// The input file to convert
/// The output file to generate
/// The save options to use
- private async void FormatFile(string inputFilePath, string outputName, Formatting formatting)
+ private async void FormatFile(string inputFilePath, string outputName, bool indent)
{
if (!IsFileReadableWriteable(inputFilePath, outputName))
{
@@ -60,13 +60,12 @@ private async void FormatFile(string inputFilePath, string outputName, Formattin
}
FireEvent("Loading", "Loading ...");
- object data = await Task