diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e05d1f5..1f65364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,18 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Select Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 16.4 + #xcode-version: latest-stable + + - name: Get Xcode Version + id: xcode + uses: ./.github/actions/xcode-version + with: + min_version: '16.4' + - name: Setup .NET uses: actions/setup-dotnet@v4 with: @@ -27,17 +39,6 @@ jobs: - name: Install MAUI workloads run: dotnet workload install maui-ios maui-android - - name: Select Xcode version - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - - name: Get Xcode Version - id: xcode - uses: ./.github/actions/xcode-version - with: - min_version: '16.4' - - name: Build env: dotnet-target: "${{ steps.xcode.outputs.xcode_min_version != 'true' && '-p:DotNetTarget=8.0' || '' }}" diff --git a/CheatSheet.md b/CheatSheet.md index bafe4a7..210a0ac 100644 --- a/CheatSheet.md +++ b/CheatSheet.md @@ -4,5 +4,17 @@ My personal cheat sheet for things to remember ## Build With Full Log Make a build and write the full log to `publish.log`. Good for debugging MSBuild. ``` -dotnet publish -f:net9.0-ios --verbosity diagnostic --tl:off MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj > publish.log +dotnet publish -f:net9.0-ios -v:diag --tl:off MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj > publish.log +``` + +## Build For iOS Device +In order to build for device (and not simulator) you must provide the `RuntimeIdentifier`. +This makes a debug build for iOS device. +``` +dotnet build -f:net9.0-ios -r:ios-arm64 MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj +``` + +## See Xcode project settings +``` +xcodebuild -showBuildSettings -scheme MAUI.Native.Embedded.ios -project MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj ``` diff --git a/MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj b/MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj index 1118b4c..12bc74b 100644 --- a/MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj +++ b/MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj @@ -53,7 +53,9 @@ + + diff --git a/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.clip.xcscheme b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.clip.xcscheme new file mode 100644 index 0000000..3341650 --- /dev/null +++ b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.clip.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.widget.xcscheme b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.widget.xcscheme new file mode 100644 index 0000000..8d865af --- /dev/null +++ b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.widget.xcscheme @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.xcscheme b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.xcscheme new file mode 100644 index 0000000..1da329d --- /dev/null +++ b/MAUI.Native.Embedded.Sample/Platforms/iOS/MAUI.Native.Embedded.ios/MAUI.Native.Embedded.ios.xcodeproj/xcshareddata/xcschemes/MAUI.Native.Embedded.ios.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MAUI.Native.Embedded.nuget/MAUI.Native.Embedded.nuget.csproj b/MAUI.Native.Embedded.nuget/MAUI.Native.Embedded.nuget.csproj index df658d5..354b7d6 100644 --- a/MAUI.Native.Embedded.nuget/MAUI.Native.Embedded.nuget.csproj +++ b/MAUI.Native.Embedded.nuget/MAUI.Native.Embedded.nuget.csproj @@ -40,6 +40,7 @@ + diff --git a/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.appclips.targets b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.appclips.targets index f8f0cb4..4ac72fb 100644 --- a/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.appclips.targets +++ b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.appclips.targets @@ -34,12 +34,12 @@ - + - true + <_IsAppClips>true @@ -50,9 +50,9 @@ - + - + @@ -63,7 +63,7 @@ <_AppClipsInfoPList Include="%(_AppClipsFiles.FullPath)" Condition="'%(_AppClipsFiles.Filename)%(_AppClipsFiles.Extension)' == 'Info.plist'" /> - + @@ -80,23 +80,28 @@ - - <_AppClipsMobileProvisioning Condition="'%(AppClips.SkipValidation)' != 'true'" Include="%(AppClips.ArchivePath)/**/AppClips/**/embedded.mobileprovision" /> + + + <_AppClipsMobileProvisioning Condition="'@(AppClipsTarget)' != ''" Include="%(AppClipsTarget.FullPath)/**/AppClips/**/embedded.mobileprovision" /> + Command="xcrun security cms -D -i '%(_AppClipsMobileProvisioning.FullPath)' | xcrun plutil -extract 'Entitlements.com\.apple\.developer\.parent-application-identifiers' xml1 -o - - | grep -q '$(ApplicationId)<'" + IgnoreExitCode="true" + StandardOutputImportance="Low"> - + @@ -105,7 +110,7 @@ AppClips - + \ No newline at end of file diff --git a/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.common.targets b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.common.targets index afafb96..ff13696 100644 --- a/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.common.targets +++ b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.ios.common.targets @@ -27,9 +27,17 @@ %(XcodeProjects.Filename) $(Configuration) - $(XcodeParams) CODE_SIGN_IDENTITY=”” CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - $([System.Guid]::NewGuid()) + $(XcodeParams) CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + + + + + + + + + @@ -56,7 +64,7 @@ <_XcodeDestination Condition="$(TargetPlatformIdentifier) == 'ios'">iOS - <_XcodeDestination Condition="$(RuntimeIdentifier.Contains('iossimulator')) == true">iOS Simulator + <_XcodeDestination Condition="$(RuntimeIdentifier.Contains('simulator')) == true">$(_XcodeDestination) Simulator $(XCodeCommonParams) -destination 'generic/platform=$(_XcodeDestination)' @@ -70,7 +78,7 @@ + %(XcodeProjects.XcodeParams) \ + $(XCodeCommonParams)" /> - true + <_IsWidgets>true @@ -53,7 +53,7 @@ - + @@ -83,7 +83,7 @@ + Command="xcrun security cms -D -i '%(_WidgetsAppexMobileProvision.FullPath)' | xcrun plutil -extract Entitlements xml1 -o - - > '%(_WidgetsAppexMobileProvision.EntitlementPath)'" /> @@ -104,7 +104,7 @@ Widgets - + \ No newline at end of file diff --git a/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.tasks.targets b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.tasks.targets new file mode 100644 index 0000000..66ff62d --- /dev/null +++ b/MAUI.Native.Embedded.nuget/build/MAUI.Native.Embedded.tasks.targets @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + () + .Where(k => !k.StartsWith("_")) + .Where(k => !Exclude?.Contains(k) is false) + .Distinct() + .OrderBy(k => k) + .Select(k => $@"{k}={item.GetMetadata(k)}")); + + using (var md5 = MD5.Create()) + { + var digest = md5.ComputeHash(Encoding.UTF8.GetBytes(seed)); + item.SetMetadata("UniqueId", BitConverter.ToString(digest).Replace("-", "").ToLowerInvariant()); + } + } + + OutputItems = Items; + ]]> + + + + + \ No newline at end of file diff --git a/MAUI.Native.Embedded.nuget/build/MarLoe.MAUI.Native.Embedded.targets b/MAUI.Native.Embedded.nuget/build/MarLoe.MAUI.Native.Embedded.targets index 54b8977..6b7b541 100644 --- a/MAUI.Native.Embedded.nuget/build/MarLoe.MAUI.Native.Embedded.targets +++ b/MAUI.Native.Embedded.nuget/build/MarLoe.MAUI.Native.Embedded.targets @@ -1,5 +1,7 @@ + +