diff --git a/.github/actions/dotnet-sdk/action.yml b/.github/actions/dotnet-sdk/action.yml
index 751a6c1..e53f87b 100644
--- a/.github/actions/dotnet-sdk/action.yml
+++ b/.github/actions/dotnet-sdk/action.yml
@@ -7,6 +7,14 @@ inputs:
runs:
using: 'composite'
steps:
+ - name: Cache .NET SDK (Windows)
+ if: ${{ runner.os == 'Windows' }}
+ id: cache-sdk-win
+ uses: actions/cache@v4
+ with:
+ key: dotnet-sdk-windows-${{ inputs.UET_FRAMEWORK_TARGET }}
+ restore-keys: dotnet-sdk-windows-${{ inputs.UET_FRAMEWORK_TARGET }}
+ path: .dotnet-${{ inputs.UET_FRAMEWORK_TARGET }}
- name: Cache .NET SDK (macOS)
if: ${{ runner.os == 'macOS' }}
id: cache-sdk-mac
@@ -15,6 +23,26 @@ runs:
key: dotnet-sdk-mac-${{ inputs.UET_FRAMEWORK_TARGET }}
restore-keys: dotnet-sdk-mac-${{ inputs.UET_FRAMEWORK_TARGET }}
path: .dotnet-${{ inputs.UET_FRAMEWORK_TARGET }}
+ - name: Download .NET SDK (Windows)
+ if: ${{ runner.os == 'Windows' && steps.cache-sdk-win.outputs.cache-hit != 'true' }}
+ shell: pwsh
+ env:
+ UET_FRAMEWORK_TARGET: ${{ inputs.UET_FRAMEWORK_TARGET }}
+ UET_DOTNET_WIN_DL: https://download.visualstudio.microsoft.com/download/pr/6902745c-34bd-4d66-8e84-d5b61a17dfb7/e61732b00f7e144e162d7e6914291f16/dotnet-sdk-8.0.101-win-x64.zip
+ run: |
+ if (!(Test-Path .dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet\dotnet-extracted)) {
+ if (Test-Path ".dotnet-${env:UET_FRAMEWORK_TARGET}") {
+ Remove-Item -Recurse -Force ".dotnet-${env:UET_FRAMEWORK_TARGET}"
+ }
+ Write-Host "Setting up .NET SDK..."
+ New-Item -ItemType Directory ".dotnet-${env:UET_FRAMEWORK_TARGET}" | Out-Null
+ curl.exe -L -o ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet.zip" "${env:UET_DOTNET_WIN_DL}"
+ if ($LastExitCode -ne 0) {
+ exit $LastExitCode
+ }
+ Expand-Archive -Path ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet.zip" -DestinationPath ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet" -Force | Out-Null
+ Set-Content -Path .dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet\dotnet-extracted -Value "done"
+ }
- name: Download .NET SDK (macOS)
if: ${{ runner.os == 'macOS' && steps.cache-sdk-mac.outputs.cache-hit != 'true' }}
shell: pwsh
@@ -41,6 +69,13 @@ runs:
}
Set-Content -Path .dotnet-${env:UET_FRAMEWORK_TARGET}/dotnet/dotnet-extracted -Value "done"
}
+ - name: Add .NET SDK to PATH (Windows)
+ if: ${{ runner.os == 'Windows' }}
+ shell: pwsh
+ env:
+ UET_FRAMEWORK_TARGET: ${{ inputs.UET_FRAMEWORK_TARGET }}
+ run: |
+ Add-Content -Path "${env:GITHUB_PATH}" -Value ".dotnet-${env:UET_FRAMEWORK_TARGET}\dotnet"
- name: Add .NET SDK to PATH (macOS)
if: ${{ runner.os == 'macOS' }}
shell: pwsh
diff --git a/.github/workflows/autodiscovery.yml b/.github/workflows/autodiscovery.yml
new file mode 100644
index 0000000..af99f00
--- /dev/null
+++ b/.github/workflows/autodiscovery.yml
@@ -0,0 +1,64 @@
+name: Redpoint.AutoDiscovery
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+
+env:
+ UET_FRAMEWORK_TARGET: net8.0
+ UET_BUILDING_ON_BUILD_SERVER: "true"
+
+jobs:
+ autodiscovery:
+ name: "Build and Publish"
+ runs-on: windows-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Install .NET SDK
+ uses: ./.github/actions/dotnet-sdk
+ with:
+ UET_FRAMEWORK_TARGET: ${{ env.UET_FRAMEWORK_TARGET }}
+ - name: Build Redpoint.AutoDiscovery
+ shell: pwsh
+ run: |
+ $Timestamp = ([DateTime]::UtcNow)
+ $PackageVersion = "$($Timestamp.Year).$($Timestamp.DayOfYear + 1000).$(($Timestamp.Hour * 60) + $Timestamp.Minute)"
+
+ Write-Host "Package version: $PackageVersion"
+
+ Write-Host "Building Redpoint.AutoDiscovery version '$PackageVersion'..."
+ dotnet `
+ msbuild `
+ -restore `
+ -p:RuntimeIdentifier=win-x86 `
+ -p:Configuration=Release `
+ -p:Platform=x86 `
+ "-p:BaseUetVersion=$PackageVersion" `
+ "-p:PackageVersion=$PackageVersion" `
+ Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj
+ if ($LastExitCode -ne 0) { exit $LastExitCode }
+ dotnet `
+ msbuild `
+ -restore `
+ -p:RuntimeIdentifier=win-x64 `
+ -p:Configuration=Release `
+ -p:Platform=x64 `
+ "-p:BaseUetVersion=$PackageVersion" `
+ "-p:PackageVersion=$PackageVersion" `
+ Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj
+ if ($LastExitCode -ne 0) { exit $LastExitCode }
+ - name: Publish Redpoint.AutoDiscovery
+ shell: pwsh
+ if: github.ref == 'refs/heads/main'
+ env:
+ NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
+ run: |
+ dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win32/bin/Release/Redpoint.AutoDiscovery.Win32.*.nupkg" | % { $_.FullName })
+ if ($LastExitCode -ne 0) { exit $LastExitCode }
+ dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.AutoDiscovery.Win64/bin/Release/Redpoint.AutoDiscovery.Win64.*.nupkg" | % { $_.FullName })
+ if ($LastExitCode -ne 0) { exit $LastExitCode }
\ No newline at end of file
diff --git a/.github/workflows/mac-logging.yml b/.github/workflows/mac-logging.yml
index 85d762c..5911120 100644
--- a/.github/workflows/mac-logging.yml
+++ b/.github/workflows/mac-logging.yml
@@ -12,10 +12,8 @@ env:
jobs:
mac-logging:
- name: "Build and Publish Redpoint.Logging.Mac.Native"
+ name: "Build and Publish"
runs-on: macos-latest
- env:
- UET_PACKAGE_VERSION: ${{ needs.timestamp.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -30,8 +28,6 @@ jobs:
run: |
$Timestamp = ([DateTime]::UtcNow)
$PackageVersion = "$($Timestamp.Year).$($Timestamp.DayOfYear + 1000).$(($Timestamp.Hour * 60) + $Timestamp.Minute)"
- Set-Content -NoNewline -Path "package.version" -Value "$($PackageVersion)"
- Set-Content -NoNewline -Path "$env:GITHUB_OUTPUT" -Value "version=$($PackageVersion)"
Write-Host "Package version: $PackageVersion"
@@ -59,5 +55,5 @@ jobs:
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
- dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "Redpoint.Logging.Mac.Native/bin/Redpoint.Logging.Mac.Native.*.nupkg" | % { $_.FullName })
+ dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key $env:NUGET_API_KEY (Get-ChildItem -Recurse -Filter "bin/Redpoint.Logging.Mac.Native.*.nupkg" | % { $_.FullName })
if ($LastExitCode -ne 0) { exit $LastExitCode }
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7fc711b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.sln
+bin/
+obj/
\ No newline at end of file
diff --git a/Lib/Common.Build.props b/Lib/Common.Build.props
new file mode 100644
index 0000000..7fb6c33
--- /dev/null
+++ b/Lib/Common.Build.props
@@ -0,0 +1,39 @@
+
+
+
+
+
+ None
+
+
+
+ false
+
+
+
+ true
+ true
+ true
+ true
+ latest
+ All
+ true
+ true
+ true
+ true
+ $(NoWarn);CS1591;CS1573
+
+
+
+ $(NoWarn);SYSLIB1224
+
+
+
+
+
+
+ enable
+ enable
+
+
+
\ No newline at end of file
diff --git a/Lib/CsWin32.Build.props b/Lib/CsWin32.Build.props
new file mode 100644
index 0000000..ba05e0b
--- /dev/null
+++ b/Lib/CsWin32.Build.props
@@ -0,0 +1,19 @@
+
+
+
+ true
+
+ $(NoWarn);CS9195
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Lib/Framework.Build.props b/Lib/Framework.Build.props
new file mode 100644
index 0000000..6ccdfc7
--- /dev/null
+++ b/Lib/Framework.Build.props
@@ -0,0 +1,12 @@
+
+
+
+ net8.0
+
+
+ net8.0;net48
+
+ 8.*
+
+
+
\ No newline at end of file
diff --git a/Lib/LibraryPackaging.Build.props b/Lib/LibraryPackaging.Build.props
new file mode 100644
index 0000000..d52fcf0
--- /dev/null
+++ b/Lib/LibraryPackaging.Build.props
@@ -0,0 +1,30 @@
+
+
+ True
+ True
+ Redpoint Games
+
+ https://src.redpoint.games/redpointgames/uet
+ git
+ MIT
+ June Rhodes
+ Redpoint Games
+ PackageIcon.png
+ README.md
+
+ $([System.DateTime]::UtcNow.Year)
+ $([System.DateTime]::UtcNow.DayOfYear)
+ $([System.DateTime]::UtcNow.Hour)
+ $([System.DateTime]::UtcNow.Minute)
+ $(PackageYear)
+ $([MSBuild]::Add($(PackageDayOfYear), 1000))
+ $([MSBuild]::Add($([MSBuild]::Multiply($(PackageHour), 60)), $(PackageMinute)))
+
+ $(PackageVersionMajor).$(PackageVersionMinor).$(PackageVersionPatch)-pre
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Lib/XunitTesting.Build.props b/Lib/XunitTesting.Build.props
new file mode 100644
index 0000000..f9db582
--- /dev/null
+++ b/Lib/XunitTesting.Build.props
@@ -0,0 +1,48 @@
+
+
+
+
+
+ enable
+ enable
+ None
+ $(MSBuildThisFileDirectory)../Redpoint.Logging.Mac/bin;$(MSBuildThisFileDirectory)../Redpoint.AutoDiscovery/bin/$(Configuration)
+
+
+
+ false
+ true
+
+
+
+
+
+
+
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
+
+
+
+
+
+ xunit.runner.json
+
+
+ UseRedpointTestFramework.cs
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 61e8abc..6219701 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
-# Redpoint.Logging.Mac.Native
+# UET (native libraries)
-This repository builds and publishes the `Redpoint.Logging.Mac.Native` NuGet package, which provides the native macOS `.dylib` files that are necessary to support logging to the macOS system log in `Redpoint.Logging.Mac`.
+This repository builds and publishes libraries for UET that are dependent on native APIs: `Redpoint.Logging.Mac.Native` which provides the native macOS `.dylib` files that are necessary to support logging to the macOS system log in `Redpoint.Logging.Mac`, and `Redpoint.AutoDiscovery` which can only be built on Windows.
-This folder used to be part of the [UET](https://github.com/RedpointGames/uet) repository, but was moved here to simplify the build process of UET when developing on a local machine. This library basically never changes it's implementation, so having it build and publish from it's own repository, and having UET simply depend on the published NuGet package was considered far more maintainable.
+The C# projects in this repository used to be part of the [UET](https://github.com/RedpointGames/uet) repository, but they were moved here to simplify the build process of UET when developing on a local machine. These library implementations basically never change, so having it build and publish from it's own repository, and having UET simply depend on the published NuGet packages was considered far more maintainable.
All bug reports should be reported in the [UET](https://github.com/RedpointGames/uet) repository.
diff --git a/Redpoint.AutoDiscovery.Win32/NativeMethods.json b/Redpoint.AutoDiscovery.Win32/NativeMethods.json
new file mode 100644
index 0000000..e1360a4
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win32/NativeMethods.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://aka.ms/CsWin32.schema.json",
+ "public": true
+}
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win32/NativeMethods.txt b/Redpoint.AutoDiscovery.Win32/NativeMethods.txt
new file mode 100644
index 0000000..6bc1c61
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win32/NativeMethods.txt
@@ -0,0 +1,12 @@
+DnsServiceRegister
+DnsServiceRegisterCancel
+DnsServiceDeRegister
+DnsServiceBrowse
+DnsServiceBrowseCancel
+DnsServiceConstructInstance
+DnsServiceFreeInstance
+DnsFree
+DNS_QUERY_OPTIONS
+DNS_REQUEST_PENDING
+DNS_TYPE
+WIN32_ERROR
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win32/README.md b/Redpoint.AutoDiscovery.Win32/README.md
new file mode 100644
index 0000000..2374156
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win32/README.md
@@ -0,0 +1,5 @@
+# Redpoint.AutoDiscovery.Win32
+
+Provides native binaries for the Redpoint.AutoDiscovery library.
+
+You should depend on `Redpoint.AutoDiscovery` instead of this NuGet package.
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj b/Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj
new file mode 100644
index 0000000..0fdaa3c
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win32/Redpoint.AutoDiscovery.Win32.csproj
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ Redpoint.AutoDiscovery.Win32
+ Redpoint.AutoDiscovery.Win32
+ x86
+ x86
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Redpoint.AutoDiscovery.Win64/NativeMethods.json b/Redpoint.AutoDiscovery.Win64/NativeMethods.json
new file mode 100644
index 0000000..e1360a4
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win64/NativeMethods.json
@@ -0,0 +1,4 @@
+{
+ "$schema": "https://aka.ms/CsWin32.schema.json",
+ "public": true
+}
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win64/NativeMethods.txt b/Redpoint.AutoDiscovery.Win64/NativeMethods.txt
new file mode 100644
index 0000000..6bc1c61
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win64/NativeMethods.txt
@@ -0,0 +1,12 @@
+DnsServiceRegister
+DnsServiceRegisterCancel
+DnsServiceDeRegister
+DnsServiceBrowse
+DnsServiceBrowseCancel
+DnsServiceConstructInstance
+DnsServiceFreeInstance
+DnsFree
+DNS_QUERY_OPTIONS
+DNS_REQUEST_PENDING
+DNS_TYPE
+WIN32_ERROR
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win64/README.md b/Redpoint.AutoDiscovery.Win64/README.md
new file mode 100644
index 0000000..c0a7139
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win64/README.md
@@ -0,0 +1,5 @@
+# Redpoint.AutoDiscovery.Win64
+
+Provides native binaries for the Redpoint.AutoDiscovery library.
+
+You should depend on `Redpoint.AutoDiscovery` instead of this NuGet package.
\ No newline at end of file
diff --git a/Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj b/Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj
new file mode 100644
index 0000000..561c057
--- /dev/null
+++ b/Redpoint.AutoDiscovery.Win64/Redpoint.AutoDiscovery.Win64.csproj
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ Redpoint.AutoDiscovery.Win64
+ Redpoint.AutoDiscovery.Win64
+ x64
+ x64
+
+
+
+
+
+
+
+
+
+
+
+
+