-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from XanatosX/develop
Version 0.0.8
- Loading branch information
Showing
78 changed files
with
3,431 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
**What is this Pull-Request about** | ||
|
||
What did get fixed. | ||
What was extended or implemented. | ||
What did you change. | ||
|
||
**What issue is this Pull-Request solving** | ||
|
||
As example type `closes #` or `fixing #`. | ||
|
||
** How hat this been tested? ** | ||
|
||
Which tests did you run to verify your changes? | ||
|
||
* [x] Test A | ||
* [ ] Test B | ||
|
||
** Checklist ** | ||
|
||
* [ ] **IMPORTANT** I have checked that this pull request is targeting the develop branch | ||
* [ ] I have reviewed my code | ||
* [ ] I have added all the required summary tests | ||
* [ ] I have reviewed my code | ||
* [ ] I have added all the required summary blocks to my classes, methods and variables/fields | ||
|
||
**Special information required for reviewing or testing** | ||
|
||
Write down any special information the reviewer could need for his or her review or any information to test this Pull-Request. | ||
|
||
Please write comments on the `changed files` tab to the code if you want to explain something more into detail to the reviewers. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Check pull request | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Check pull request | ||
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.0 | ||
- name: Build project | ||
run: msbuild /t:Build /p:Configuration=Release | ||
shell: powershell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Live build | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
name: Create live versioned build artifact | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- name: Get Current Tag | ||
run: echo "::set-env name=tag::$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | ||
- name: Install NuGet | ||
uses: nuget/setup-nuget@v1 | ||
- name: Install msbuild | ||
uses: microsoft/setup-msbuild@v1.0.0 | ||
- name: Build Project | ||
run: | | ||
nuget restore | ||
echo $env:tag > .\XmlFormatter\Version.txt | ||
msbuild /t:Build /p:Configuration=Release | ||
shell: powershell | ||
- name: Create Artifacts | ||
run: | | ||
$xmlFormatter = -join($env:tag, "_XmlFormatter.zip") | ||
$jsonPlugin = -join($env:tag, "_JsonPlugin.zip") | ||
echo "::set-env name=xmlFormatter::$($xmlFormatter)" | ||
echo "::set-env name=jsonPlugin::$($JsonPlugin)" | ||
mkdir ..\Artifacts | ||
mkdir ..\Artifacts\XmlFormatter\ | ||
mkdir ..\Artifacts\JsonPlugin\ | ||
mv .\XmlFormatter\bin\Release\** ..\Artifacts\XmlFormatter\ | ||
mv LICENSE ..\Artifacts\XmlFormatter\ | ||
cd ..\Artifacts\ | ||
mv .\XmlFormatter\Plugins\*Json*.dll .\JsonPlugin\ | ||
7z a $xmlFormatter .\XmlFormatter\** | ||
7z a $jsonPlugin .\JsonPlugin\** | ||
shell: powershell | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release - ${{ env.tag }} | ||
body: Body goes here! | ||
draft: true | ||
prerelease: false | ||
- name: Upload XmlFormatter Release Asset | ||
id: upload-application-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ..\Artifacts\${{ env.xmlFormatter }} | ||
asset_name: ${{ env.xmlFormatter }} | ||
asset_content_type: application/zip | ||
- name: Upload JsonPlugin Release Asset | ||
id: upload-plugin-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ..\Artifacts\${{ env.jsonPlugin }} | ||
asset_name: ${{ env.jsonPlugin }} | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Latest unstable build | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
build: | ||
if: github.event.pull_request.merged == true | ||
name: Create latest build artifact | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: develop | ||
- name: Install nuget | ||
uses: nuget/setup-nuget@v1 | ||
- name: Setup msbuild | ||
uses: microsoft/setup-msbuild@v1.0.0 | ||
- name: Build project | ||
run: | | ||
nuget restore | ||
msbuild /t:Build /p:Configuration=Release | ||
shell: powershell | ||
- name: Create artifacts | ||
run: | | ||
mkdir ..\Artifacts | ||
mkdir ..\Artifacts\XmlFormatter\ | ||
mkdir ..\Artifacts\JsonPlugin\ | ||
mv .\XmlFormatter\bin\Release\** ..\Artifacts\XmlFormatter\ | ||
mv LICENSE ..\Artifacts\XmlFormatter\ | ||
cd ..\Artifacts\ | ||
mv .\XmlFormatter\Plugins\*Json*.dll .\JsonPlugin\ | ||
7z a LatestDevelopment_XmlFormatter.zip .\XmlFormatter\** | ||
7z a LatestDevelopment_JsonPlugin.zip .\JsonPlugin\** | ||
shell: powershell | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }}-${{ GITHUB.RUN_NUMBER }} | ||
release_name: Latest unstable | ||
body: You cannot update this version from within the application! | ||
draft: false | ||
prerelease: true | ||
- name: Upload XmlFormatter Release Asset | ||
id: upload-application-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ..\Artifacts\LatestDevelopment_XmlFormatter.zip | ||
asset_name: LatestDevelopment_XmlFormatter.zip | ||
asset_content_type: application/zip | ||
- name: Upload Json Plugin Release Asset | ||
id: upload-plugin-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ..\Artifacts\LatestDevelopment_JsonPlugin.zip | ||
asset_name: LatestDevelopment_JsonPlugin.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3E81CFB2-ADEE-4B81-BC13-F6CE8546F9C9}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>CorePlugin</RootNamespace> | ||
<AssemblyName>CorePlugin</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Octokit, Version=0.47.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Octokit.0.47.0\lib\net46\Octokit.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="src\Formatter\XmlFormatterProvider.cs" /> | ||
<Compile Include="src\Updating\DownloadGitHubReleaseStrategy.cs" /> | ||
<Compile Include="src\Updating\OpenGitHubReleasesStrategy.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\PluginFramework\PluginFramework.csproj"> | ||
<Project>{9808f069-6dc1-4c26-a434-16630fc697e8}</Project> | ||
<Name>PluginFramework</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("CorePlugin")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("CorePlugin")] | ||
[assembly: AssemblyCopyright("Copyright © 2020")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("3e81cfb2-adee-4b81-bc13-f6ce8546f9c9")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Octokit" version="0.47.0" targetFramework="net472" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using PluginFramework.src.DataContainer; | ||
using PluginFramework.src.Formatter; | ||
using System; | ||
using System.Threading.Tasks; | ||
using System.Xml.Linq; | ||
|
||
namespace CorePlugin.src.Formatter | ||
{ | ||
/// <summary> | ||
/// A xml formatter class instance | ||
/// </summary> | ||
class XmlFormatterProvider : BaseFormatter | ||
{ | ||
/// <summary> | ||
/// Create a new instance of this class | ||
/// </summary> | ||
public XmlFormatterProvider() : base("xml", new PluginInformation("Xml Formatter", "Convert xml files", "XanatosX", new Version(1, 0))) | ||
{ | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool ConvertToFlat(string filePath, string outputName) | ||
{ | ||
FormatFile(filePath, outputName, SaveOptions.DisableFormatting); | ||
return true; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override bool ConvertToFormatted(string filePath, string outputName) | ||
{ | ||
FormatFile(filePath, outputName, SaveOptions.None); | ||
return true; | ||
} | ||
|
||
/// <summary> | ||
/// This method will convert the file | ||
/// </summary> | ||
/// <param name="inputFilePath">The input file to convert</param> | ||
/// <param name="outputName">The output file to generate</param> | ||
/// <param name="options">The save options to use</param> | ||
private async void FormatFile(string inputFilePath, string outputName, SaveOptions options) | ||
{ | ||
if (!IsFileReadableWriteable(inputFilePath, outputName)) | ||
{ | ||
FireEvent("Saving failed", "Files where locked!"); | ||
return; | ||
} | ||
|
||
FireEvent("Loading", "Loading ..."); | ||
XElement fileToConvert = await Task<XElement>.Run(() => | ||
{ | ||
XElement returnElement; | ||
try | ||
{ | ||
returnElement = XElement.Load(inputFilePath); | ||
} | ||
catch (Exception) | ||
{ | ||
FireEvent("Input file not valid", "The input file was not valid!"); | ||
returnElement = null; | ||
} | ||
return returnElement; | ||
}); | ||
|
||
if (fileToConvert == null) | ||
{ | ||
return; | ||
} | ||
|
||
FireEvent("Saving", "Saving ..."); | ||
bool saveSuccess = await Task<bool>.Run(() => | ||
{ | ||
try | ||
{ | ||
fileToConvert.Save(outputName, options); | ||
return true; | ||
} | ||
catch (Exception) | ||
{ | ||
FireEvent("Saving did fail", "Saving went wrong, maybe the file was used?"); | ||
return false; | ||
} | ||
}); | ||
|
||
if (saveSuccess) | ||
{ | ||
FireEvent("Done", "Saving done!"); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.