From f1be6587ccce95d709e5b96526470178a4cb9f58 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Mon, 23 Feb 2026 19:23:05 +0000 Subject: [PATCH 01/13] Add NuGet packaging and CI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++++++++ Directory.Build.props | 14 +++++ Makefile | 17 ++++++ Xamarin.MacDev/Xamarin.MacDev.csproj | 79 +++++++++++++++++++-------- build-tools/scripts/msbuild.mk | 29 ++++++++++ nuget.version | 1 + 6 files changed, 198 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 Directory.Build.props create mode 100644 Makefile create mode 100644 build-tools/scripts/msbuild.mk create mode 100644 nuget.version diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a249787 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: Build and Test + +on: + push: + branches: [ main, release/* ] + pull_request: + branches: [ main, release/* ] + +env: + DOTNET_VERSION: '10.0.x' + +jobs: + build: + name: Build and Test + strategy: + matrix: + os: [macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Full history for version calculation + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Build + run: dotnet build Xamarin.MacDev.sln -c Release -bl:${{ github.workspace }}/artifacts/build.binlog + + - name: Test + run: dotnet test Xamarin.MacDev.sln -c Release --no-build -l "console;verbosity=detailed" -l trx --results-directory ${{ github.workspace }}/artifacts/test-results + + - name: Calculate Version (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $hashOfLastVersionChange = git log --follow -1 --pretty=%H nuget.version + $commitsSinceVersionChange = git rev-list --count "$hashOfLastVersionChange..HEAD" + $majorMinor = Get-Content nuget.version + $version = "$majorMinor.$commitsSinceVersionChange" + Write-Host "Package version: $version" + echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV + + - name: Calculate Version (macOS/Linux) + if: runner.os != 'Windows' + run: | + HASH_OF_LAST_VERSION_CHANGE=$(git log --follow -1 --pretty=%H nuget.version) + COMMITS_SINCE_VERSION_CHANGE=$(git rev-list --count "$HASH_OF_LAST_VERSION_CHANGE..HEAD") + MAJOR_MINOR=$(cat nuget.version) + VERSION="$MAJOR_MINOR.$COMMITS_SINCE_VERSION_CHANGE" + echo "Package version: $VERSION" + echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV + + - name: Pack NuGet + run: dotnet pack Xamarin.MacDev/Xamarin.MacDev.csproj -c Release --no-build -p:PackageVersion=${{ env.PACKAGE_VERSION }} -o ${{ github.workspace }}/artifacts/packages + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-output-${{ matrix.os }} + path: bin/Release/ + + - name: Upload NuGet Package + uses: actions/upload-artifact@v4 + with: + name: nuget-package-${{ matrix.os }} + path: ${{ github.workspace }}/artifacts/packages/*.nupkg + + - name: Upload Logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: logs-${{ matrix.os }} + path: | + ${{ github.workspace }}/artifacts/*.binlog + ${{ github.workspace }}/artifacts/test-results/ diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..12011f2 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,14 @@ + + + Debug + https://github.com/dotnet/macios-devtools + git + net10.0 + + + + $(MSBuildThisFileDirectory)bin\ + $(BaseOutputPath)$(Configuration)\ + $(BaseOutputPath)Test$(Configuration)\ + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5cb50c5 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +CONFIGURATION := Debug +V ?= 0 + +include build-tools/scripts/msbuild.mk + +all: + $(MSBUILD) $(MSBUILD_FLAGS) Xamarin.MacDev.sln + +clean: + -$(MSBUILD) $(MSBUILD_FLAGS) /t:Clean Xamarin.MacDev.sln + +run-all-tests: + dotnet test -l "console;verbosity=detailed" -l trx \ + UnitTests/UnitTests.csproj + +pack: + dotnet pack Xamarin.MacDev/Xamarin.MacDev.csproj $(MSBUILD_FLAGS) diff --git a/Xamarin.MacDev/Xamarin.MacDev.csproj b/Xamarin.MacDev/Xamarin.MacDev.csproj index d5a2639..cbe8676 100644 --- a/Xamarin.MacDev/Xamarin.MacDev.csproj +++ b/Xamarin.MacDev/Xamarin.MacDev.csproj @@ -1,22 +1,57 @@ - - - - netstandard2.0;net10.0 - true - false - latest - true - enable - - - - runtime; build; native; contentfiles; analyzers - all - - - - - Microsoft400 - - - + + + + netstandard2.0;net10.0 + true + false + latest + true + enable + + + + + Xamarin.MacDev + Microsoft + MIT + https://github.com/dotnet/macios-devtools + Xamarin tools for interacting with Apple SDKs. + Copyright © Microsoft + Xamarin;macOS;iOS;Apple + README.md + + + + + $(ToolOutputFullPath) + + + + + true + true + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers + all + + + + + + + + Microsoft400 + + + + diff --git a/build-tools/scripts/msbuild.mk b/build-tools/scripts/msbuild.mk new file mode 100644 index 0000000..0682cd3 --- /dev/null +++ b/build-tools/scripts/msbuild.mk @@ -0,0 +1,29 @@ +# +# MSBuild Abstraction. +# +# Makefile targets which need to invoke MSBuild should use `$(MSBUILD)`, +# not some specific MSBuild program such as `xbuild` or `msbuild`. +# +# Typical use will also include `$(MSBUILD_FLAGS)`, which provides the +# Configuration and logging verbosity, as per $(CONFIGURATION) and $(V): +# +# $(MSBUILD) $(MSBUILD_FLAGS) path/to/Project.csproj +# +# Inputs: +# +# $(CONFIGURATION): Build configuration name, e.g. Debug or Release +# $(MSBUILD): The MSBuild program to use. +# $(MSBUILD_ARGS): Extra arguments to pass to $(MSBUILD); embedded into $(MSBUILD_FLAGS) +# $(V): Build verbosity +# +# Outputs: +# +# $(MSBUILD): The MSBuild program to use. Defaults to `dotnet build`. +# $(MSBUILD_FLAGS): Additional MSBuild flags; contains $(CONFIGURATION), $(V), $(MSBUILD_ARGS). + +MSBUILD = dotnet build +MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) + +ifneq ($(V),0) +MSBUILD_FLAGS += /v:diag +endif # $(V) != 0 diff --git a/nuget.version b/nuget.version new file mode 100644 index 0000000..d69d4fa --- /dev/null +++ b/nuget.version @@ -0,0 +1 @@ +1.0 From 2acd0b3581201132de6bfde952f9a70c263a6626 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Mon, 23 Feb 2026 19:44:30 +0000 Subject: [PATCH 02/13] Add macios-devtools copilot guidance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/CSharpExpert.agent.md | 65 ++++++++++++++++++++ .github/copilot-instructions.md | 37 +++++++++++ .github/principal-software-engineer.agent.md | 42 +++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 .github/CSharpExpert.agent.md create mode 100644 .github/copilot-instructions.md create mode 100644 .github/principal-software-engineer.agent.md diff --git a/.github/CSharpExpert.agent.md b/.github/CSharpExpert.agent.md new file mode 100644 index 0000000..14230f6 --- /dev/null +++ b/.github/CSharpExpert.agent.md @@ -0,0 +1,65 @@ +--- +name: "C# Expert" +description: An agent designed to assist with software development tasks for the macios-devtools repository. +# version: 2026-01-20a +--- + +You are an expert C#/.NET developer helping with the **Xamarin.MacDev** library project. Provide clean, +secure, readable, and maintainable code that follows .NET conventions and existing repository patterns. + +## Project Context + +- **Project Type**: Apple SDK tooling library (NuGet package) +- **Target Frameworks**: netstandard2.0; net10.0 +- **C# Version**: `latest` (per project files) +- **Nullable**: Enabled +- **Purpose**: Apple SDK discovery, provisioning profiles, plist parsing, Xcode integration +- **Tests**: NUnit (UnitTests project) + +When invoked: + +- Understand the task in the context of Apple SDK tooling. +- Propose organized solutions that match repository conventions. +- Cover security for file and process handling. +- Reuse existing abstractions; avoid unnecessary interfaces. +- Plan and write tests with NUnit. +- Improve performance where it matters (I/O, memory). + +# General C# Development + +- Follow the project's conventions first, then common C# conventions. +- Keep naming, formatting, and project structure consistent. +- Avoid APIs that are unavailable in netstandard2.0 for shared code. +- Do not edit auto-generated code (`*.g.cs`, `// `). + +## Code Design Rules + +- Do not add interfaces/abstractions unless needed for external dependencies or testing. +- Prefer least exposure: `private` > `internal` > `protected` > `public`. +- Comments should explain intent when needed, not restate the code. +- Avoid unused methods and parameters. +- Reuse existing helpers where possible. + +## Error Handling + +- Use `ArgumentNullException.ThrowIfNull` for null checks and `string.IsNullOrWhiteSpace` for strings. +- Use precise exception types; avoid catching `Exception`. +- Do not swallow errors; log or propagate them. + +## Build and Test + +- Build: `dotnet build Xamarin.MacDev.sln` +- Tests: `dotnet test UnitTests/UnitTests.csproj` +- Pack: `dotnet pack Xamarin.MacDev/Xamarin.MacDev.csproj` + +## Async Best Practices + +- Async methods should end with `Async`. +- Pass `CancellationToken` through and honor cancellation. +- Avoid sync-over-async in library code. + +## Testing (NUnit) + +- Use `[Test]` and `[TestCase]` as appropriate. +- Keep one behavior per test and follow existing naming patterns. +- Avoid tests that depend on execution order or machine-specific state. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..f2a5291 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,37 @@ +--- +description: 'Guidelines for C# library work' +applyTo: '**/*.cs' +--- + +# C# Development + +## Project-Specific Context + +This repository hosts **Xamarin.MacDev**, a .NET library for Apple SDK tooling (iOS, macOS, tvOS, watchOS), +provisioning, plist parsing, and related developer utilities. + +- Target frameworks: `netstandard2.0` and `net10.0` +- C# Language Version: `latest` (per project files) +- Nullable reference types are enabled +- SDK-style projects built with `dotnet build` (or `make`) +- Tests: `UnitTests` project using **NUnit** + +## Guidance + +- Follow existing conventions and `.editorconfig`. +- Keep changes minimal and reuse existing helpers. +- Avoid APIs that are unavailable in `netstandard2.0` when used in shared code. +- Do not edit auto-generated files (`// ` or `*.g.cs`). + +## Error Handling + +- Validate inputs at public boundaries using `ArgumentNullException.ThrowIfNull` and `string.IsNullOrWhiteSpace`. +- Use precise exception types and avoid catch-and-swallow patterns. + +## Documentation + +- Mirror existing documentation style; add comments only when they clarify intent or public APIs require it. + +## Testing + +- Use NUnit for new or changed tests and follow existing naming patterns. diff --git a/.github/principal-software-engineer.agent.md b/.github/principal-software-engineer.agent.md new file mode 100644 index 0000000..ef0a9a4 --- /dev/null +++ b/.github/principal-software-engineer.agent.md @@ -0,0 +1,42 @@ +--- +description: 'Provide principal-level software engineering guidance with focus on engineering excellence, technical leadership, and pragmatic implementation.' +name: 'Principal software engineer' +tools: ['changes', 'search/codebase', 'edit/editFiles', 'extensions', 'web/fetch', 'findTestFiles', 'githubRepo', 'new', 'openSimpleBrowser', 'problems', 'runCommands', 'runTasks', 'runTests', 'search', 'search/searchResults', 'runCommands/terminalLastCommand', 'runCommands/terminalSelection', 'testFailure', 'usages', 'vscodeAPI', 'github'] +--- +# Principal software engineer mode instructions + +You are in principal software engineer mode. Your task is to provide expert-level engineering guidance that balances craft excellence with pragmatic delivery as if you were Martin Fowler, renowned software engineer and thought leader in software design. + +## Core Engineering Principles + +You will provide guidance on: + +- **Engineering Fundamentals**: Gang of Four design patterns, SOLID principles, DRY, YAGNI, and KISS - applied pragmatically based on context +- **Clean Code Practices**: Readable, maintainable code that tells a story and minimizes cognitive load +- **Test Automation**: Comprehensive testing strategy including unit, integration, and end-to-end tests with clear test pyramid implementation +- **Quality Attributes**: Balancing testability, maintainability, scalability, performance, security, and understandability +- **Technical Leadership**: Clear feedback, improvement recommendations, and mentoring through code reviews + +## Implementation Focus + +- **Requirements Analysis**: Carefully review requirements, document assumptions explicitly, identify edge cases and assess risks +- **Implementation Excellence**: Implement the best design that meets architectural requirements without over-engineering +- **Pragmatic Craft**: Balance engineering excellence with delivery needs - good over perfect, but never compromising on fundamentals +- **Forward Thinking**: Anticipate future needs, identify improvement opportunities, and proactively address technical debt + +## Technical Debt Management + +When technical debt is incurred or identified: + +- **MUST** offer to create GitHub Issues using the `create_issue` tool to track remediation +- Clearly document consequences and remediation plans +- Regularly recommend GitHub Issues for requirements gaps, quality issues, or design improvements +- Assess long-term impact of untended technical debt + +## Deliverables + +- Clear, actionable feedback with specific improvement recommendations +- Risk assessments with mitigation strategies +- Edge case identification and testing strategies +- Explicit documentation of assumptions and decisions +- Technical debt remediation plans with GitHub Issue creation From c8d62d920d79689b74eac84027fe8bd2a8848ee4 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Mon, 23 Feb 2026 20:20:00 +0000 Subject: [PATCH 03/13] Fix CI artifacts and line endings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++---- Directory.Build.props | 21 ++++++++++----------- UnitTests/PListObjectTests.cs | 2 ++ 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a249787..dfb7207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,11 +28,28 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} - - name: Build - run: dotnet build Xamarin.MacDev.sln -c Release -bl:${{ github.workspace }}/artifacts/build.binlog + - name: Prepare artifacts directories + shell: bash + run: | + mkdir -p "${{ github.workspace }}/artifacts" + mkdir -p "${{ github.workspace }}/artifacts/test-results" + mkdir -p "${{ github.workspace }}/artifacts/packages" + + - name: Build (Windows) + if: runner.os == 'Windows' + run: dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -c Release -bl:${{ github.workspace }}/artifacts/build.binlog + + - name: Build (macOS) + if: runner.os == 'macOS' + run: dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -c Release -bl:${{ github.workspace }}/artifacts/build.binlog - - name: Test - run: dotnet test Xamarin.MacDev.sln -c Release --no-build -l "console;verbosity=detailed" -l trx --results-directory ${{ github.workspace }}/artifacts/test-results + - name: Test (Windows) + if: runner.os == 'Windows' + run: dotnet test UnitTests/UnitTests.csproj -c Release -l "console;verbosity=detailed" -l trx --results-directory ${{ github.workspace }}/artifacts/test-results + + - name: Test (macOS) + if: runner.os == 'macOS' + run: dotnet test UnitTests/UnitTests.csproj -c Release -f net10.0 -l "console;verbosity=detailed" -l trx --results-directory ${{ github.workspace }}/artifacts/test-results - name: Calculate Version (Windows) if: runner.os == 'Windows' @@ -56,6 +73,7 @@ jobs: echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - name: Pack NuGet + if: runner.os == 'Windows' run: dotnet pack Xamarin.MacDev/Xamarin.MacDev.csproj -c Release --no-build -p:PackageVersion=${{ env.PACKAGE_VERSION }} -o ${{ github.workspace }}/artifacts/packages - name: Upload Build Artifacts @@ -66,6 +84,7 @@ jobs: - name: Upload NuGet Package uses: actions/upload-artifact@v4 + if: runner.os == 'Windows' with: name: nuget-package-${{ matrix.os }} path: ${{ github.workspace }}/artifacts/packages/*.nupkg diff --git a/Directory.Build.props b/Directory.Build.props index 12011f2..dd7c732 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,14 +1,13 @@ - - Debug - https://github.com/dotnet/macios-devtools - git - net10.0 - + + Debug + https://github.com/dotnet/macios-devtools + git + - - $(MSBuildThisFileDirectory)bin\ - $(BaseOutputPath)$(Configuration)\ - $(BaseOutputPath)Test$(Configuration)\ - + + $(MSBuildThisFileDirectory)bin\ + $(BaseOutputPath)$(Configuration)\ + $(BaseOutputPath)Test$(Configuration)\ + diff --git a/UnitTests/PListObjectTests.cs b/UnitTests/PListObjectTests.cs index 1df301c..5204a0c 100644 --- a/UnitTests/PListObjectTests.cs +++ b/UnitTests/PListObjectTests.cs @@ -96,6 +96,8 @@ public void TestIntegerXmlSerialization () expected = Encoding.UTF8.GetString (buffer); } + output = output.Replace ("\r\n", "\n").Replace ("\r", "\n"); + expected = expected.Replace ("\r\n", "\n").Replace ("\r", "\n"); Assert.That (output, Is.EqualTo (expected)); } From 6bbfc2b591396ccbdd3b07610db2cf272c132e6a Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 14:05:33 +0000 Subject: [PATCH 04/13] Fix UnitTests path detection Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- UnitTests/TestHelper.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/UnitTests/TestHelper.cs b/UnitTests/TestHelper.cs index 52004a7..9af1a70 100644 --- a/UnitTests/TestHelper.cs +++ b/UnitTests/TestHelper.cs @@ -52,8 +52,19 @@ static TestHelper () var dir = Path.GetDirectoryName (codeBase); - while (Path.GetFileName (dir) != "UnitTests") - dir = Path.GetFullPath (Path.Combine (dir, "..")); + while (!string.Equals (Path.GetFileName (dir), "UnitTests", StringComparison.Ordinal)) { + var candidate = Path.Combine (dir, "UnitTests"); + if (Directory.Exists (candidate)) { + dir = candidate; + break; + } + + var parent = Path.GetDirectoryName (dir); + if (string.IsNullOrEmpty (parent)) + throw new DirectoryNotFoundException ($"Unable to locate UnitTests directory from '{codeBase}'."); + + dir = parent; + } ProjectDir = Path.GetFullPath (dir); } From 1ccae0b76e2303a46a4c3d486d851418233b1f2d Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 16:17:34 +0000 Subject: [PATCH 05/13] Address PR feedback wording Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Xamarin.MacDev/Xamarin.MacDev.csproj | 4 ++-- build-tools/scripts/msbuild.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Xamarin.MacDev/Xamarin.MacDev.csproj b/Xamarin.MacDev/Xamarin.MacDev.csproj index cbe8676..ed0a80a 100644 --- a/Xamarin.MacDev/Xamarin.MacDev.csproj +++ b/Xamarin.MacDev/Xamarin.MacDev.csproj @@ -15,9 +15,9 @@ Microsoft MIT https://github.com/dotnet/macios-devtools - Xamarin tools for interacting with Apple SDKs. + Tools for interacting with Apple SDKs. Copyright © Microsoft - Xamarin;macOS;iOS;Apple + macOS;iOS;Apple README.md diff --git a/build-tools/scripts/msbuild.mk b/build-tools/scripts/msbuild.mk index 0682cd3..e86a101 100644 --- a/build-tools/scripts/msbuild.mk +++ b/build-tools/scripts/msbuild.mk @@ -2,7 +2,7 @@ # MSBuild Abstraction. # # Makefile targets which need to invoke MSBuild should use `$(MSBUILD)`, -# not some specific MSBuild program such as `xbuild` or `msbuild`. +# not some specific MSBuild program such as `dotnet build` or `msbuild`. # # Typical use will also include `$(MSBUILD_FLAGS)`, which provides the # Configuration and logging verbosity, as per $(CONFIGURATION) and $(V): From 6c844877bbdbcba349806f1876f3c46d06e1c022 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 16:24:12 +0000 Subject: [PATCH 06/13] Update .github/workflows/ci.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfb7207..b707fe1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,12 @@ jobs: with: dotnet-version: ${{ env.DOTNET_VERSION }} + - name: Prepare artifacts directories + shell: bash + run: | + mkdir -p "${{ github.workspace }}/artifacts" + mkdir -p "${{ github.workspace }}/artifacts/test-results" + mkdir -p "${{ github.workspace }}/artifacts/packages" - name: Prepare artifacts directories shell: bash run: | From 3f4467acd7d1e969495a1bf7bd9615880a423760 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 16:26:12 +0000 Subject: [PATCH 07/13] Use bash for version step Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b707fe1..067ab5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,19 +57,8 @@ jobs: if: runner.os == 'macOS' run: dotnet test UnitTests/UnitTests.csproj -c Release -f net10.0 -l "console;verbosity=detailed" -l trx --results-directory ${{ github.workspace }}/artifacts/test-results - - name: Calculate Version (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - $hashOfLastVersionChange = git log --follow -1 --pretty=%H nuget.version - $commitsSinceVersionChange = git rev-list --count "$hashOfLastVersionChange..HEAD" - $majorMinor = Get-Content nuget.version - $version = "$majorMinor.$commitsSinceVersionChange" - Write-Host "Package version: $version" - echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV - - - name: Calculate Version (macOS/Linux) - if: runner.os != 'Windows' + - name: Calculate Version + shell: bash run: | HASH_OF_LAST_VERSION_CHANGE=$(git log --follow -1 --pretty=%H nuget.version) COMMITS_SINCE_VERSION_CHANGE=$(git rev-list --count "$HASH_OF_LAST_VERSION_CHANGE..HEAD") From 202c284c5e4c3f9ce01790960e447fd73b79181b Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 16:29:09 +0000 Subject: [PATCH 08/13] Remove duplicate CI prepare step Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 067ab5b..5ba329f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,13 +34,6 @@ jobs: mkdir -p "${{ github.workspace }}/artifacts" mkdir -p "${{ github.workspace }}/artifacts/test-results" mkdir -p "${{ github.workspace }}/artifacts/packages" - - name: Prepare artifacts directories - shell: bash - run: | - mkdir -p "${{ github.workspace }}/artifacts" - mkdir -p "${{ github.workspace }}/artifacts/test-results" - mkdir -p "${{ github.workspace }}/artifacts/packages" - - name: Build (Windows) if: runner.os == 'Windows' run: dotnet build Xamarin.MacDev/Xamarin.MacDev.csproj -c Release -bl:${{ github.workspace }}/artifacts/build.binlog From d2d46c29abe6092f02aaceed1fc523daefcba6aa Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 17:16:36 +0000 Subject: [PATCH 09/13] Update README macios link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index aa98c19..6c86f57 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# Xamarin.MacDev - -## Welcome! - -This module is a support repository used by both **Xamarin.iOS** and **Xamarin.Mac**. - -It contains support libraries used during msbuild builds. - -See [xamarin-macios](https://github.com/xamarin/xamarin-macios/blob/master/README.md#contributing) for more information on contributing to and providing feedback on Xamarin.iOS and Xamarin.Mac. - -## License - -Copyright (c) .NET Foundation Contributors. All rights reserved. -Licensed under the [MIT](https://github.com/xamarin/Xamarin.MacDev/blob/master/LICENSE) License. +# Xamarin.MacDev + +## Welcome! + +This module is a support repository used by both **Xamarin.iOS** and **Xamarin.Mac**. + +It contains support libraries used during msbuild builds. + +See [dotnet/macios](https://github.com/dotnet/macios) for more information on contributing to and providing feedback on Xamarin.iOS and Xamarin.Mac. + +## License + +Copyright (c) .NET Foundation Contributors. All rights reserved. +Licensed under the [MIT](https://github.com/xamarin/Xamarin.MacDev/blob/master/LICENSE) License. From 1fbd8da92167d492b3dc2bed6999f576e9db5ba4 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 17:18:00 +0000 Subject: [PATCH 10/13] Normalize README line endings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6c86f57..ad9f03a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# Xamarin.MacDev - -## Welcome! - -This module is a support repository used by both **Xamarin.iOS** and **Xamarin.Mac**. - -It contains support libraries used during msbuild builds. - -See [dotnet/macios](https://github.com/dotnet/macios) for more information on contributing to and providing feedback on Xamarin.iOS and Xamarin.Mac. - -## License - -Copyright (c) .NET Foundation Contributors. All rights reserved. -Licensed under the [MIT](https://github.com/xamarin/Xamarin.MacDev/blob/master/LICENSE) License. +# Xamarin.MacDev + +## Welcome! + +This module is a support repository used by both **Xamarin.iOS** and **Xamarin.Mac**. + +It contains support libraries used during msbuild builds. + +See [dotnet/macios](https://github.com/dotnet/macios) for more information on contributing to and providing feedback on Xamarin.iOS and Xamarin.Mac. + +## License + +Copyright (c) .NET Foundation Contributors. All rights reserved. +Licensed under the [MIT](https://github.com/xamarin/Xamarin.MacDev/blob/master/LICENSE) License. From 757b93f121f389200e1465a1a1b6ba8cecc9de2e Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 17:23:18 +0000 Subject: [PATCH 11/13] Move build helpers under eng Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Makefile | 2 +- {build-tools => eng}/scripts/msbuild.mk | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {build-tools => eng}/scripts/msbuild.mk (100%) diff --git a/Makefile b/Makefile index 5cb50c5..ec6a519 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CONFIGURATION := Debug V ?= 0 -include build-tools/scripts/msbuild.mk +include eng/scripts/msbuild.mk all: $(MSBUILD) $(MSBUILD_FLAGS) Xamarin.MacDev.sln diff --git a/build-tools/scripts/msbuild.mk b/eng/scripts/msbuild.mk similarity index 100% rename from build-tools/scripts/msbuild.mk rename to eng/scripts/msbuild.mk From 52fb3b1474a4cd8182210e1f23530f07c8f23a5d Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 17:56:10 +0000 Subject: [PATCH 12/13] Normalize csproj line endings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Xamarin.MacDev/Xamarin.MacDev.csproj | 114 +++++++++++++-------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Xamarin.MacDev/Xamarin.MacDev.csproj b/Xamarin.MacDev/Xamarin.MacDev.csproj index ed0a80a..cc10fbd 100644 --- a/Xamarin.MacDev/Xamarin.MacDev.csproj +++ b/Xamarin.MacDev/Xamarin.MacDev.csproj @@ -1,57 +1,57 @@ - - - - netstandard2.0;net10.0 - true - false - latest - true - enable - - - - - Xamarin.MacDev - Microsoft - MIT - https://github.com/dotnet/macios-devtools - Tools for interacting with Apple SDKs. - Copyright © Microsoft - macOS;iOS;Apple - README.md - - - - - $(ToolOutputFullPath) - - - - - true - true - - - - - - - - - - - - runtime; build; native; contentfiles; analyzers - all - - - - - - - - Microsoft400 - - - - + + + + netstandard2.0;net10.0 + true + false + latest + true + enable + + + + + Xamarin.MacDev + Microsoft + MIT + https://github.com/dotnet/macios-devtools + Tools for interacting with Apple SDKs. + Copyright © Microsoft + macOS;iOS;Apple + README.md + + + + + $(ToolOutputFullPath) + + + + + true + true + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers + all + + + + + + + + Microsoft400 + + + + From 6b40af4371f32920ba9fe0e1c5a4df2f9f250912 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Tue, 24 Feb 2026 18:03:56 +0000 Subject: [PATCH 13/13] Add Azure Pipelines CI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- azure-pipelines.yaml | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 azure-pipelines.yaml diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml new file mode 100644 index 0000000..58a9cd4 --- /dev/null +++ b/azure-pipelines.yaml @@ -0,0 +1,91 @@ +name: macios-devtools $(Rev:r) + +trigger: +- main +- release/* + +pr: +- main +- release/* + +variables: + - name: DotNetCoreVersion + value: 10.0.x + +jobs: +- job: build + displayName: Build and Test + timeoutInMinutes: 60 + strategy: + matrix: + macOS: + vmImage: macOS-15 + windows: + vmImage: windows-2022 + pool: + vmImage: $(vmImage) + workspace: + clean: all + steps: + - checkout: self + clean: true + fetchDepth: 0 + + - task: UseDotNet@2 + displayName: Use .NET Core $(DotNetCoreVersion) + inputs: + version: $(DotNetCoreVersion) + + - task: DotNetCoreCLI@2 + displayName: Build Xamarin.MacDev + inputs: + command: build + projects: Xamarin.MacDev/Xamarin.MacDev.csproj + arguments: -c Release -bl:$(Build.ArtifactStagingDirectory)/build.binlog + + - task: DotNetCoreCLI@2 + displayName: Run Tests (Windows) + inputs: + command: test + projects: UnitTests/UnitTests.csproj + arguments: -c Release --logger "console;verbosity=detailed" --logger trx --results-directory $(Build.ArtifactStagingDirectory)/test-results + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + + - task: DotNetCoreCLI@2 + displayName: Run Tests (macOS) + inputs: + command: test + projects: UnitTests/UnitTests.csproj + arguments: -c Release -f net10.0 --logger "console;verbosity=detailed" --logger trx --results-directory $(Build.ArtifactStagingDirectory)/test-results + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) + + - powershell: | + $hashOfLastVersionChange = & "git" "log" "--follow" "-1" "--pretty=%H" "nuget.version" + $commitsSinceVersionChange = & "git" "rev-list" "--count" "$hashOfLastVersionChange..HEAD" + $majorMinor = Get-Content "nuget.version" + $version = "$majorMinor.$commitsSinceVersionChange" + Write-Host "##vso[task.setvariable variable=xmd.nuget.version]$version" + displayName: Calculate Version (Windows) + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + + - task: DotNetCoreCLI@2 + displayName: Build NuGet (Windows) + inputs: + command: custom + projects: Xamarin.MacDev/Xamarin.MacDev.csproj + custom: pack + arguments: -c Release --no-build -p:PackageVersion=$(xmd.nuget.version) -p:PackageOutputPath=$(Build.ArtifactStagingDirectory)/packages -bl:$(Build.ArtifactStagingDirectory)/pack.binlog + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + + - task: PublishPipelineArtifact@1 + displayName: Upload Build Output + inputs: + path: bin/Release + artifactName: Output - $(System.JobName) + + - task: PublishPipelineArtifact@1 + displayName: Upload Artifacts + inputs: + path: $(Build.ArtifactStagingDirectory) + artifactName: Artifacts - $(System.JobName) + condition: always()