Skip to content

Commit 955e94f

Browse files
authored
Added the Elskom.Sdk .NET SDK to runtime repo. (#312)
Signed-off-by: AraHaan <[email protected]>
1 parent a945019 commit 955e94f

File tree

9 files changed

+163
-1
lines changed

9 files changed

+163
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ website/
1919

2020
# exclude security scanning results.
2121
results.sarif
22+
Elskom.Sdk/Sdk.props
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<!-- .NET 9.0 -->
5+
<KnownFrameworkReference Include="Elskom.Sdk.App" TargetFramework="net9.0" RuntimeFrameworkName="Elskom.Sdk.App" DefaultRuntimeFrameworkVersion="$(ElskomSdkFrameworkVersion)" LatestRuntimeFrameworkVersion="$(ElskomSdkFrameworkVersion)" TargetingPackName="Elskom.Sdk.App.Ref" TargetingPackVersion="$(ElskomSdkFrameworkVersion)" RuntimePackNamePatterns="Elskom.Sdk.App.Runtime.**RID**" RuntimePackRuntimeIdentifiers="win-x86;win-x64;win-arm64;linux-x64;linux-arm;linux-arm64;osx-x64;osx-arm64" IsTrimmable="true" />
6+
<!-- .NET 8.0 -->
7+
<KnownFrameworkReference Include="Elskom.Sdk.App" TargetFramework="net8.0" RuntimeFrameworkName="Elskom.Sdk.App" DefaultRuntimeFrameworkVersion="$(ElskomSdkFrameworkVersion)" LatestRuntimeFrameworkVersion="$(ElskomSdkFrameworkVersion)" TargetingPackName="Elskom.Sdk.App.Ref" TargetingPackVersion="$(ElskomSdkFrameworkVersion)" RuntimePackNamePatterns="Elskom.Sdk.App.Runtime.**RID**" RuntimePackRuntimeIdentifiers="win-x86;win-x64;win-arm64;linux-x64;linux-arm;linux-arm64;osx-x64;osx-arm64" IsTrimmable="true" />
8+
<FrameworkReference Include="Elskom.Sdk.App" IsImplicitlyDefined="true" Pack="false" PrivateAssets="All" Condition="'$(ElskomSdkDisableImplicitFrameworkReference)' != 'true'" />
9+
</ItemGroup>
10+
11+
</Project>

Elskom.Sdk/Elskom.Sdk.csproj

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.Build.NoTargets" InitialTargets="WriteSdkPropsFile">
2+
3+
<PropertyGroup>
4+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
5+
<NoPackageAnalysis>true</NoPackageAnalysis>
6+
<PackageTags>GitBuildInformation;SettingsFile;zlib;BlowFish;Unluac;ZipAssembly;ReleasePackaging;MessageManager;GenericPluginLoader;MiniDump;PluginFramework;PluginUpdateCheck;GitBuildInfo</PackageTags>
7+
<Description>Elskom SDK for development of Els_kom plugins and for Els_kom itself. Also contains libs that can be used for other projects as well.</Description>
8+
<PackageReleaseNotes>Fixed issue where SDK might not add a known framework reference for projects that target the .NET 7 runtime.</PackageReleaseNotes>
9+
<NoWarn>$(NoWarn);NU1507</NoWarn>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<None Include="*.in" />
14+
<!-- If Sdk.props file exists, update it. -->
15+
<!-- <None Update="Sdk.props" Pack="true" PackagePath="Sdk" Condition="Exists('Sdk.props')" /> -->
16+
<None Include="Sdk.targets" Pack="true" PackagePath="Sdk" />
17+
<None Include="Elskom.Sdk.DefaultItems.targets" Pack="true" PackagePath="Sdk" />
18+
<None Include="../els_kom.png" Pack="true" PackagePath="Icon.png" Visible="false" />
19+
</ItemGroup>
20+
21+
<Target Name="WriteSdkPropsFile">
22+
<WriteLinesToFile
23+
File="Sdk.props"
24+
Lines="$([System.IO.File]::ReadAllText('Sdk.props.in').Replace('@SDK_VERSION@',$(Version)))"
25+
Overwrite="true"
26+
Encoding="Unicode"
27+
WriteOnlyWhenDifferent="true" />
28+
29+
<ItemGroup>
30+
<None Include="Sdk.props" Pack="true" PackagePath="Sdk" />
31+
</ItemGroup>
32+
</Target>
33+
34+
</Project>

Elskom.Sdk/Sdk.props.in

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<Project>
2+
3+
<PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == ''">
4+
<ElskomSdkMicrosoftNETSdkImported>true</ElskomSdkMicrosoftNETSdkImported>
5+
</PropertyGroup>
6+
7+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition="'$(UsingMicrosoftNETSdk)' == ''" />
8+
9+
<PropertyGroup>
10+
<LangVersion>preview</LangVersion>
11+
<EnforceCodeStyleInBuild Condition="'$(ProduceOnlyReferenceAssembly)' == ''">true</EnforceCodeStyleInBuild>
12+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
13+
<AnalysisLevel>preview</AnalysisLevel>
14+
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
15+
<!--
16+
When DisableImplicitFrameworkReferences is true and ElskomSdkDisableImplicitFrameworkReference
17+
is not set, then set it to true by default.
18+
-->
19+
<ElskomSdkDisableImplicitFrameworkReference Condition="'$(DisableImplicitFrameworkReferences)' == 'true' AND '$(ElskomSdkDisableImplicitFrameworkReference)' == ''">true</ElskomSdkDisableImplicitFrameworkReference>
20+
<ElskomSdkFrameworkVersion Condition="'$(ElskomSdkFrameworkVersion)' == ''">@SDK_VERSION@</ElskomSdkFrameworkVersion>
21+
</PropertyGroup>
22+
23+
<ItemGroup Condition="'$(ElskomSdkSkipImplicitPackages)' == ''">
24+
<!-- Only add these analyzers when installed as an Sdk package from nuget. -->
25+
<PackageReference
26+
Include="SonarAnalyzer.CSharp"
27+
IsImplicitlyDefined="true"
28+
Version="*-*">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31+
</PackageReference>
32+
<PackageReference
33+
Include="StyleCop.Analyzers"
34+
IsImplicitlyDefined="true"
35+
Version="*-*">
36+
<PrivateAssets>all</PrivateAssets>
37+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38+
</PackageReference>
39+
<PackageReference
40+
Include="IDisposableAnalyzers"
41+
IsImplicitlyDefined="true"
42+
Version="*-*">
43+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
44+
<PrivateAssets>all</PrivateAssets>
45+
</PackageReference>
46+
<!--
47+
<PackageReference
48+
Include="ReflectionAnalyzers"
49+
IsImplicitlyDefined="true"
50+
Version="*-*"
51+
Condition="'$(ProduceOnlyReferenceAssembly)' == ''">
52+
<PrivateAssets>all</PrivateAssets>
53+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
54+
</PackageReference> -->
55+
<!--
56+
Generate code for resx files.
57+
But not for code that targets WindowsDesktop as that needs a source generator
58+
that supports binary resources in resx files.
59+
-->
60+
<PackageReference
61+
Include="Microsoft.CodeAnalysis.ResxSourceGenerator"
62+
IsImplicitlyDefined="true"
63+
Version="*-*"
64+
Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND '$(UseWPF)' != 'true' AND '$(UseWindowsForms)' != 'true'">
65+
<PrivateAssets>all</PrivateAssets>
66+
</PackageReference>
67+
<!--
68+
For WindowsDesktop targeting applications, we need to use a special source generator that supports binary resource
69+
files that are a part of the resx file.
70+
-->
71+
<PackageReference
72+
Include="Meziantou.Framework.ResxSourceGenerator"
73+
IsImplicitlyDefined="true"
74+
Version="*-*"
75+
Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')">
76+
<PrivateAssets>all</PrivateAssets>
77+
</PackageReference>
78+
<!-- Implicitly include Properties/Resources.resx file for source generation. -->
79+
<AdditionalFiles
80+
Include="Properties\Resources.resx"
81+
Condition="Exists('Properties\Resources.resx')" />
82+
<!-- Update implicitly included Properties/Resources.resx file for source generation when it exists inside of a WindowsDesktop application. -->
83+
<AdditionalFiles
84+
Update="Properties\Resources.resx"
85+
Condition="Exists('Properties\Resources.resx') AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')"
86+
Namespace="$(RootNamespace).Properties"
87+
ClassName="Resources" />
88+
<!-- We need the source generator we created. -->
89+
<PackageReference
90+
Include="GitBuildInfo.SourceGenerator"
91+
IsImplicitlyDefined="true"
92+
Version="*-*"
93+
Condition="'$(ProduceOnlyReferenceAssembly)' == ''">
94+
<PrivateAssets>all</PrivateAssets>
95+
</PackageReference>
96+
</ItemGroup>
97+
98+
</Project>

Elskom.Sdk/Sdk.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
3+
<Import Project="Elskom.Sdk.DefaultItems.targets" />
4+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" Condition="'$(ElskomSdkMicrosoftNETSdkImported)' == 'true'" />
5+
6+
</Project>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Runtime for the Elskom .NET SDK workload.
55

66
| Package | Version |
77
|:-------:|:-------:|
8+
| Elskom.Sdk | [![NuGet Badge](https://buildstats.info/nuget/Elskom.Sdk?includePreReleases=true)](https://www.nuget.org/packages/Elskom.Sdk/)
89
| Elskom.Sdk.App.Runtime.win-x86 | [![NuGet Badge](https://buildstats.info/nuget/Elskom.Sdk.App.Runtime.win-x86?includePreReleases=true)](https://www.nuget.org/packages/Elskom.Sdk.App.Runtime.win-x86/) |
910
| Elskom.Sdk.App.Runtime.win-x64 | [![NuGet Badge](https://buildstats.info/nuget/Elskom.Sdk.App.Runtime.win-x64?includePreReleases=true)](https://www.nuget.org/packages/Elskom.Sdk.App.Runtime.win-x64/) |
1011
| Elskom.Sdk.App.Runtime.win-arm64 | [![NuGet Badge](https://buildstats.info/nuget/Elskom.Sdk.App.Runtime.win-arm64?includePreReleases=true)](https://www.nuget.org/packages/Elskom.Sdk.App.Runtime.win-arm64/) |

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<!-- This repo version -->
5-
<MajorVersion>8</MajorVersion>
5+
<MajorVersion>9</MajorVersion>
66
<MinorVersion>0</MinorVersion>
77
<PatchVersion>0</PatchVersion>
88
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>

pkg/bundle/Elskom.Sdk.App.Bundle.bundleproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives"> <!-- Condition="$([MSBuild]::IsOSPlatform('Linux'))"> -->
3636
<PrivateAssets>all</PrivateAssets>
3737
</PackageReference>
38+
<SdkPackReference Include="../../Elskom.Sdk/Elskom.Sdk.csproj" />
3839
<BundleComponentReference Include="../sfx/Elskom.Sdk.App.Runtime.sfxproj">
3940
<AdditionalProperties>RuntimeIdentifier=$(RuntimeIdentifier)</AdditionalProperties>
4041
</BundleComponentReference>
@@ -46,6 +47,7 @@
4647
<Target Name="PublishToDisk">
4748
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />
4849
<MSBuild Projects="@(BundleComponentReference)" Targets="PublishToDisk;Pack" Properties="OutputPath=$(OutputPath)" />
50+
<MSBuild Projects="@(SdkPackReference)" Targets="Pack" Properties="OutputPath=$(ArtifactsShippingPackagesDir);Version=$(Version)" RemoveProperties="RuntimeIdentifier" />
4951
</Target>
5052

5153
<Target Name="PublishSymbolsToDisk">

runtime.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "installer", "installer", "{
6060
EndProject
6161
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "installers", "pkg\installer\installers.csproj", "{B9065E22-3A4C-4A38-BD46-330CD60F094F}"
6262
EndProject
63+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sdk", "Sdk", "{5212A248-77A1-49A4-9E86-0FAADEAE6042}"
64+
EndProject
65+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elskom.Sdk", "Elskom.Sdk\Elskom.Sdk.csproj", "{1C37BC41-D636-44EC-8603-ADB356BC7B3F}"
66+
EndProject
6367
Global
6468
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6569
Debug|Any CPU = Debug|Any CPU
@@ -166,6 +170,10 @@ Global
166170
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Debug|Any CPU.Build.0 = Debug|Any CPU
167171
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Release|Any CPU.ActiveCfg = Release|Any CPU
168172
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Release|Any CPU.Build.0 = Release|Any CPU
173+
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
174+
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
175+
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
176+
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Release|Any CPU.Build.0 = Release|Any CPU
169177
EndGlobalSection
170178
GlobalSection(SolutionProperties) = preSolution
171179
HideSolutionNode = FALSE
@@ -197,6 +205,7 @@ Global
197205
{2D1878AD-8A11-4F56-9E3A-58ABDAAEA292} = {E5605BA8-4F46-4B1F-AB27-C5DA07FED9C5}
198206
{611B9497-B82A-4C65-91E7-7C54F1E52CF4} = {20C33D3B-3412-40EB-8284-C4979AD2F390}
199207
{B9065E22-3A4C-4A38-BD46-330CD60F094F} = {611B9497-B82A-4C65-91E7-7C54F1E52CF4}
208+
{1C37BC41-D636-44EC-8603-ADB356BC7B3F} = {5212A248-77A1-49A4-9E86-0FAADEAE6042}
200209
EndGlobalSection
201210
GlobalSection(ExtensibilityGlobals) = postSolution
202211
SolutionGuid = {AE022F12-D088-439B-8AD2-EAAF2FE7C6C0}

0 commit comments

Comments
 (0)