Skip to content

Commit

Permalink
[BREAKING] upgrade to SDK project. #119
Browse files Browse the repository at this point in the history
  • Loading branch information
UlyssesWu committed Sep 13, 2024
1 parent 2256d09 commit c9d7839
Show file tree
Hide file tree
Showing 12 changed files with 143 additions and 907 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Package

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '4.8.x'

- name: Restore NuGet packages
run: nuget restore FreeMote.sln

- name: Build solution
run: msbuild FreeMote.sln /p:Configuration=Release

- name: Run post-build script
shell: pwsh
run: |
cd $env:GITHUB_WORKSPACE
mkdir FreeMoteToolkit -Force
Copy-Item FreeMote.Tools.EmtConvert/bin/Release/net48/* FreeMoteToolkit -Recurse -Force
Copy-Item FreeMote.Tools.PsbDecompile/bin/Release/net48/* FreeMoteToolkit -Recurse -Force
Copy-Item FreeMote.Tools.PsBuild/bin/Release/net48/* FreeMoteToolkit -Recurse -Force
Copy-Item FreeMote.Tools.EmtMake/bin/Release/net48/* FreeMoteToolkit -Recurse -Force
Copy-Item FreeMote.Tools.Viewer/bin/Release/net48/* FreeMoteToolkit -Recurse -Force
del FreeMoteToolkit\*.pdb
del FreeMoteToolkit\*.xml
mkdir FreeMoteToolkit\lib -Force
Move-Item FreeMoteToolkit/*.dll FreeMoteToolkit/lib
Move-Item FreeMoteToolkit/x86 FreeMoteToolkit/lib/
Move-Item FreeMoteToolkit/x64 FreeMoteToolkit/lib/
7z a FreeMote.zip FreeMoteToolkit\*
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: FreeMote
path: FreeMote.zip
71 changes: 11 additions & 60 deletions FreeMote.Plugins.x64/FreeMote.Plugins.x64.csproj
Original file line number Diff line number Diff line change
@@ -1,79 +1,30 @@
<?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')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7B5BAE81-6779-4404-9E6E-512BE4471AB9}</ProjectGuid>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FreeMote.Plugins</RootNamespace>
<AssemblyName>FreeMote.Plugins.x64</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</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>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>default</LangVersion>
</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>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<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="Images\TlgFormatter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Shells\MflShell.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FreeMote.FastLz">
<Version>1.1.0</Version>
</PackageReference>
<PackageReference Include="FreeMote.Tlg">
<Version>0.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj">
<Project>{C0B2C2FF-D8F4-497E-8312-C2AF1BB6E7F7}</Project>
<Name>FreeMote.Psb</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote\FreeMote.csproj">
<Project>{D43CA425-6476-4AE3-A3D8-BBCAC0F0383C}</Project>
<Name>FreeMote</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj" />
<ProjectReference Include="..\FreeMote\FreeMote.csproj" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.PsbDecompile\$(OutDir)" /E /Y
<PostBuildEvent>echo https://github.com/dotnet/project-system/issues/1569#issuecomment-289939906
xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.PsbDecompile\$(OutDir)" /E /Y
xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.PsBuild\$(OutDir)" /E /Y
xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.EmtConvert\$(OutDir)" /E /Y
xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.EmtMake\$(OutDir)" /E /Y</PostBuildEvent>
Expand Down
106 changes: 11 additions & 95 deletions FreeMote.Plugins/FreeMote.Plugins.csproj
Original file line number Diff line number Diff line change
@@ -1,106 +1,20 @@
<?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')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F37472B9-6501-440E-8898-7774304F7FEC}</ProjectGuid>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FreeMote.Plugins</RootNamespace>
<AssemblyName>FreeMote.Plugins</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</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>
<LangVersion>default</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</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>
<LangVersion>default</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Audio\At9Formatter.cs" />
<Compile Include="Audio\NxAdpcmFormatter.cs" />
<Compile Include="Audio\OpusFormatter.cs" />
<Compile Include="Audio\VagFile.cs" />
<Compile Include="Audio\VagFormatter.cs" />
<Compile Include="Audio\XwmaFormatter.cs" />
<Compile Include="Images\AstcFormatter.cs" />
<Compile Include="Images\Bc7Formatter.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Shells\Lz4Shell.cs" />
<Compile Include="Shells\MdfShell.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Shells\MxbShell.cs" />
<Compile Include="Shells\MzsShell.cs" />
<Compile Include="Shells\PsdShell.cs" />
<Compile Include="Shells\PspShell.cs" />
<Compile Include="Shells\PszShell.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj">
<Project>{C0B2C2FF-D8F4-497E-8312-C2AF1BB6E7F7}</Project>
<Name>FreeMote.Psb</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote\FreeMote.csproj">
<Project>{D43CA425-6476-4AE3-A3D8-BBCAC0F0383C}</Project>
<Name>FreeMote</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj" />
<ProjectReference Include="..\FreeMote\FreeMote.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BCnEncoder.NetStd">
Expand All @@ -115,6 +29,9 @@
<PackageReference Include="K4os.Compression.LZ4.Streams">
<Version>1.3.8</Version>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="VGAudio">
<Version>2.2.1-CI00002</Version>
</PackageReference>
Expand All @@ -123,14 +40,13 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<PropertyGroup>
<PostBuildEvent>echo There is a bug that some nuget package dll may not have edit date so it won't be copied. If it happens, remove /D and try again.
xcopy "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)FreeMote.Tools.PsbDecompile\$(OutDir)" /E /Y
Expand Down
65 changes: 8 additions & 57 deletions FreeMote.PsBuild/FreeMote.PsBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,75 +1,27 @@
<?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')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{717A63DE-E599-4134-92AB-40A17C326DA3}</ProjectGuid>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FreeMote.PsBuild</RootNamespace>
<AssemblyName>FreeMote.PsBuild</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UserSecretsId>5118e00b-0de7-4935-9013-b6ebe83c8397</UserSecretsId>
</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>
<LangVersion>default</LangVersion>
</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>
<LangVersion>default</LangVersion>
<DocumentationFile>bin\Release\FreeMote.PsBuild.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MmoCompiler.cs" />
<Compile Include="MmoBuilder.cs" />
<Compile Include="MmoTypes.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<Compile Update="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="PsbCompiler.cs" />
<Compile Include="PsbDecompiler.cs" />
<Compile Include="PsBuildHelper.cs" />
<Compile Include="PsbResourceJson.cs" />
<Compile Include="PsbJsonConverter.cs" />
<Compile Include="PsbSpecConverter.cs" />
<Compile Include="Converters\CommonWinConverter.cs" />
<Compile Include="Converters\ISpecConverter.cs" />
<Compile Include="Converters\Krkr2CommonConverter.cs" />
<Compile Include="Converters\Common2KrkrConverter.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj">
<Project>{c0b2c2ff-d8f4-497e-8312-c2af1bb6e7f7}</Project>
<Name>FreeMote.Psb</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote\FreeMote.csproj">
<Project>{d43ca425-6476-4ae3-a3d8-bbcac0f0383c}</Project>
<Name>FreeMote</Name>
</ProjectReference>
<ProjectReference Include="..\FreeMote.Psb\FreeMote.Psb.csproj" />
<ProjectReference Include="..\FreeMote\FreeMote.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
Expand All @@ -80,10 +32,9 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit c9d7839

Please sign in to comment.