Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: .NET 10 build baseline

on:
push:
branches: [main, 'migration/**']
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: build-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
windows:
name: Windows ${{ matrix.configuration }}
runs-on: windows-2025
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: '**/packages.lock.json'
- name: Restore, build, baseline tests, pack, and consume packages
shell: pwsh
run: ./build.ps1 -Configuration ${{ matrix.configuration }}
- name: Upload build evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: baseline-${{ matrix.configuration }}
path: |
artifacts/build.binlog
artifacts/test-results/**
artifacts/packages/**
if-no-files-found: warn
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,6 @@ healthchecksdb
MigrationBackup/

.idea/.idea.DXSharp/.idea/

# SDK-style build baseline outputs
artifacts/
8 changes: 4 additions & 4 deletions DXSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ Global
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Debug|x64.Build.0 = Debug|x64
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Debug|x86.ActiveCfg = Debug|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Debug|x86.Build.0 = Debug|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|Any CPU.Build.0 = Debug|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|Any CPU.Build.0 = Release|Any CPU
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|x64.ActiveCfg = Release|x64
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|x64.Build.0 = Release|x64
{EE7A1499-C24D-4C17-93C0-0C907F5A7D53}.Release|x86.ActiveCfg = Release|Any CPU
Expand All @@ -218,8 +218,8 @@ Global
{4B5C9C89-A4A4-4081-8508-6E26388817F8}.Release|x64.Build.0 = Release|x64
{4B5C9C89-A4A4-4081-8508-6E26388817F8}.Release|x86.ActiveCfg = Release|x86
{4B5C9C89-A4A4-4081-8508-6E26388817F8}.Release|x86.Build.0 = Release|x86
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|Any CPU.ActiveCfg = InlineTasks|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|Any CPU.Build.0 = InlineTasks|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|x64.ActiveCfg = Debug|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|x64.Build.0 = Debug|Any CPU
{2362EB4B-6F3D-4274-A836-C5394A9660FC}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand Down
173 changes: 45 additions & 128 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,128 +1,45 @@
<Project>
<PropertyGroup>
<IsDXSLibrary>true</IsDXSLibrary>
</PropertyGroup>

<!-- Include the shared props file in builds folder :: -->
<Import Project=".\build\msbuild\DXSharpShared.Build.props"
Condition=" '$(DXSSharedPropsImported)' != 'true' " />

<ItemGroup Label="CommonSDKItems" >
<YamlPipelines Include="$(RepoRootPath)*.yml" />
<CsWin32Configs Include="$(MSBuildProjectDirectory)*NativeMethods*.*" />
<SdkConfigs Include="$(RepoRootPath)Resources\*sdkconf*.json" />
</ItemGroup>
<PropertyGroup Label="CommonSDKProps">
<BuildInParallel>false</BuildInParallel>
<IsMultiTargeting>true</IsMultiTargeting>
<NugetCacheDir>$(NuGetPackageRoot)</NugetCacheDir>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>


<!-- Fallbacks for critical properties: -->
<TargetCPUs Condition=" '$(TargetCPUs)'=='' ">AnyCPU;x64;x86</TargetCPUs>
<RepoRootPath Condition=" '$(RepoRootPath)'=='' ">$(MSBuildThisFileDirectory)</RepoRootPath>
<DotNetTargets Condition=" '$(DotNetTargets)'=='' ">net7.0-windows10.0.22621.0;net8.0-windows10.0.22621.0</DotNetTargets>

<!-- Make sure there's a configuration name and base output path: -->
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath Condition=" '$(PackageOutputPath)' == '' ">$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\</BaseIntermediateOutputPath>

<!-- Assembly Signing/Keys & Advanced Settings: -->
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(RepoRootPath)file\keys\strongname.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>


<!-- Compilation & Assembly Generation Properties :: -->
<PropertyGroup Label="CompilerConfig">
<OutputType Condition=" '$(OutputType)' == '' ">Library</OutputType>

<!-- Make sure valid platforms and target frameworks are set:
(Projects override this with their own values if needed)
-->
<Platforms Condition=" '$(Platforms)' == '' ">$(TargetCPUs)</Platforms>
<TargetFrameworks Condition=" '$(TargetFrameworks)' == '' ">$(DotNetTargets);</TargetFrameworks>

<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<Deterministic>true</Deterministic>
<ImplicitUsings>true</ImplicitUsings>
<AnalysisLevel>preview</AnalysisLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>


<!-- Properties for DevOps & CI Pipelines :: -->
<PropertyGroup Label="DevOpsConfig">
<CI>true</CI>
<AZ_BUILD>true</AZ_BUILD>
<AzureDevOps>true</AzureDevOps>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/atcarter714/DXSharp</RepositoryUrl>
<PowershellScriptsDir>$(RepoRootPath)build\pwsh</PowershellScriptsDir>

<!-- This entire repo has just one version.json file, so compute the
version once and share with all projects in a large build ... -->
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>

<!-- Local builds should embed PDBs so we never lose them when a subsequent build occurs. -->
<DebugType Condition=" '$(CI)' != 'true' and '$(TF_BUILD)' != 'true' ">embedded</DebugType>
<DebugType Condition=" '$(AzureDevOps)' != 'true' or '$(AZ_BUILD)' != 'true' ">embedded</DebugType>
</PropertyGroup>


<!-- Properties for Package Generation :: -->
<PropertyGroup Label="NuGetPackProperties">
<FileVersion>1.0.1</FileVersion>
<AssemblyVersion>0.3.3</AssemblyVersion>

<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>DXSharp_Logo_00_512.png</PackageIcon>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

<Company>Arkaen Solutions</Company>
<Authors>Aaron T. Carter, $(Company), Contributors</Authors>
<Copyright>Copyright © Aaron T. Carter, Arkaen Solutions. All rights reserved.</Copyright>


<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PackageProjectUrl>https://github.com/atcarter714/DXSharp</PackageProjectUrl>

<!--<SymbolPackageFormat>snupkg</SymbolPackageFormat>-->
<IncludeSymbols Condition=" '$(DebugType)' != 'embedded' ">true</IncludeSymbols>

<PackageTags>directx; dxsharp; interop; wrapper; 2d; 3d; graphics; d3d; d3d12; dxgi; win32; com; gamedev; arkaen; dxs;</PackageTags>
<PackageReleaseNotes>Early preview: NOT intended for production use!</PackageReleaseNotes>
</PropertyGroup>


<!-- Roslyn Generator Setup Properties :: -->
<PropertyGroup Label="CodeGenSettings">
<UsingCsWin32 Condition=" '$(UsingCsWin32)' == '' ">true</UsingCsWin32>
<CsWin32Version Condition=" '$(UsingCsWin32)' == 'true' ">[0.3.49-beta,)</CsWin32Version>

<UsingWinMD Condition=" '$(UsingWinMD)' == '' ">true</UsingWinMD>
<WinMDVersion Condition=" '$(UsingWinMD)' == 'true' ">[56.0.13-preview,)</WinMDVersion>
</PropertyGroup>


<!-- Compiler Symbols & Configurations :: -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DefineConstants>TRACE, DEBUG_COM, DEV_BUILD, CACHE_SIZE_NORMAL</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DefineConstants>TRACE, DEV_BUILD, CACHE_SIZE_LARGE, STRIP_CHECKS, DXS_FAST</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(NativePlatformName)' != '' ">
<DefineConstants Condition=" '$(NativePlatformName)' == 'x86' and '$(No32Bit)' != 'true' ">_WIN_32, X86</DefineConstants>
<DefineConstants Condition=" '$(NativePlatformName)' == 'arm' and '$(No32Bit)' != 'true' ">_WIN_32, ARM</DefineConstants>
<DefineConstants Condition=" '$(NativePlatformName)' == 'x64' ">_WIN_64, X64</DefineConstants>
<DefineConstants Condition=" '$(NativePlatformName)' == 'arm64' ">_WIN_64, ARM64</DefineConstants>
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<WinSDKVersion>10.0.26100.0</WinSDKVersion>
<DotNetTargets>net10.0-windows$(WinSDKVersion)</DotNetTargets>
<TargetCPUs>AnyCPU;x64;x86;ARM64</TargetCPUs>
<Platforms>$(TargetCPUs)</Platforms>
<LangVersion>14.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AnalysisLevel>10.0</AnalysisLevel>
<Deterministic>true</Deterministic>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true' or '$(TF_BUILD)' == 'true'">true</ContinuousIntegrationBuild>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<BaseOutputPath>$(RepoRootPath)artifacts/bin/$(MSBuildProjectName)/</BaseOutputPath>
<BaseIntermediateOutputPath>$(RepoRootPath)artifacts/obj/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
<PackageOutputPath>$(RepoRootPath)artifacts/packages/$(Configuration)/</PackageOutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(RepoRootPath)file/keys/strongname.snk</AssemblyOriginatorKeyFile>
<VersionPrefix>0.4.0</VersionPrefix>
<VersionSuffix>net10-preview.1</VersionSuffix>
<Company>Arkaen Solutions</Company>
<Authors>Aaron T. Carter, Arkaen Solutions, Contributors</Authors>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/atcarter714/DXSharp</RepositoryUrl>
<PackageProjectUrl>https://github.com/atcarter714/DXSharp</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IncludeSymbols>true</IncludeSymbols>
<DebugType>portable</DebugType>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<!-- Preserve legacy source branches until the COM ownership migration. -->
<DefineConstants>$(DefineConstants);DEV_BUILD;CACHE_SIZE_NORMAL</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);DEBUG_COM</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="$(RepoRootPath)README.md" Pack="true" PackagePath="/" Visible="false" />
</ItemGroup>
</Project>
120 changes: 1 addition & 119 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,121 +1,3 @@
<Project>
<!-- Import the necessary shared targets for DXSharp builds: -->
<ImportGroup Label="SharedTargets">
<Import Project=".\build\msbuild\DXSharpShared.Build.targets"
Condition=" '$(DXSSharedTargetsImported)' != 'true'" />

<Import Project=".\build\msbuild\AgilityNative.Build.targets"
Condition=" '$(UsingAgility)'=='true' and '$(AgilityNativeTargetsImported)'!='true' " />
<Import Project=".\build\msbuild\DxcNative.Build.targets"
Condition=" '$(UsingDxc)'=='true' " />

<Import Project=".\build\msbuild\DxcTool.Build.targets"
Condition=" '$(UsingDxcCompiler)'=='true' " />
</ImportGroup>


<!-- Define pre-build event actions: -->
<PropertyGroup>
<DXSCorePrebuildDependsOn>
$(DXSCorePrebuildDependsOn);
</DXSCorePrebuildDependsOn>
</PropertyGroup>
<Target Name="DXSCorePreBuild" BeforeTargets="PreBuildEvent" >
<Message Text="Pre-build event invoked: '$(SolutionName)' -> '$(ProjectName)':
DXS SDK Core Targets loaded ..."
Importance="high" />

<Message Text="Agility Build: $(UsingAgility)"
Condition=" '$(UsingAgility)'=='true' " Importance="high" />
<Message Text="Agility Build: false"
Condition=" '$(UsingAgility)'!='true' " Importance="high" />

<Message Text="Dxc Build: $(UsingDxc)"
Condition=" '$(UsingDxc)'=='true' " Importance="high" />
<Message Text="Dxc Build: false"
Condition=" '$(UsingDxc)'!='true' " Importance="high" />

<Message Text="DirectX Native Runtime: $(NativePlatformName)"
Importance="high" Condition=" '$(NativePlatformName)'!='' " />
</Target>


<!-- Log startup info: -->
<Target Name="LogBuildStartMessage" BeforeTargets="Build" >
<Message Text="DXS SDK Targets :: DXSharp SDK build process started @ '$(CurrentTime)' ..." Importance="high" />
<Message Text="Building :: '$(MSBuildProjectFile)' in: '$(MSBuildProjectDirectory)'..." Importance="high" />
<Message Text="Output File :: '$(AssemblyOutputFullPath)'" Importance="high" />
<Message Text="SDK Targets :: '$(DotNetTargets)'" Importance="high" />
<Message Text="Native Platform :: $(PlatformNameStr)" Importance="high" />
<Message Text="Target Framework : $(TargetFramework)" Importance="high" />
<Message Text="Target Processor : $(PlatformName)" Importance="high" />
</Target>



<!-- Run custom Powershell startup scripts:
This enables any kind of custom startup logic you want to happen ...
Edit the code in the Powershell script to run things and do any kind
of extra work/processing you want or need ... -->
<Target Name="RunToolsAtStartup" BeforeTargets="Build"
Condition=" '$(RunStartupTools)'=='true' " >
<PropertyGroup Condition=" '$(DISABLE_PWSH)'!='true' ">
<StartupScriptName Condition=" '$(StartupScriptName)'=='' ">DXSBuildStartup.ps1</StartupScriptName>
<LogFileNamePrefix>$(MSBuildProjectName)_$(Configuration)_$(Platform)_Build</LogFileNamePrefix>
<ScriptLocation Condition=" '$(ScriptLocation)'=='' ">$(PowershellScriptsDir)\$(StartupScriptName)</ScriptLocation>
<LogFileLocation Condition=" '$(LogFileLocation)'=='' ">$(RepoRootPath)build\logs\$(LogFileNamePrefix)_PreBuildToolsLog.log</LogFileLocation>

<!-- Select Powershell version to use and set it to $(PwshExe) property: -->
<!--<UseCustomPowershellInstall>true</UseCustomPowershellInstall>-->
<UseCustomPowershellInstall Condition=" '$(UseCustomPowershellInstall)'=='' ">false</UseCustomPowershellInstall>

<PWSH_VER Condition=" '$(PWSH_VER)'=='' ">7</PWSH_VER>
<CustomPowershellPath>"C:\Program Files\PowerShell\$(PWSH_VER)\pwsh.exe"</CustomPowershellPath>
<PwshExe Condition=" '$(UseCustomPowershellInstall)'=='true' ">$(CustomPowershellPath)</PwshExe>
<PwshExe Condition=" '$(UseCustomPowershellInstall)'=='false' ">pwsh.exe</PwshExe>
<!-- ................................................................... -->


<!-- Create log message for build tool: -->
<RunPwshExe>$(PwshExe)</RunPwshExe>

<StartupScriptArg Condition=" '$(StartupScriptArg)'=='' ">$(ProjectName)</StartupScriptArg>
<Arg3 Condition=" '$(StartupScriptArg)'!='' ">&apos;$(StartupScriptArg)&apos; </Arg3>
</PropertyGroup>

<!-- Run the startup Powershell script: -->
<Message Text="Running Startup Scripts @ '$(ScriptLocation)'" Importance="high" />
<!--<Exec Command="$(RunPwshExe) -ExecutionPolicy Bypass -File $(ScriptLocation) -Argument1 $(LogFileLocation) -Argument2 $(AssemblyName) -Argument3 $(PlatformNameStr)" />-->
<Exec Command="$(RunPwshExe) -command &quot;&amp; { $(ScriptLocation) &apos;$(LogFileLocation)&apos; $(Arg3)} &quot;" />
</Target>


<!-- Log build completion info: -->
<Target Name="LogBuildCompletionMessage"
AfterTargets="Build" DependsOnTargets="DefineSuccessOrFailure" >
<PropertyGroup>
<CompletionMsgText>DXSharp SDK library build process completed for: '$(MSBuildProjectName)'.</CompletionMsgText>
<ResultText>Result: $(BuildResult)</ResultText>
</PropertyGroup>

<!-- Print the build result code and info: -->
<Message Importance="high" Text="--------------------------------------" />
<Message Importance="high" Text="$(CompletionMsgText)" />
<Message Importance="high" Text="$(ResultText)" />
<Message Importance="high" Text="--------------------------------------" />

<OnError ExecuteTargets="FailedBuildMessage" />
</Target>


<!-- Failure Targets: -->
<Target Name="FailedBuildMessage">
<PropertyGroup>
<FailureMsgText>SDK library build failed for $(MSBuildProjectName)!</FailureMsgText>
</PropertyGroup>

<Message Text="$(FailureMsgText)"
Importance="high" />
</Target>
<Import Project="$(MSBuildThisFileDirectory)build/msbuild/NativeDependencies.targets" />
</Project>

18 changes: 18 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<!-- Freeze the existing projection for this baseline. Upgrade it in the generated-COM qualification step. -->
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" />
<PackageVersion Include="Microsoft.Windows.SDK.Win32Metadata" Version="56.0.13-preview" />
<PackageVersion Include="Microsoft.Direct3D.D3D12" Version="1.620.1" />
<PackageVersion Include="Microsoft.Direct3D.DXC" Version="1.9.2609.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="NUnit.Analyzers" Version="3.9.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.28" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Loading
Loading