Skip to content

Commit

Permalink
Adding Sdk.Web & Sdk.WebAssembly
Browse files Browse the repository at this point in the history
  • Loading branch information
dgmjr committed Jun 10, 2024
1 parent c936f30 commit e0fd96a
Show file tree
Hide file tree
Showing 10 changed files with 289 additions and 5 deletions.
100 changes: 100 additions & 0 deletions src/DgmjrSdk.Web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<!--
* DgmjrSdk.csproj
* Created: 2023-12-21T23:17:07-05:00
* Modified: 2024-04-30T19:56:29-04:00
* Author: David G. Moore, Jr. <[email protected]>
* Copyright: © 2022 - 2024 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProjectGuid>EB008C4C-9C3A-4498-A19D-34A42B6E2CE1</ProjectGuid>
<ProjectTypeGuid>FAE04EC0-301F-11D3-BF4B-00C04F79EFBC</ProjectTypeGuid>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IsNuGetized>true</IsNuGetized>
<IsPackable>true</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(MSBuildThisFileDirectory)lib</OutputPath>
</PropertyGroup>
<PropertyGroup>
<Title>The DGMJR-IO SDK</Title>
<Description>The DGMJR-IO SDK is a collection of `.props` and `.targets` files that are used to build and package the DGMJR projects.</Description>
<!-- <TargetFrameworks>netstandard1.0;netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks> -->
<PackageId>$(MSbuildProjectName)</PackageId>
<LangVersion>preview</LangVersion>
<PackageType>MSBuildSdk</PackageType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeInSolutionFile>true</IncludeInSolutionFile>
<DevelopmentDependency>true</DevelopmentDependency>
<NoWarn>$(NoWarn);MSB4011</NoWarn>
<PackageIcon>icon.png</PackageIcon>
<IsUsingNETSDK>true</IsUsingNETSDK>
<!-- <PackageVersionOverride Condition="'$(PackageVersionOverride)' == '' And '$(Configuration)' != 'Local'">0.0.23</PackageVersionOverride> -->
</PropertyGroup>
<ItemGroup>
<PackageFile Include="./Assets/*" PackagePath="Assets/%(Filename)%(Extension)" />
<PackageFile Include="./Common/*.cs" PackagePath="Common/%(Filename)%(Extension)" />
<!-- <PackageFile Include="./Build/*.props" PackagePath="Build/%(Filename)%(Extension)" />
<PackageFile Include="./Build/*.targets" PackagePath="Build/%(Filename)%(Extension)" />
<PackageFile Include="./Build/Custom/*.*" PackagePath="Build/Custom/%(Filename)%(Extension)" />
<PackageFile Include="./BuildMultiTargeting/*" PackagePath="BuildMultiTargeting/%(Filename)%(Extension)" /> -->
<PackageFile Include="./Common/*.props" PackagePath="Common/%(Filename)%(Extension)" />
<PackageFile Include="./Targets/*.targets" PackagePath="Targets/%(Filename)%(Extension)" />
<!-- <PackageFile Include="./Build/Custom/*.*" PackagePath="Build/Custom/%(Filename)%(Extension)" /> -->
<!-- <PackageFile Include="./BuildMultiTargeting/*" PackagePath="BuildMultiTargeting/%(Filename)%(Extension)" /> -->
<PackageFile Include="./LICENSE.md" PackagePath="%(Filename)%(Extension)" />
<PackageFile Include="./Scripts/*" PackagePath="Scripts/%(Filename)%(Extension)" />
<PackageFile Include="./Sdk/Sdk.Web.props" PackagePath="Sdk/Sdk%(Extension)" />
<PackageFile Include="./Sdk/Sdk.Web.targets" PackagePath="Sdk/Sdk%(Extension)" />
<PackageFile Include="./Sdk/Common.*" PackagePath="Sdk/%(Filename)%(Extension)" />
<PackageFile Include="./lib/*.dll" PackagePath="lib/%(Filename)%(Extension)" />
<PackageFile Include="./lib/*.dll" Pack="true" PackagePath="lib/$(TargetFramework)/%(Filename)%(Extension)" />
<PackageFile Include="./lib/**/*.dll" Pack="true" PackagePath="lib/netstandard2.0/%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="PrepareGitConstants" />
<Target Name="GitInfo" />
<ItemGroup>
<PackageTag Include="sdk" Visible="false" />
<PackageTag Include="build-defaults" Visible="false" />
<PackageTag Include="dgmjrsdk" Visible="false" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="./LICENSE.md" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./README_TEMPLATE.md" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./frontmatter_template.yml" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./Assets/icon.png" LogicalName="DEFAULT_PACKAGE_ICON.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="YamlDotNet" />
<PackageReference Include="MSBuild.Usings" IncludeAssets="Build;BuildTransitive;BuildMultitargeting;Runtime;Compile" ExcludeAssets="ContentFiles;Native;Analyzers" PrivateAssets="None" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Using Include="System.Collections.Generic.IDictionary&lt;string,string&gt;" Alias="IStringDictionary" />
<Using Include="System.Collections.Generic.Dictionary&lt;string,string&gt;" Alias="StringDictionary" />
<Using Include="System.Collections.Generic.KeyValuePair&lt;string,string&gt;" Alias="StrKvp" />
<Using Include="Dgmjr.Sdk.Models" />
<Using Include="System.Text.RegularExpressions" />
<Using Include="System.String" Static="true" />
<Using Include="System.IO.File" Static="true" />
<Using Include="System.IO.Path" Static="true" />
<Using Include="Microsoft.Build.Framework" />
<Using Include="Microsoft.Build.Execution" />
<Using Include="System.Runtime.CompilerServices" />
<Using Include="System.Reflection" />
<Using Include="System.Diagnostics" />
<Using Include="System.Text.RegularExpressions" />
<Using Include="System.String" Static="true" />
<Using Include="System.IO.File" Static="true" />
<Using Include="System.IO.Path" Static="true" />
<Using Include="Microsoft.Build.Framework" />
<Using Include="Microsoft.Build.Execution" />
<Using Include="System.Runtime.CompilerServices" />
<Using Include="System.Reflection" />
<Using Include="System.Diagnostics" />
</ItemGroup>
</Project>
100 changes: 100 additions & 0 deletions src/DgmjrSdk.WebAssembly.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<!--
* DgmjrSdk.csproj
* Created: 2023-12-21T23:17:07-05:00
* Modified: 2024-04-30T19:56:29-04:00
* Author: David G. Moore, Jr. <[email protected]>
* Copyright: © 2022 - 2024 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProjectGuid>EB008C4C-9C3A-4498-A19D-34A42B6E2CE1</ProjectGuid>
<ProjectTypeGuid>FAE04EC0-301F-11D3-BF4B-00C04F79EFBC</ProjectTypeGuid>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IsNuGetized>true</IsNuGetized>
<IsPackable>true</IsPackable>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(MSBuildThisFileDirectory)lib</OutputPath>
</PropertyGroup>
<PropertyGroup>
<Title>The DGMJR-IO SDK</Title>
<Description>The DGMJR-IO SDK is a collection of `.props` and `.targets` files that are used to build and package the DGMJR projects.</Description>
<!-- <TargetFrameworks>netstandard1.0;netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks> -->
<PackageId>$(MSbuildProjectName)</PackageId>
<LangVersion>preview</LangVersion>
<PackageType>MSBuildSdk</PackageType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeInSolutionFile>true</IncludeInSolutionFile>
<DevelopmentDependency>true</DevelopmentDependency>
<NoWarn>$(NoWarn);MSB4011</NoWarn>
<PackageIcon>icon.png</PackageIcon>
<IsUsingNETSDK>true</IsUsingNETSDK>
<!-- <PackageVersionOverride Condition="'$(PackageVersionOverride)' == '' And '$(Configuration)' != 'Local'">0.0.23</PackageVersionOverride> -->
</PropertyGroup>
<ItemGroup>
<PackageFile Include="./Assets/*" PackagePath="Assets/%(Filename)%(Extension)" />
<PackageFile Include="./Common/*.cs" PackagePath="Common/%(Filename)%(Extension)" />
<!-- <PackageFile Include="./Build/*.props" PackagePath="Build/%(Filename)%(Extension)" />
<PackageFile Include="./Build/*.targets" PackagePath="Build/%(Filename)%(Extension)" />
<PackageFile Include="./Build/Custom/*.*" PackagePath="Build/Custom/%(Filename)%(Extension)" />
<PackageFile Include="./BuildMultiTargeting/*" PackagePath="BuildMultiTargeting/%(Filename)%(Extension)" /> -->
<PackageFile Include="./Common/*.props" PackagePath="Common/%(Filename)%(Extension)" />
<PackageFile Include="./Targets/*.targets" PackagePath="Targets/%(Filename)%(Extension)" />
<!-- <PackageFile Include="./Build/Custom/*.*" PackagePath="Build/Custom/%(Filename)%(Extension)" /> -->
<!-- <PackageFile Include="./BuildMultiTargeting/*" PackagePath="BuildMultiTargeting/%(Filename)%(Extension)" /> -->
<PackageFile Include="./LICENSE.md" PackagePath="%(Filename)%(Extension)" />
<PackageFile Include="./Scripts/*" PackagePath="Scripts/%(Filename)%(Extension)" />
<PackageFile Include="./Sdk/Sdk.WebAssembly.props" PackagePath="Sdk/Sdk%(Extension)" />
<PackageFile Include="./Sdk/Sdk.WebAssembly.targets" PackagePath="Sdk/Sdk%(Extension)" />
<PackageFile Include="./Sdk/Common.*" PackagePath="Sdk/%(Filename)%(Extension)" />
<PackageFile Include="./lib/*.dll" PackagePath="lib/%(Filename)%(Extension)" />
<PackageFile Include="./lib/*.dll" Pack="true" PackagePath="lib/$(TargetFramework)/%(Filename)%(Extension)" />
<PackageFile Include="./lib/**/*.dll" Pack="true" PackagePath="lib/netstandard2.0/%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="PrepareGitConstants" />
<Target Name="GitInfo" />
<ItemGroup>
<PackageTag Include="sdk" Visible="false" />
<PackageTag Include="build-defaults" Visible="false" />
<PackageTag Include="dgmjrsdk" Visible="false" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="./LICENSE.md" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./README_TEMPLATE.md" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./frontmatter_template.yml" LogicalName="%(Filename)%(Extension)" />
<EmbeddedResource Include="./Assets/icon.png" LogicalName="DEFAULT_PACKAGE_ICON.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="YamlDotNet" />
<PackageReference Include="MSBuild.Usings" IncludeAssets="Build;BuildTransitive;BuildMultitargeting;Runtime;Compile" ExcludeAssets="ContentFiles;Native;Analyzers" PrivateAssets="None" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Using Include="System.Collections.Generic.IDictionary&lt;string,string&gt;" Alias="IStringDictionary" />
<Using Include="System.Collections.Generic.Dictionary&lt;string,string&gt;" Alias="StringDictionary" />
<Using Include="System.Collections.Generic.KeyValuePair&lt;string,string&gt;" Alias="StrKvp" />
<Using Include="Dgmjr.Sdk.Models" />
<Using Include="System.Text.RegularExpressions" />
<Using Include="System.String" Static="true" />
<Using Include="System.IO.File" Static="true" />
<Using Include="System.IO.Path" Static="true" />
<Using Include="Microsoft.Build.Framework" />
<Using Include="Microsoft.Build.Execution" />
<Using Include="System.Runtime.CompilerServices" />
<Using Include="System.Reflection" />
<Using Include="System.Diagnostics" />
<Using Include="System.Text.RegularExpressions" />
<Using Include="System.String" Static="true" />
<Using Include="System.IO.File" Static="true" />
<Using Include="System.IO.Path" Static="true" />
<Using Include="Microsoft.Build.Framework" />
<Using Include="Microsoft.Build.Execution" />
<Using Include="System.Runtime.CompilerServices" />
<Using Include="System.Reflection" />
<Using Include="System.Diagnostics" />
</ItemGroup>
</Project>
3 changes: 2 additions & 1 deletion src/Sdk/Common.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<IsDgmjrSdk>$(MSBuildProjectName.Equals('DgmjrSdk'))</IsDgmjrSdk>
<IsDgmjrSdk>$(MSBuildProjectName.StartsWith('DgmjrSdk'))</IsDgmjrSdk>
<UsingDgmjrSdk>true</UsingDgmjrSdk>
<DgmjrSdkDll>$(MSBuildThisFileDirectory)../lib/DgmjrSdk.dll</DgmjrSdkDll>
</PropertyGroup>
Expand All @@ -11,6 +11,7 @@

<Import Project="$(MSBuildThisFileDirectory)../Common/TargetFrameworks.props" />
<Import Project="$(MSBuildThisFileDirectory)../Common/AAGitRoot.props" />
<Import Project="$(MSBuildThisFileDirectory)../Common/ACustomItemTypes.props" />
<Import Project="$(MSBuildThisFileDirectory)../Common/ADefaultBuildConfiguration.props" />
<Import Project="$(MSBuildThisFileDirectory)../Common/AIsMultiTargeting.props" />
<Import Project="$(MSBuildThisFileDirectory)../Common/AssemblySigning.props" />
Expand Down
1 change: 1 addition & 0 deletions src/Sdk/Common.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)../Targets/ACustomItemTypes.targets" />
<Import Project="$(MSBuildThisFileDirectory)../Targets/AssemblyVersion.targets" />
<Import Project="$(MSBuildThisFileDirectory)../Targets/Authors-Owners.targets" />
<Import Project="$(MSBuildThisFileDirectory)../Targets/BuildFromSource.targets" />
Expand Down
21 changes: 21 additions & 0 deletions src/Sdk/Sdk.Web.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
* Sdk.props
*
* Created: 2022-12-19-01:17:17
* Modified: 2022-12-19-01:17:19
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Condition="'$(DgmjrSdkProps)' == ''">
<PropertyGroup>
<DgmjrSdkProps>$(MSBuildThisFileDirectory)Sdk.props</DgmjrSdkProps>
<ImportMicrosoftNetSdkWeb>!$(UsingMicrosoftNETSdkWeb.Equals("true"))</ImportMicrosoftNetSdkWeb>
<UsingDgmjrNetSdk>true</UsingDgmjrNetSdk>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.Web" Condition="$(ImportMicrosoftNetSdk)" />
<Import Project="$(MSBuildThisFileDirectory)Common.props" />
</Project>
20 changes: 20 additions & 0 deletions src/Sdk/Sdk.Web.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
* Sdk.props
*
* Created: 2022-12-19-01:17:17
* Modified: 2022-12-19-01:17:19
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Condition="'$(DgmjrSdkTargets)' == ''">
<PropertyGroup>
<DgmjrSdkTargets>$(MSBuildThisFileDirectory)Sdk.targets</DgmjrSdkTargets>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.Web" Condition="'$(ImportMicrosoftNetSdkWeb)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Common.targets" />
</Project>
21 changes: 21 additions & 0 deletions src/Sdk/Sdk.WebAssembly.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
* Sdk.props
*
* Created: 2022-12-19-01:17:17
* Modified: 2022-12-19-01:17:19
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Condition="'$(DgmjrSdkProps)' == ''">
<PropertyGroup>
<DgmjrSdkProps>$(MSBuildThisFileDirectory)Sdk.props</DgmjrSdkProps>
<ImportMicrosoftNetWebAssemblySdk>!$(UsingMicrosoftNETSdkWebAssembly.Equals("true"))</ImportMicrosoftNetWebAssemblySdk>
<UsingDgmjrNetSdk>true</UsingDgmjrNetSdk>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WebAssembly" Condition="$(ImportMicrosoftNetWebAssemblySdk)" />
<Import Project="$(MSBuildThisFileDirectory)Common.props" />
</Project>
20 changes: 20 additions & 0 deletions src/Sdk/Sdk.WebAssembly.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
* Sdk.props
*
* Created: 2022-12-19-01:17:17
* Modified: 2022-12-19-01:17:19
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project Condition="'$(DgmjrSdkTargets)' == ''">
<PropertyGroup>
<DgmjrSdkTargets>$(MSBuildThisFileDirectory)Sdk.targets</DgmjrSdkTargets>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.Web" Condition="'$(ImportMicrosoftNetSdkWeb)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Common.targets" />
</Project>
4 changes: 2 additions & 2 deletions src/Targets/PackageIcon.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<Project InitialTargets="EnsurePackageIcon">
<Import Project="../Common/DgmjrSdkDll.props" Condition="'$(DgmjrSdkDll)' == ''" />
<UsingTask TaskName="Dgmjr.Sdk.Tasks.EnsurePackageIcon" AssemblyFile="$(DgmjrSdkDll)" />
<Target Name="EnsurePackageIcon" BeforeTargets="GetPackageMetadata" Condition="$(IsDgmjrSdk)" />
<Target Name="EnsurePackageIcon" BeforeTargets="GetPackageMetadata" Condition="'$(IsOuterBuild)' != 'false' And !$(IsDgmjrSdk)">
<Target Name="EnsurePackageIcon" BeforeTargets="GetPackageMetadata" Condition="$(MSBuildProjectName.StartsWith('DgmjrSdk'))" />
<Target Name="EnsurePackageIcon" BeforeTargets="GetPackageMetadata" Condition="'$(IsOuterBuild)' != 'false' And !$(MSBuildProjectName.StartsWith('DgmjrSdk'))">
<Message Importance="High" Text="Ensuring DGMJR-SDK icon file exists" />
<EnsurePackageIcon MSBuildProjectFullPath="$(MSBuildProjectFullPath)">
<Output TaskParameter="PackageIcon" PropertyName="PackageIcon" />
Expand Down
4 changes: 2 additions & 2 deletions src/Targets/PackageReadme.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<Import Project="../Common/DgmjrSdkDll.props" Condition="'$(DgmjrSdkDll)' == ''" />
<UsingTask TaskName="Dgmjr.Sdk.Tasks.EnsurePackageReadmeFileExists" AssemblyFile="$(DgmjrSdkDll)" />

<Target Name="EnsurePackageReadme" BeforeTargets="GetPackageContents" DependsOnTargets="GitInfo;GetPackageMetadata;SetPackageDescription" Condition="$(IsDgmjrSdk)" />
<Target Name="EnsurePackageReadme" BeforeTargets="GetPackageContents" DependsOnTargets="GitInfo;GetPackageMetadata;SetPackageDescription" Condition="$(MSBuildProjectName.StartsWith('DgmjrSdk'))" />

<Target Name="EnsurePackageReadme" BeforeTargets="GetPackageContents" DependsOnTargets="GitInfo;GetPackageMetadata;SetPackageDescription" Condition="'$(IsOuterBuild)' != 'false' And !$(IsDgmjrSdk)">
<Target Name="EnsurePackageReadme" BeforeTargets="GetPackageContents" DependsOnTargets="GitInfo;GetPackageMetadata;SetPackageDescription" Condition="'$(IsOuterBuild)' != 'false' And !$(MSBuildProjectName.StartsWith('DgmjrSdk'))">
<EnsurePackageReadmeFileExists MSBuildProjectFullPath="$(MSBuildProjectFullPath)" />
</Target>
</Project>

0 comments on commit e0fd96a

Please sign in to comment.