Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/scalar_as_optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Jan 20, 2023
2 parents b5cd661 + 30e26d0 commit 2560603
Show file tree
Hide file tree
Showing 51 changed files with 524 additions and 94 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ on:
- 'documentation/**'
jobs:
Build:
runs-on: windows-latest
# This will:
# - use windows-quick (self-hosted only) for release tags on this repo
# - use windows-2022 (self-hosted or GitHub-hosted depending on what's available) for development in this repo
# - use windows-latest (GitHub-hosted only) in all other cases (i.e. community contributions)
# Note: the reason we use windows-2022 instead of windows-latest is so that both the self-hosted runner
# (which has the windows-2022 label but NOT the windows-latest label) and the GitHub hosted runner are
# treated as candidates. We will never have a windows-latest self-hosted runner even if it is the latest.
runs-on: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') && 'windows-quick' || github.repository == 'dotnet/Silk.NET' && 'windows-2022' || 'windows-latest' }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -24,6 +31,10 @@ jobs:
with:
java-version: 11
distribution: "temurin"
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.102
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
Expand All @@ -36,27 +47,25 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android ios maccatalyst maui
- name: Test
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# skip Clean, Restore, and Compile as this will build the affect the whole solution.
# dotnet test will compile the necessary projects for testing only.
run: nuke Test --skip Clean Restore Compile
run: .\build.cmd Test --skip Clean Restore Compile
- name: Validation Checks
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
run: nuke ValidateSolution
run: .\build.cmd ValidateSolution
- name: Pack (CI)
if: ${{ github.repository != 'dotnet/Silk.NET' || !startsWith(github.ref, 'refs/tags/') }}
# TODO build native mixins such as BuildLibSilkDroid
run: nuke Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
run: .\build.cmd Pack --configuration Release --msbuild-properties VersionSuffix=build${{ github.run_number }}.0 ContinuousIntegrationBuild=true
- name: Pack (CD)
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
# TODO build native mixins such as BuildLibSilkDroid
run: nuke Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
run: .\build.cmd Pack --configuration Release --msbuild-properties ContinuousIntegrationBuild=true
- name: Upload Unsigned Artifacts to Actions
uses: actions/[email protected]
with:
Expand All @@ -66,13 +75,13 @@ jobs:
retention-days: 1
- name: Sign Packages
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
run: nuke SignPackages --sign-username "${{ secrets.SIGN_USERNAME }}" --sign-password "${{ secrets.SIGN_PASSWORD }}"
run: .\build.cmd SignPackages --sign-username "${{ secrets.SIGN_USERNAME }}" --sign-password "${{ secrets.SIGN_PASSWORD }}"
- name: Push to Azure Experimental Feed
if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
run: nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
run: .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://pkgs.dev.azure.com/UltzOS/Silk.NET/_packaging/Experimental/nuget/v3/index.json --nuget-username ${{ secrets.AZDO_ARTIFACTS_USERNAME }} --nuget-password ${{ secrets.AZDO_ARTIFACTS_TOKEN }} --nuget-api-key az
- name: Push to GitHub Packages
if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request' }}
run: nuke PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
run: .\build.cmd PushToNuGet --skip Clean Restore Compile Pack --nuget-feed https://nuget.pkg.github.com/dotnet/index.json --nuget-api-key ${{ secrets.GITHUB_TOKEN }}
- name: Upload Signed Artifacts to Actions
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
uses: actions/[email protected]
Expand All @@ -82,5 +91,5 @@ jobs:
if-no-files-found: warn
- name: Push to NuGet
if: ${{ github.repository == 'dotnet/Silk.NET' && startsWith(github.ref, 'refs/tags/') }}
run: nuke PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}
run: .\build.cmd PushToNuGet --skip Clean Restore Pack --nuget-api-key ${{ secrets.NUGET_TOKEN }}

18 changes: 18 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PrototypeStructChaining.Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Vulkan.Tests", "src\Vulkan\Silk.NET.Vulkan.Tests\Silk.NET.Vulkan.Tests.csproj", "{225BA79C-36FE-421A-85E4-D15F8B61869B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{278FE083-D2F7-4DD2-9D27-6AD883E3A4B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Templates", "src\Templates\Silk.NET.Templates\Silk.NET.Templates.csproj", "{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.OpenGLES.ANGLE.Native", "src\Native\Silk.NET.OpenGLES.ANGLE.Native\Silk.NET.OpenGLES.ANGLE.Native.csproj", "{8D02DFEB-121A-449B-BC39-09C3F9A88E07}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Vulkan.Loader.Native", "src\Native\Silk.NET.Vulkan.Loader.Native\Silk.NET.Vulkan.Loader.Native.csproj", "{36C38837-8250-42F9-ABDA-DEFC1AB129E1}"
Expand Down Expand Up @@ -2925,6 +2929,18 @@ Global
{225BA79C-36FE-421A-85E4-D15F8B61869B}.Release|x64.Build.0 = Release|Any CPU
{225BA79C-36FE-421A-85E4-D15F8B61869B}.Release|x86.ActiveCfg = Release|Any CPU
{225BA79C-36FE-421A-85E4-D15F8B61869B}.Release|x86.Build.0 = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|x64.ActiveCfg = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|x64.Build.0 = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|x86.ActiveCfg = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Debug|x86.Build.0 = Debug|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|Any CPU.Build.0 = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|x64.ActiveCfg = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|x64.Build.0 = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|x86.ActiveCfg = Release|Any CPU
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2}.Release|x86.Build.0 = Release|Any CPU
{8D02DFEB-121A-449B-BC39-09C3F9A88E07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D02DFEB-121A-449B-BC39-09C3F9A88E07}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D02DFEB-121A-449B-BC39-09C3F9A88E07}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -3574,6 +3590,8 @@ Global
{EEFF37DA-E4F2-406E-AF97-8615BB7BC34C} = {B15922CB-815C-4038-B635-EE2D8A8F700B}
{BD19250B-E143-4F4E-9E1D-18829CCB3642} = {B15922CB-815C-4038-B635-EE2D8A8F700B}
{225BA79C-36FE-421A-85E4-D15F8B61869B} = {E2ABDF45-C329-47B2-8E09-B7298E2557F7}
{278FE083-D2F7-4DD2-9D27-6AD883E3A4B8} = {16AFCF73-8CC1-4B5D-8969-A90F468DC6D5}
{4D65197C-79B2-40CF-846E-C1EAB4F6EEA2} = {278FE083-D2F7-4DD2-9D27-6AD883E3A4B8}
{8D02DFEB-121A-449B-BC39-09C3F9A88E07} = {72E7FA64-5B1E-477D-BD30-63B7F206B3C4}
{36C38837-8250-42F9-ABDA-DEFC1AB129E1} = {72E7FA64-5B1E-477D-BD30-63B7F206B3C4}
{54F439B6-36E4-4FB0-8731-F73D42AD921F} = {72E7FA64-5B1E-477D-BD30-63B7F206B3C4}
Expand Down
10 changes: 7 additions & 3 deletions build/nuke/Build.ReviewHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ partial class Build
// ReSharper disable once RedundantEmptyObjectOrCollectionInitializer
readonly HashSet<string> AllowedExclusions = new()
{
"silkwindow",
"silkgl",
"silkgltriangle",
"DotZLib"
};

Target ValidateSolution => CommonTarget
Expand All @@ -20,8 +24,8 @@ partial class Build
(
() =>
{
var files = SourceDirectory.GlobFiles("**/*.csproj").ToArray();
Logger.Info($"Found {files.Length} csproj files in \"{SourceDirectory}\"");
var files = RootDirectory.GlobFiles("**\\*.csproj").Concat(RootDirectory.GlobFiles("**/*.csproj")).ToArray();
Logger.Info($"Found {files.Length} csproj files in \"{RootDirectory}\"");
var missedOut = new List<string>();
foreach (var file in files)
{
Expand All @@ -41,7 +45,7 @@ partial class Build
(
"A project has not been included in the solution and will not be shipped! " +
$"\"{file}\" if this is acceptable please add the project name (excluding the path and " +
"extension) to the AllowedExclusions array in the NUKE Build.CI.AutoReview.cs file."
"extension) to the AllowedExclusions array in the NUKE Build.ReviewHelpers.cs file."
);
missedOut.Add(Path.GetRelativePath(RootDirectory, file).Replace('\\', '/'));
Expand Down
4 changes: 2 additions & 2 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
.Replace('&lt;div&gt;', '').Replace('&lt;/div&gt;', '')
.Replace('&lt;a&gt;', '').Replace('&lt;/a&gt;', ''))
</SilkReadme>
<SilkReadmePath>$(IntermediateOutputPath)README.md</SilkReadmePath>
<SilkReadmePath>$(IntermediateOutputPath)$(TargetFramework)/README.md</SilkReadmePath>
</PropertyGroup>
<PropertyGroup Condition="'$(SilkDescription)' != ''">
<Description>$(SilkDescription) $(Description)</Description>
Expand All @@ -122,7 +122,7 @@
</Target>
<!-- Public API Analyzer -->
<ItemGroup Condition="'$(SilkPublicApiExempt)' != 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(SilkPublicApiExempt)' != 'true' and '$(TargetFramework)' != ''">
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.201",
"version": "7.0.102",
"rollForward": "major"
}
}
2 changes: 1 addition & 1 deletion src/Core/Silk.NET.SilkTouch/Silk.NET.SilkTouch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<Compile Include="..\Silk.NET.Core\Attributes\InjectAttribute.cs" />

<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />

<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.3" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.3" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Maths/Silk.NET.Maths/Silk.NET.Maths.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3">
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Silk.NET.Core.Attributes;
using Silk.NET.Core.Contexts;
using Silk.NET.Core.Native;

namespace Silk.NET.OpenAL.Extensions.Soft
{
/// <summary>
/// Exposes the public API of the OpenAL Soft Reopen Device extension.
/// </summary>
[NativeApi(Prefix = "alc")]
[Extension("ALC_SOFT_reopen_device")]
public partial class ReopenDevices : NativeExtension<AL>
{
/// <inheritdoc cref="ExtensionBase" />
public ReopenDevices(INativeContext ctx)
: base(ctx)
{
}

/// <inheritdoc />
[NativeApi(EntryPoint = "ReopenDeviceSOFT")]
public unsafe partial bool ReopenDevice(Device* device, string deviceName, int* attributeList);
}
}
Loading

0 comments on commit 2560603

Please sign in to comment.