Skip to content

Commit

Permalink
Fix: SDK failing to build due to changes on virtual machines. (#153)
Browse files Browse the repository at this point in the history
* Update .gitignore

* Add Xamarin setup for macos

* test

* Check if it is working on macos 13

* Create Skip.UWP.MacOs.props

* Update Directory.Build.props

* Update build.yaml

* manually include builds

* only build uwp on windows

* use full path

* dont load scripts on other levels than root

* let all projects know the targets but only run them on the root folder

* use same method that sentry dotnet uses for different platforms

* nit

* fix format

* remove another uwp project from macos

* remove junk

* Update .gitignore
  • Loading branch information
lucas-zimerman committed May 1, 2024
1 parent 7917b68 commit be29090
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 21 deletions.
38 changes: 18 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
os: [windows-latest, macos-13]
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v1.1
Expand All @@ -27,8 +27,21 @@ jobs:
run:
pwsh ./scripts/install-win-sdk.ps1 16299
if: startsWith(matrix.os, 'windows')
- name: Setup Java SDK

# Setup Xamarin SDK that got removed on the latest MacOS VM
- name: Setup Xamarin MacOS SDK
if: startsWith(matrix.os, 'macos')
run: |
brew tap homebrew/cask-versions
brew install --cask xamarin-mac
- name: Setup Xamarin Android SDK
if: startsWith(matrix.os, 'macos')
run: brew install --cask xamarin-android
- name: Setup Xamarin iOS SDK
if: startsWith(matrix.os, 'macos')
run: brew install --cask xamarin-ios

- name: Setup Java SDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand All @@ -40,24 +53,9 @@ jobs:
packages: 'platforms;android-30'

- run: msbuild Sentry.Xamarin.sln -p:Configuration=Release -t:restore

- name: Build Solution with MSBuild
run: msbuild Sentry.Xamarin.sln -p:Configuration=Release
- name: Restore iOS Sample app NuGet
run: msbuild Samples/Sample.Xamarin.iOS/Sample.Xamarin.iOS.csproj -p:Configuration=Release -t:restore
if: startsWith(matrix.os, 'macos')
- name: Build iOS Sample app
run: msbuild Samples/Sample.Xamarin.iOS/Sample.Xamarin.iOS.csproj -p:Configuration=Release
if: startsWith(matrix.os, 'macos')
- name: Build Android Sample app
run: msbuild Samples/Sample.Xamarin.Droid/Sample.Xamarin.Droid.csproj -p:Configuration=Release
if: startsWith(matrix.os, 'windows')
- name: Build UWP Sample app
run: msbuild Samples/Sample.Xamarin.UWP/Sample.Xamarin.UWP.csproj /p:Platform=x64 /p:Configuration=Release
if: startsWith(matrix.os, 'windows')
- name: Build UWP Test Project
run: msbuild Tests/Sentry.Xamarin.Forms.UWP.Tests/Sentry.Xamarin.Forms.UWP.Tests.csproj /p:Platform=x64 /p:Configuration=Release
if: startsWith(matrix.os, 'windows')
- name: Build SDK, Sample and Tests
run: msbuild Sentry.Xamarin-CI-Build-${{ runner.os }}.slnf -p:Configuration=Release

- name: Setup VS Test
uses: darenm/Setup-VSTest@v1
if: startsWith(matrix.os, 'windows')
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,4 +345,4 @@ healthchecksdb
/Tests/Sentry.Xamarin.Forms.Tests.UWP/Sentry.Xamarin.Forms.Tests.UWP.GeneratedMSBuildEditorConfig.editorconfig

#Do not include tokens to external sources.
*.sentryclirc
*.sentryclirc
17 changes: 17 additions & 0 deletions Sentry.Xamarin-CI-Build-Windows.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"solution": {
"path": "Sentry.Xamarin.sln",
"projects": [
"Src\\Sentry.Xamarin\\Sentry.Xamarin.csproj",
"Src\\Sentry.Xamarin.Forms\\Sentry.Xamarin.Forms.csproj",
"Samples\\Sample.Xamarin.Core\\Sample.Xamarin.Core.csproj",
"Samples\\Sample.Xamarin.UWP\\Sample.Xamarin.UWP.csproj",
"Samples\\Sample.Xamarin.Mac\\Sample.Xamarin.Mac.csproj",
"Samples\\Forms\\com.sentry.ovenlibrary\\com.sentry.ovenlibrary.csproj",
"Samples\\Sample.Xamarin.Droid\\Sample.Xamarin.Droid.csproj",
"Tests\\Sentry.Xamarin.Forms.Testing\\Sentry.Xamarin.Forms.Testing.csproj",
"Tests\\Sentry.Xamarin.Tests\\Sentry.Xamarin.Tests.csproj",
"Tests\\Sentry.Xamarin.Forms.UWP.Tests\\Sentry.Xamarin.Forms.UWP.Tests.csproj"
]
}
}
15 changes: 15 additions & 0 deletions Sentry.Xamarin-CI-Build-macOS.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"solution": {
"path": "Sentry.Xamarin.sln",
"projects": [
"Src\\Sentry.Xamarin\\Sentry.Xamarin.csproj",
"Src\\Sentry.Xamarin.Forms\\Sentry.Xamarin.Forms.csproj",
"Samples\\Sample.Xamarin.Core\\Sample.Xamarin.Core.csproj",
"Samples\\Sample.Xamarin.Mac\\Sample.Xamarin.Mac.csproj",
"Samples\\Forms\\com.sentry.ovenlibrary\\com.sentry.ovenlibrary.csproj",
"Samples\\Sample.Xamarin.Droid\\Sample.Xamarin.Droid.csproj",
"Tests\\Sentry.Xamarin.Forms.Testing\\Sentry.Xamarin.Forms.Testing.csproj",
"Tests\\Sentry.Xamarin.Tests\\Sentry.Xamarin.Tests.csproj"
]
}
}

0 comments on commit be29090

Please sign in to comment.