Skip to content

Commit

Permalink
dotnet build with multi-targeting
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Nov 25, 2023
1 parent 0a97717 commit eca8868
Show file tree
Hide file tree
Showing 132 changed files with 1,206 additions and 4,235 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[*.cs]
dotnet_code_quality.enable_platform_analyzer_on_pre_net5_target = true
dotnet_analyzer_diagnostic.category-Style.severity = warning
dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning

Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,57 +100,3 @@ jobs:
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash


build_NetCore:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
configuration:
- Debug_NetCore
- Release_NetCore

steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
- name: Restore cache for _build/tools
uses: actions/cache@v3
with:
path: _build/tools
key: build-tools-${{ hashFiles('build', 'build.ps1', 'build.cake') }}
- name: Restore cache for _build/cake
uses: actions/cache@v3
with:
path: _build/cake
key: build-cake-${{ hashFiles('build.cake') }}
- name: Restore cache for _build/lib/nuget
uses: actions/cache@v3
with:
path: _build/lib/nuget
key: nuget-oldref-modules-${{ hashFiles('**/packages.config') }}-${{ hashFiles('**/*.csproj') }}
- name: Restore cache for ~/.nuget/packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: nuget-packref-modules-${{ hashFiles('**/packages.config') }}-${{ hashFiles('**/*.csproj') }}

- name: Build with .NET Core
run: ./build --configuration=${{ matrix.configuration }}
- name: Test with .NET Core
run: ./build test+only --configuration=${{ matrix.configuration }}

- name: Send Discord Notification
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ failure() && env.WEBHOOK_URL }}
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
2 changes: 1 addition & 1 deletion AutoUpdate/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</configuration>
36 changes: 27 additions & 9 deletions AutoUpdate/CKAN-autoupdate.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project>
<PropertyGroup>
<AssemblyName>CKAN-AutoUpdateHelper</AssemblyName>
<OutputPath Condition=" '$(MSBuildRuntimeType)' != 'Core' ">..\_build\out\$(AssemblyName)\$(Configuration)\bin\</OutputPath>
<OutputPath Condition=" '$(MSBuildRuntimeType)' == 'Core' ">..\_build\out\$(AssemblyName)\VSCodeIDE\bin\</OutputPath>
<BaseIntermediateOutputPath>..\_build\out\$(AssemblyName)\$(Configuration)\obj\</BaseIntermediateOutputPath>
<OutputPath Condition=" '$(Configuration)' != '' ">..\_build\out\$(AssemblyName)\$(Configuration)\bin\</OutputPath>
<OutputPath Condition=" '$(Configuration)' == '' ">..\_build\out\$(AssemblyName)\VSCodeIDE\bin\</OutputPath>
<BaseIntermediateOutputPath Condition=" '$(Configuration)' != '' ">..\_build\out\$(AssemblyName)\$(Configuration)\obj\</BaseIntermediateOutputPath>
<BaseIntermediateOutputPath Condition=" '$(Configuration)' == '' ">..\_build\out\$(AssemblyName)\VSCodeIDE\obj\</BaseIntermediateOutputPath>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
Expand All @@ -17,14 +18,15 @@
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFramework>net48</TargetFramework>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworks>net48;net7.0-windows</TargetFrameworks>
<UseWindowsForms Condition=" '$(TargetFramework)' == 'net7.0-windows' ">true</UseWindowsForms>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>IDE1006</NoWarn>
<CoreCompileDependsOn>PrepareResources;$(CompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
Expand All @@ -36,13 +38,29 @@
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>MSBuild:Compile</Generator>
<LastGenOutput>$(IntermediateOutputPath)Resources.Designer.cs</LastGenOutput>
<StronglyTypedFileName>$(IntermediateOutputPath)Resources.Designer.cs</StronglyTypedFileName>
<StronglyTypedLanguage>$(Language)</StronglyTypedLanguage>
<StronglyTypedNamespace>$(RootNamespace).Properties</StronglyTypedNamespace>
<StronglyTypedClassName>%(Filename)</StronglyTypedClassName>
</EmbeddedResource>
</ItemGroup>
<Target Name="UseOurResourceManager" AfterTargets="PrepareResources">
<WriteLinesToFile File="$(IntermediateOutputPath)Resources.Designer.cs"
Lines="$([System.IO.File]::ReadAllText('$(IntermediateOutputPath)Resources.Designer.cs').Replace('new global::System.Resources.ResourceManager', 'new SingleAssemblyResourceManager').Replace('internal', 'public'))"
Overwrite="true" />
</Target>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Target Name="BeforeBuild">
<Exec Command="powershell ../build.ps1 Generate-GlobalAssemblyVersionInfo" Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo" Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
<Target Name="MakeAssemblyInfo" BeforeTargets="BeforeBuild">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -Command &quot;.\build.ps1 Generate-GlobalAssemblyVersionInfo&quot;"
WorkingDirectory=".."
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Windows_NT'" />
<Exec Command="sh ../build Generate-GlobalAssemblyVersionInfo"
Condition="!Exists('../_build/meta/GlobalAssemblyVersionInfo.cs') And '$(OS)' == 'Unix'" />
</Target>
</Project>
82 changes: 0 additions & 82 deletions AutoUpdate/Properties/Resources.Designer.cs

This file was deleted.

33 changes: 13 additions & 20 deletions CKAN.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,58 +19,51 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_NetCore|Any CPU = Debug_NetCore|Any CPU
Debug|Any CPU = Debug|Any CPU
Release_NetCore|Any CPU = Release_NetCore|Any CPU
Release|Any CPU = Release|Any CPU
NoGUI|Any CPU = NoGUI|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Debug_NetCore|Any CPU.ActiveCfg = Debug_NetCore|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Debug_NetCore|Any CPU.Build.0 = Debug_NetCore|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Release_NetCore|Any CPU.ActiveCfg = Release_NetCore|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Release_NetCore|Any CPU.Build.0 = Release_NetCore|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.Release|Any CPU.Build.0 = Release|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Debug_NetCore|Any CPU.ActiveCfg = Debug|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{3B9AEA22-FA3B-4E43-9283-EABDD81CF271}.NoGUI|Any CPU.Build.0 = NoGUI|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Release_NetCore|Any CPU.ActiveCfg = Release|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.Release|Any CPU.Build.0 = Release|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Debug_NetCore|Any CPU.ActiveCfg = Debug|Any CPU
{E5B1C768-349E-4DAF-A134-56E4ECF1EEEF}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Release_NetCore|Any CPU.ActiveCfg = Release|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.Release|Any CPU.Build.0 = Release|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Debug_NetCore|Any CPU.ActiveCfg = Debug|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{E97D81F6-85E2-4F1F-906D-BE21766602E5}.NoGUI|Any CPU.Build.0 = NoGUI|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Release_NetCore|Any CPU.ActiveCfg = Release|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.Release|Any CPU.Build.0 = Release|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Debug_NetCore|Any CPU.ActiveCfg = Debug|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{DA5C7023-9A3B-4204-AE2F-BBA6C388B436}.NoGUI|Any CPU.Build.0 = NoGUI|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Release_NetCore|Any CPU.ActiveCfg = Release|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.Release|Any CPU.Build.0 = Release|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Debug_NetCore|Any CPU.ActiveCfg = Debug|Any CPU
{A79F9D54-315C-472B-928F-713A5860B2BE}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Release_NetCore|Any CPU.ActiveCfg = Release|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.Release|Any CPU.Build.0 = Release|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Debug_NetCore|Any CPU.ActiveCfg = Debug_NetCore|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Debug_NetCore|Any CPU.Build.0 = Debug_NetCore|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{4336F356-33DB-442A-BF74-5E89AF47A5B9}.NoGUI|Any CPU.Build.0 = NoGUI|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Release_NetCore|Any CPU.ActiveCfg = Release_NetCore|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Release_NetCore|Any CPU.Build.0 = Release_NetCore|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.Release|Any CPU.Build.0 = Release|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.NoGUI|Any CPU.ActiveCfg = NoGUI|Any CPU
{4F41255E-8BC1-465B-82D5-1C5665BC099A}.NoGUI|Any CPU.Build.0 = NoGUI|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
20 changes: 10 additions & 10 deletions Cmdline/Action/Show.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,43 +258,43 @@ private int ShowMod(CkanModule module, ShowOptions opts)
user.RaiseMessage(Properties.Resources.ShowResourcesHeader);
if (module.resources.homepage != null)
{
user.RaiseMessage(Properties.Resources.ShowHomePage, Uri.EscapeUriString(module.resources.homepage.ToString()));
user.RaiseMessage(Properties.Resources.ShowHomePage, Uri.EscapeDataString(module.resources.homepage.ToString()));
}
if (module.resources.manual != null)
{
user.RaiseMessage(Properties.Resources.ShowManual, Uri.EscapeUriString(module.resources.manual.ToString()));
user.RaiseMessage(Properties.Resources.ShowManual, Uri.EscapeDataString(module.resources.manual.ToString()));
}
if (module.resources.spacedock != null)
{
user.RaiseMessage(Properties.Resources.ShowSpaceDock, Uri.EscapeUriString(module.resources.spacedock.ToString()));
user.RaiseMessage(Properties.Resources.ShowSpaceDock, Uri.EscapeDataString(module.resources.spacedock.ToString()));
}
if (module.resources.repository != null)
{
user.RaiseMessage(Properties.Resources.ShowRepository, Uri.EscapeUriString(module.resources.repository.ToString()));
user.RaiseMessage(Properties.Resources.ShowRepository, Uri.EscapeDataString(module.resources.repository.ToString()));
}
if (module.resources.bugtracker != null)
{
user.RaiseMessage(Properties.Resources.ShowBugTracker, Uri.EscapeUriString(module.resources.bugtracker.ToString()));
user.RaiseMessage(Properties.Resources.ShowBugTracker, Uri.EscapeDataString(module.resources.bugtracker.ToString()));
}
if (module.resources.curse != null)
{
user.RaiseMessage(Properties.Resources.ShowCurse, Uri.EscapeUriString(module.resources.curse.ToString()));
user.RaiseMessage(Properties.Resources.ShowCurse, Uri.EscapeDataString(module.resources.curse.ToString()));
}
if (module.resources.store != null)
{
user.RaiseMessage(Properties.Resources.ShowStore, Uri.EscapeUriString(module.resources.store.ToString()));
user.RaiseMessage(Properties.Resources.ShowStore, Uri.EscapeDataString(module.resources.store.ToString()));
}
if (module.resources.steamstore != null)
{
user.RaiseMessage(Properties.Resources.ShowSteamStore, Uri.EscapeUriString(module.resources.steamstore.ToString()));
user.RaiseMessage(Properties.Resources.ShowSteamStore, Uri.EscapeDataString(module.resources.steamstore.ToString()));
}
if (module.resources.remoteAvc != null)
{
user.RaiseMessage(Properties.Resources.ShowVersionFile, Uri.EscapeUriString(module.resources.remoteAvc.ToString()));
user.RaiseMessage(Properties.Resources.ShowVersionFile, Uri.EscapeDataString(module.resources.remoteAvc.ToString()));
}
if (module.resources.remoteSWInfo != null)
{
user.RaiseMessage(Properties.Resources.ShowSpaceWarpInfo, Uri.EscapeUriString(module.resources.remoteSWInfo.ToString()));
user.RaiseMessage(Properties.Resources.ShowSpaceWarpInfo, Uri.EscapeDataString(module.resources.remoteSWInfo.ToString()));
}
}

Expand Down
Loading

0 comments on commit eca8868

Please sign in to comment.