Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3dda0fbea9f246ca0420e13e1aca031fbf1e1245
Choose a base ref
..
head repository: KSP-CKAN/CKAN
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 46cc1082960af75db577ef12970cd9eba5d8590e
Choose a head ref
Showing 809 changed files with 19,469 additions and 14,996 deletions.
52 changes: 52 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[*.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

# Using `var` is good
dotnet_diagnostic.IDE0008.severity = none

# Don't need to enumerate every case for `switch` with `default`
dotnet_diagnostic.IDE0010.severity = none

# Don't "simplify" if statements that throw
dotnet_diagnostic.IDE0016.severity = none

# Expression bodies are good for methods
dotnet_diagnostic.IDE0022.severity = none

# Expression bodies are fine for operators
dotnet_diagnostic.IDE0024.severity = none

# Collection initialization simplification affects JObject, which is dumb
dotnet_diagnostic.IDE0028.severity = none

# "auto" properties seem pretty useless
dotnet_diagnostic.IDE0032.severity = none

# "local functions" are just weird, no thank you
dotnet_diagnostic.IDE0039.severity = none

# "if" statements should only be "simplified" if they're pure functional,
# and these checks don't know that
dotnet_diagnostic.IDE0045.severity = none
dotnet_diagnostic.IDE0046.severity = none
dotnet_diagnostic.IDE0270.severity = none

# We use "unnecessary" parentheses for clarity
dotnet_diagnostic.IDE0047.severity = none

# Let me keep my extra spaces for aligning things
dotnet_diagnostic.IDE0055.severity = none

# OK to call functions that return values and not use them
dotnet_diagnostic.IDE0058.severity = none

# A `using` inside a namespace is useful as a typedef
dotnet_diagnostic.IDE0065.severity = none

# Allow namespaces to be independent of folder names
dotnet_diagnostic.IDE0130.severity = none

# Who cares if it's a JSON formatted string, in a test?
dotnet_diagnostic.JSON002.severity = none
73 changes: 17 additions & 56 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,10 @@ on:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
types:
- opened
- synchronize
- reopened

jobs:
build:
@@ -14,8 +17,14 @@ jobs:
strategy:
fail-fast: false
matrix:
mono: ['6.8', '6.10', '6.12', 'latest']
configuration: [Debug, Release]
mono:
- latest
- '6.12'
- '6.10'
- '6.8'
configuration:
- Debug
- Release

container:
image: mono:${{ matrix.mono }}
@@ -27,6 +36,10 @@ jobs:
run: |
apt-get update || true
apt-get install -y apt-transport-https
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
- name: Installing build dependencies
run: apt-get update && apt-get install -y git
- name: Install runtime dependencies
@@ -66,7 +79,7 @@ jobs:
curl -O https://raw.githubusercontent.com/KSP-CKAN/NetKAN/master/NetKAN/ZeroMiniAVC.netkan && \
mono netkan.exe ZeroMiniAVC.netkan
"
if: matrix.configuration == 'release' && ( matrix.mono == '6.8' || matrix.mono == 'latest' )
if: matrix.configuration == 'release'

- name: Upload ckan.exe artifact
uses: actions/upload-artifact@v3
@@ -87,55 +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: '5.0.x'
- 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
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,10 @@ jobs:
echo 'odd_build=true' >> $GITHUB_OUTPUT
fi
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
- name: Installing build dependencies
run: apt-get update && apt-get install -y git make sed gzip fakeroot lintian dpkg-dev gpg createrepo
- name: Installing runtime dependencies
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -15,6 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7'
- name: Installing build dependencies
run: apt-get update && apt-get install -y git make sed libplist-utils xorriso gzip fakeroot lintian rpm wget jq dpkg-dev gpg createrepo
- name: Installing runtime dependencies
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"dotnet.preferCSharpExtension": false,
"dotnet.server.useOmnisharp": true,
"dotnet.defaultSolution": "CKAN.sln",
"dotnet.automaticallyCreateSolutionInWorkspace": false,
"dotnet.backgroundAnalysis.analyzerDiagnosticsScope": "fullSolution",
"dotnet.backgroundAnalysis.compilerDiagnosticsScope": "fullSolution",
"omnisharp.useModernNet": false,
"omnisharp.projectLoadTimeout": 600,
"python.defaultInterpreterPath": "py",
"files.watcherExclude": {
"**/_build/**": true
},
"nunitTestRunner.projectsPatterns": [
"_build/out/**/*.Tests.dll"
]
}
6 changes: 3 additions & 3 deletions AutoUpdate/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?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>
</configuration>
63 changes: 29 additions & 34 deletions AutoUpdate/CKAN-autoupdate.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project>
<Project>
<PropertyGroup>
<AssemblyName>CKAN-AutoUpdateHelper</AssemblyName>
<OutputPath>..\_build\out\$(AssemblyName)\$(Configuration)\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>
@@ -16,56 +18,49 @@
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7</LangVersion>
<ApplicationIcon>..\assets\ckan.ico</ApplicationIcon>
<TargetFramework>net45</TargetFramework>
<TargetFrameworkVersion>v4.5</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" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.18" />
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\_build\meta\GlobalAssemblyVersionInfo.cs">
<Link>Properties\GlobalAssemblyVersionInfo.cs</Link>
</Compile>
<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>
<Target Name="ILRepack" AfterTargets="Build">
<ItemGroup>
<InputAssemblies Include="fr-FR\$(AssemblyName).resources.dll" />
<InputAssemblies Include="it-IT\$(AssemblyName).resources.dll" />
<InputAssemblies Include="pl-PL\$(AssemblyName).resources.dll" />
<InputAssemblies Include="pt-BR\$(AssemblyName).resources.dll" />
<InputAssemblies Include="ru-RU\$(AssemblyName).resources.dll" />
</ItemGroup>
<ILRepack OutputAssembly="AutoUpdater.exe"
MainAssembly="$(AssemblyName).exe"
InputAssemblies="@(InputAssemblies)"
OutputType="$(OutputType)"
WorkingDirectory="$(OutputPath)"
Internalize="true"
Parallel="true" />
<ItemGroup>
<Repacked Include="$(OutputPath)AutoUpdater.*" />
</ItemGroup>
<Copy SourceFiles="@(Repacked)"
DestinationFolder="..\_build\repack\$(Configuration)" />
<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>
13 changes: 7 additions & 6 deletions AutoUpdate/Main.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
@@ -123,7 +123,7 @@ private static void StartCKAN(string path)
// Start CKAN
if (IsOnMono())
{
Process.Start("mono", String.Format("\"{0}\"", path));
Process.Start("mono", string.Format("\"{0}\"", path));
}
else
{
@@ -140,9 +140,10 @@ private static void MakeExecutable(string path)

string command = string.Format("+x \"{0}\"", path);

ProcessStartInfo permsinfo = new ProcessStartInfo("chmod", command);
permsinfo.UseShellExecute = false;
Process permsprocess = Process.Start(permsinfo);
var permsprocess = Process.Start(new ProcessStartInfo("chmod", command)
{
UseShellExecute = false
});
permsprocess.WaitForExit();
}
}
@@ -170,7 +171,7 @@ private static bool IsOnWindows()
/// </summary>
/// <param name="sender">Source of unhandled exception</param>
/// <param name="e">Info about the exception</param>
private static void UnhandledExceptionEventHandler(Object sender, UnhandledExceptionEventArgs e)
private static void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e)
{
ReportError(Properties.Resources.UnhandledException, e.ExceptionObject);
}
2 changes: 1 addition & 1 deletion AutoUpdate/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Resources;
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;

Loading