Skip to content

Commit

Permalink
Added the Elskom.Sdk .NET SDK to runtime repo.
Browse files Browse the repository at this point in the history
Signed-off-by: AraHaan <[email protected]>
  • Loading branch information
AraHaan committed Aug 25, 2024
1 parent a945019 commit a21447f
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ website/

# exclude security scanning results.
results.sarif
Elskom.Sdk/Sdk.props
11 changes: 11 additions & 0 deletions Elskom.Sdk/Elskom.Sdk.DefaultItems.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>

<ItemGroup>
<!-- .NET 9.0 -->
<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" />
<!-- .NET 8.0 -->
<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" />
<FrameworkReference Include="Elskom.Sdk.App" IsImplicitlyDefined="true" Pack="false" PrivateAssets="All" Condition="'$(ElskomSdkDisableImplicitFrameworkReference)' != 'true'" />
</ItemGroup>

</Project>
34 changes: 34 additions & 0 deletions Elskom.Sdk/Elskom.Sdk.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.Build.NoTargets" InitialTargets="WriteSdkPropsFile">

<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoPackageAnalysis>true</NoPackageAnalysis>
<PackageTags>GitBuildInformation;SettingsFile;zlib;BlowFish;Unluac;ZipAssembly;ReleasePackaging;MessageManager;GenericPluginLoader;MiniDump;PluginFramework;PluginUpdateCheck;GitBuildInfo</PackageTags>
<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>
<PackageReleaseNotes>Fixed issue where SDK might not add a known framework reference for projects that target the .NET 7 runtime.</PackageReleaseNotes>
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="*.in" />
<!-- If Sdk.props file exists, update it. -->
<!-- <None Update="Sdk.props" Pack="true" PackagePath="Sdk" Condition="Exists('Sdk.props')" /> -->
<None Include="Sdk.targets" Pack="true" PackagePath="Sdk" />
<None Include="Elskom.Sdk.DefaultItems.targets" Pack="true" PackagePath="Sdk" />
<None Include="../els_kom.png" Pack="true" PackagePath="Icon.png" Visible="false" />
</ItemGroup>

<Target Name="WriteSdkPropsFile">
<WriteLinesToFile
File="Sdk.props"
Lines="$([System.IO.File]::ReadAllText('Sdk.props.in').Replace('@SDK_VERSION@',$(Version)))"
Overwrite="true"
Encoding="Unicode"
WriteOnlyWhenDifferent="true" />

<ItemGroup>
<None Include="Sdk.props" Pack="true" PackagePath="Sdk" />
</ItemGroup>
</Target>

</Project>
98 changes: 98 additions & 0 deletions Elskom.Sdk/Sdk.props.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<Project>

<PropertyGroup Condition="'$(UsingMicrosoftNETSdk)' == ''">
<ElskomSdkMicrosoftNETSdkImported>true</ElskomSdkMicrosoftNETSdkImported>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" Condition="'$(UsingMicrosoftNETSdk)' == ''" />

<PropertyGroup>
<LangVersion>preview</LangVersion>
<EnforceCodeStyleInBuild Condition="'$(ProduceOnlyReferenceAssembly)' == ''">true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>preview</AnalysisLevel>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<!--
When DisableImplicitFrameworkReferences is true and ElskomSdkDisableImplicitFrameworkReference
is not set, then set it to true by default.
-->
<ElskomSdkDisableImplicitFrameworkReference Condition="'$(DisableImplicitFrameworkReferences)' == 'true' AND '$(ElskomSdkDisableImplicitFrameworkReference)' == ''">true</ElskomSdkDisableImplicitFrameworkReference>
<ElskomSdkFrameworkVersion Condition="'$(ElskomSdkFrameworkVersion)' == ''">@SDK_VERSION@</ElskomSdkFrameworkVersion>
</PropertyGroup>

<ItemGroup Condition="'$(ElskomSdkSkipImplicitPackages)' == ''">
<!-- Only add these analyzers when installed as an Sdk package from nuget. -->
<PackageReference
Include="SonarAnalyzer.CSharp"
IsImplicitlyDefined="true"
Version="*-*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference
Include="StyleCop.Analyzers"
IsImplicitlyDefined="true"
Version="*-*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference
Include="IDisposableAnalyzers"
IsImplicitlyDefined="true"
Version="*-*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!--
<PackageReference
Include="ReflectionAnalyzers"
IsImplicitlyDefined="true"
Version="*-*"
Condition="'$(ProduceOnlyReferenceAssembly)' == ''">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> -->
<!--
Generate code for resx files.
But not for code that targets WindowsDesktop as that needs a source generator
that supports binary resources in resx files.
-->
<PackageReference
Include="Microsoft.CodeAnalysis.ResxSourceGenerator"
IsImplicitlyDefined="true"
Version="*-*"
Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND '$(UseWPF)' != 'true' AND '$(UseWindowsForms)' != 'true'">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!--
For WindowsDesktop targeting applications, we need to use a special source generator that supports binary resource
files that are a part of the resx file.
-->
<PackageReference
Include="Meziantou.Framework.ResxSourceGenerator"
IsImplicitlyDefined="true"
Version="*-*"
Condition="'$(ProduceOnlyReferenceAssembly)' == '' AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<!-- Implicitly include Properties/Resources.resx file for source generation. -->
<AdditionalFiles
Include="Properties\Resources.resx"
Condition="Exists('Properties\Resources.resx')" />
<!-- Update implicitly included Properties/Resources.resx file for source generation when it exists inside of a WindowsDesktop application. -->
<AdditionalFiles
Update="Properties\Resources.resx"
Condition="Exists('Properties\Resources.resx') AND ('$(UseWPF)' == 'true' OR '$(UseWindowsForms)' == 'true')"
Namespace="$(RootNamespace).Properties"
ClassName="Resources" />
<!-- We need the source generator we created. -->
<PackageReference
Include="GitBuildInfo.SourceGenerator"
IsImplicitlyDefined="true"
Version="*-*"
Condition="'$(ProduceOnlyReferenceAssembly)' == ''">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions Elskom.Sdk/Sdk.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>

<Import Project="Elskom.Sdk.DefaultItems.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" Condition="'$(ElskomSdkMicrosoftNETSdkImported)' == 'true'" />

</Project>
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Runtime for the Elskom .NET SDK workload.

| Package | Version |
|:-------:|:-------:|
| Elskom.Sdk | [![NuGet Badge](https://buildstats.info/nuget/Elskom.Sdk?includePreReleases=true)](https://www.nuget.org/packages/Elskom.Sdk/)
| 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/) |
| 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/) |
| 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/) |
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<!-- This repo version -->
<MajorVersion>8</MajorVersion>
<MajorVersion>9</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
Expand Down
2 changes: 2 additions & 0 deletions pkg/bundle/Elskom.Sdk.App.Bundle.bundleproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives"> <!-- Condition="$([MSBuild]::IsOSPlatform('Linux'))"> -->
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<SdkPackReference Include="../../Elskom.Sdk/Elskom.Sdk.csproj" />
<BundleComponentReference Include="../sfx/Elskom.Sdk.App.Runtime.sfxproj">
<AdditionalProperties>RuntimeIdentifier=$(RuntimeIdentifier)</AdditionalProperties>
</BundleComponentReference>
Expand All @@ -46,6 +47,7 @@
<Target Name="PublishToDisk">
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />
<MSBuild Projects="@(BundleComponentReference)" Targets="PublishToDisk;Pack" Properties="OutputPath=$(OutputPath)" />
<MSBuild Projects="@(SdkPackReference)" Targets="Pack" Properties="OutputPath=$(ArtifactsShippingPackagesDir);Version=$(Version)" RemoveProperties="RuntimeIdentifier" />
</Target>

<Target Name="PublishSymbolsToDisk">
Expand Down
9 changes: 9 additions & 0 deletions runtime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "installer", "installer", "{
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "installers", "pkg\installer\installers.csproj", "{B9065E22-3A4C-4A38-BD46-330CD60F094F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sdk", "Sdk", "{5212A248-77A1-49A4-9E86-0FAADEAE6042}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elskom.Sdk", "Elskom.Sdk\Elskom.Sdk.csproj", "{1C37BC41-D636-44EC-8603-ADB356BC7B3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -166,6 +170,10 @@ Global
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9065E22-3A4C-4A38-BD46-330CD60F094F}.Release|Any CPU.Build.0 = Release|Any CPU
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C37BC41-D636-44EC-8603-ADB356BC7B3F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -197,6 +205,7 @@ Global
{2D1878AD-8A11-4F56-9E3A-58ABDAAEA292} = {E5605BA8-4F46-4B1F-AB27-C5DA07FED9C5}
{611B9497-B82A-4C65-91E7-7C54F1E52CF4} = {20C33D3B-3412-40EB-8284-C4979AD2F390}
{B9065E22-3A4C-4A38-BD46-330CD60F094F} = {611B9497-B82A-4C65-91E7-7C54F1E52CF4}
{1C37BC41-D636-44EC-8603-ADB356BC7B3F} = {5212A248-77A1-49A4-9E86-0FAADEAE6042}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AE022F12-D088-439B-8AD2-EAAF2FE7C6C0}
Expand Down

0 comments on commit a21447f

Please sign in to comment.