From ab96f7142113863ccaa2b3e6cde7bd67302842d7 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 7 Jun 2024 11:04:30 -0400 Subject: [PATCH] Add CommunityToolkit.Maui.BindingExtensions NuGet package (#22) Moves binding build targets and tasks into a NuGet package so that each slim binding does not need to copy and build the eng (now src) folder. Includes a handful of fixes for incremental builds and multi-targeting builds running in parallel. --- .github/workflows/build.yml | 23 ++- .gitignore | 2 +- ...ctory.Build.props => Directory.Build.props | 3 +- README.md | 4 +- build/nuget.png | Bin 0 -> 5913 bytes eng/Common.macios.targets | 118 --------------- eng/Common.targets | 19 --- ....Maui.BindingExtensions.Build.Tasks.csproj | 14 -- .../Facebook.Android.Binding.csproj | 5 +- .../Facebook.MaciOS.Binding.csproj | 4 +- .../MauiFacebook.xcodeproj/project.pbxproj | 4 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../Firebase.MaciOS.Binding.csproj | 4 +- .../GoogleCast.Binding.csproj | 5 +- nuget.config | 7 + .../BindingToolTaskTests.cs | 4 +- ...oolkit.Maui.BindingExtensions.Tests.csproj | 6 +- .../MockBuildEngine.cs | 2 +- ...ommunityToolkit.Maui.BindingExtensions.sln | 4 +- ...unityToolkit.Maui.BindingExtensions.csproj | 50 ++++++ .../MSBuildExtensions.cs | 2 +- .../Tasks/BindingToolTask.cs | 6 +- .../Tasks/Gradle.cs | 2 +- .../Tasks/Sharpie.cs | 2 +- .../Tasks/XcodeBuild.cs | 2 +- .../targets}/Common.android.targets | 26 +++- .../targets/Common.macios.targets | 143 ++++++++++++++++++ .../targets/Common.props | 12 ++ ...aui.BindingExtensions.multitargeting.props | 8 + ...nityToolkit.Maui.BindingExtensions.targets | 9 ++ 30 files changed, 302 insertions(+), 192 deletions(-) rename eng/Directory.Build.props => Directory.Build.props (52%) create mode 100644 build/nuget.png delete mode 100644 eng/Common.macios.targets delete mode 100644 eng/Common.targets delete mode 100644 eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Microsoft.Maui.BindingExtensions.Build.Tasks.csproj create mode 100644 nuget.config rename {eng/test/Microsoft.Maui.BindingExtensions.Build.Tests => src/CommunityToolkit.Maui.BindingExtensions.Tests}/BindingToolTaskTests.cs (94%) rename eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/Microsoft.Maui.BindingExtensions.Build.Tests.csproj => src/CommunityToolkit.Maui.BindingExtensions.Tests/CommunityToolkit.Maui.BindingExtensions.Tests.csproj (76%) rename {eng/test/Microsoft.Maui.BindingExtensions.Build.Tests => src/CommunityToolkit.Maui.BindingExtensions.Tests}/MockBuildEngine.cs (98%) rename eng/Microsoft.Maui.BindingExtensions.Build.Tasks.sln => src/CommunityToolkit.Maui.BindingExtensions.sln (72%) create mode 100644 src/CommunityToolkit.Maui.BindingExtensions/CommunityToolkit.Maui.BindingExtensions.csproj rename {eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks => src/CommunityToolkit.Maui.BindingExtensions}/MSBuildExtensions.cs (95%) rename {eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks => src/CommunityToolkit.Maui.BindingExtensions}/Tasks/BindingToolTask.cs (88%) rename {eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks => src/CommunityToolkit.Maui.BindingExtensions}/Tasks/Gradle.cs (96%) rename {eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks => src/CommunityToolkit.Maui.BindingExtensions}/Tasks/Sharpie.cs (95%) rename {eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks => src/CommunityToolkit.Maui.BindingExtensions}/Tasks/XcodeBuild.cs (94%) rename {eng => src/CommunityToolkit.Maui.BindingExtensions/targets}/Common.android.targets (69%) create mode 100644 src/CommunityToolkit.Maui.BindingExtensions/targets/Common.macios.targets create mode 100644 src/CommunityToolkit.Maui.BindingExtensions/targets/Common.props create mode 100644 src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.multitargeting.props create mode 100644 src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.targets diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 415a27a..8db71d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,24 +38,37 @@ jobs: - name: Create logs dir run: mkdir -p ${{ runner.temp }}/logs/ + - name: Create local nupkg dir + run: mkdir -p ./src/CommunityToolkit.Maui.BindingExtensions/bin/Release + - name: Build and test build tasks - working-directory: ./eng + working-directory: ./src run: >- - dotnet test Microsoft.Maui.BindingExtensions.Build.Tasks.sln + dotnet test CommunityToolkit.Maui.BindingExtensions.sln --logger trx --results-directory ${{ runner.temp }}/logs/TestResults-build-tasks -bl:${{ runner.temp }}/logs/build-tasks.binlog + - name: Pack build tasks + working-directory: ./src/CommunityToolkit.Maui.BindingExtensions + run: dotnet pack CommunityToolkit.Maui.BindingExtensions.csproj -bl:${{ runner.temp }}/logs/build-tasks-pack.binlog + + - name: Upload nupkg + uses: actions/upload-artifact@v4 + with: + name: nupkg + path: ./src/CommunityToolkit.Maui.BindingExtensions/bin/Release/*.nupkg + - name: Build facebook working-directory: ./facebook - run: dotnet build -m:1 -bl:${{ runner.temp }}/logs/facebook.binlog + run: dotnet build -bl:${{ runner.temp }}/logs/facebook.binlog - name: Build firebase working-directory: ./firebase/macios - run: dotnet build -m:1 -bl:${{ runner.temp }}/logs/firebase-macios.binlog + run: dotnet build -bl:${{ runner.temp }}/logs/firebase-macios.binlog - name: Build googlecast working-directory: ./googlecast/macios - run: dotnet build -m:1 -bl:${{ runner.temp }}/logs/googlecast-macios.binlog + run: dotnet build -bl:${{ runner.temp }}/logs/googlecast-macios.binlog - name: Upload logs uses: actions/upload-artifact@v4 diff --git a/.gitignore b/.gitignore index 42e658b..5680166 100644 --- a/.gitignore +++ b/.gitignore @@ -403,7 +403,7 @@ FodyWeavers.xsd xcuserdata/ -build/ +**/native/build/ .build/ *.xcframework Pods/ diff --git a/eng/Directory.Build.props b/Directory.Build.props similarity index 52% rename from eng/Directory.Build.props rename to Directory.Build.props index d27934c..449760c 100644 --- a/eng/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,8 @@ latest - 17.9.5 + 17.9.5 + 0.0.1-pre1 diff --git a/README.md b/README.md index 92a3156..bc6099c 100644 --- a/README.md +++ b/README.md @@ -100,9 +100,9 @@ Install prerequisites: The goal is to have bindings and samples building 100% through normal MSBuild invocations. -Each .NET Binding project contains some additional MSBuild logic to help obtain and build the native SDK dependencies along with the native slim binding project. In some cases, the target may also download native SDKs if they are not already present. In this way, the expected native artefacts are available in the expected working directories. +Each .NET Binding project contains some additional MSBuild logic to help obtain and build the native SDK dependencies along with the native slim binding project. In some cases, the target may also download native SDKs if they are not already present. In this way, the expected native artifacts are available in the expected working directories. -In the [```eng/```](/eng/) folder you will find [```Common.android.targets```](/eng/Common.android.targets) and [```Common.macios.targets```](/eng/Common.macios.targets) files which contain some custom build targets to help with this, and are imported into the binding projects. +In the [```src/```](/src/) folder you will find a solution with custom build tasks/targets to help with this. These build extensions are available in a CommunityToolkit.Maui.BindingExtensions NuGet package that the binding projects reference. Android binding projects generate the API definition automatically taking into account any optional manual modifications like those implemented via the [```Metadata.xml```](https://learn.microsoft.com/xamarin/android/platform/binding-java-library/customizing-bindings/java-bindings-metadata#metadataxml-transform-file) transform file. diff --git a/build/nuget.png b/build/nuget.png new file mode 100644 index 0000000000000000000000000000000000000000..27314ff2d7cca2f04b299988e5b201b15858c22d GIT binary patch literal 5913 zcmV+!7v|`RP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91YM=uE1ONa40RR91TmS$70RPU_kN^M{gGod|RCodHom-D3*Hy>s^mMmp zJf87od`*n)u@Z8bMc2`{Q<(Z%yGj*rSU=lLmJ1&($OE}z{eqUqDeb=l3Rm~+?2%nregT( zVRhm6f9(s;{l#eO43Wt54E=?xuYU3CpI2?atVz^88Ud%xqA3keatl)+$cTnG1SGN% z=p`P+>_PBaBU-=K`bOglp`fAf1~O6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^5(wcyi=;)1!fTe#qLwVOpm9qGnl?;K zdNf%iH_6<9_$mZ_U7K=Jwe4u1^`SFDM;xFU>w%B(W5OB1Q{7R04o;BV>#mA<2$x-; z9TPiHO!Rm*QM4#3vM7z9O~mA63K_bCiU3?_e2XD?%p0B0WOLcTK_0!PC~0_*awK9A zQ_ljP`i`1Sf+9`XYr>I5!SV`(BDLc!c1$xAFB+j=1@d21(91bTGBHtkq!C+~i|-}jB0D_XAp+)?~%r<}Xcu6Dv`Dn>M|O|ji^SDJ92!dR0F zW8+^K^6NA|s_PRCGUu1q?#A6$fM3)0ZC(GY>u(!mzV=^TY`ddarhJmduhR7Yogs8L zK0pOrM`}uKeI%@z+@?_&=>InwcBH>iv}SlWSzH1A62JJJviuJ}?4sHKg>KtMVbuS> zlhD|*+t@&7H`Xh_PNGTtpIOwF8sE07wka~(l8*DcPZ|7X;oJXZe6V)6Eh^x;(j;n2 zjiIfLZC)mjrLi1!Gzi$fS1W8c?zRGcq_C4{5|CZCwyU;jlyu`$6+R#2LU&tzsqDr~ v1!xKvJBe$pNt*A*t^&IX>?-j8u>$`Gpe?mBq~Uxo00000NkvXXu0mjfPZ66N literal 0 HcmV?d00001 diff --git a/eng/Common.macios.targets b/eng/Common.macios.targets deleted file mode 100644 index 2257827..0000000 --- a/eng/Common.macios.targets +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - Release - true - true - true - false - - <_XcArchiveExtraArgs>$(_XcArchiveExtraArgs) ENABLE_BITCODE=NO SKIP_INSTALL=NO SWIFT_INSTALL_OBJC_HEADER=YES BUILD_LIBRARY_FOR_DISTRIBUTION=YES - <_XcArchiveExtraArgs>$(_XcArchiveExtraArgs) OTHER_LDFLAGS="-ObjC" OTHER_SWIFT_FLAGS="-no-verify-emitted-module-interface" OBJC_CFLAGS="-fno-objc-msgsend-selector-stubs -ObjC" - - - - <_GenerateBindingsDependsOn> - _BuildXcodeProjects; - _SharpieBindXcodeProjects; - $(_GenerateBindingsDependsOn); - - - - - - Framework - true - - - - - - - <_XcbInputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)**/*.swift')" /> - <_XcbInputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)**/*.h')" /> - <_XcbInputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)**/*.pbxproj')" /> - <_XcbInputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)**/*.xcworkspace')"/> - <_XcbInputs Remove="@(XcodeProjectReference->'%(RootDir)%(Directory)build/**/*')" /> - - - - - - - - - - - - - - - - - - <_CreateXcFxArgs Include="-create-xcframework" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildiOS)' == 'true' " Include="@(XcodeProjectReference->'-archive %(RootDir)%(Directory)build/%(SchemeName)-ios.xcarchive')" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildiOS)' == 'true' " Include="-framework %(XcodeProjectReference.SchemeName).framework" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildiOSSimulator)' == 'true' " Include="@(XcodeProjectReference->'-archive %(RootDir)%(Directory)build/%(SchemeName)-iossimulator.xcarchive')" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildiOSSimulator)' == 'true' " Include="-framework %(XcodeProjectReference.SchemeName).framework" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildMacCatalyst)' == 'true' " Include="@(XcodeProjectReference->'-archive %(RootDir)%(Directory)build/%(SchemeName)-maccatalyst.xcarchive')" /> - <_CreateXcFxArgs Condition=" '$(XcodeBuildMacCatalyst)' == 'true' " Include="-framework %(XcodeProjectReference.SchemeName).framework" /> - <_CreateXcFxArgs Include="@(XcodeProjectReference->'-output %(RootDir)%(Directory)build/%(SchemeName).xcframework')" /> - - - - - - - - - - %(XcodeProjectReference.Kind) - %(XcodeProjectReference.SmartLink) - - - - - - - - - - - <_SharpieInputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)build/%(SchemeName)-ios.xcarchive/Products/Library/Frameworks/%(SchemeName).framework')" /> - - - - - - - <_ObjSharpieArgs Include="@(XcodeProjectReference->'--output=%(RootDir)%(Directory)build/sharpie')" /> - <_ObjSharpieArgs Include="--namespace=%(XcodeProjectReference.SharpieNamespace)" /> - <_ObjSharpieArgs Include="@(XcodeProjectReference->'--framework %(RootDir)%(Directory)build/%(SchemeName)-ios.xcarchive/Products/Library/Frameworks/%(SchemeName).framework')" /> - - - - - - diff --git a/eng/Common.targets b/eng/Common.targets deleted file mode 100644 index bcff14d..0000000 --- a/eng/Common.targets +++ /dev/null @@ -1,19 +0,0 @@ - - - - - true - $(MSBuildThisFileDirectory)src\Microsoft.Maui.BindingExtensions.Build.Tasks\bin\Debug\netstandard2.0\Microsoft.Maui.BindingExtensions.Build.Tasks.dll - $(USERPROFILE) - - - - - - - - - - diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Microsoft.Maui.BindingExtensions.Build.Tasks.csproj b/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Microsoft.Maui.BindingExtensions.Build.Tasks.csproj deleted file mode 100644 index 527bd05..0000000 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Microsoft.Maui.BindingExtensions.Build.Tasks.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - netstandard2.0 - enable - enable - - - - - - - - diff --git a/facebook/android/Facebook.Android.Binding/Facebook.Android.Binding.csproj b/facebook/android/Facebook.Android.Binding/Facebook.Android.Binding.csproj index 4a79ab2..af8c2a4 100644 --- a/facebook/android/Facebook.Android.Binding/Facebook.Android.Binding.csproj +++ b/facebook/android/Facebook.Android.Binding/Facebook.Android.Binding.csproj @@ -8,6 +8,10 @@ false + + + + @@ -17,5 +21,4 @@ - \ No newline at end of file diff --git a/facebook/macios/Facebook.MaciOS.Binding/Facebook.MaciOS.Binding.csproj b/facebook/macios/Facebook.MaciOS.Binding/Facebook.MaciOS.Binding.csproj index 9a6b3c8..f3092c7 100644 --- a/facebook/macios/Facebook.MaciOS.Binding/Facebook.MaciOS.Binding.csproj +++ b/facebook/macios/Facebook.MaciOS.Binding/Facebook.MaciOS.Binding.csproj @@ -7,10 +7,11 @@ - + + MauiFacebook Facebook @@ -21,5 +22,4 @@ - diff --git a/facebook/macios/native/MauiFacebook.xcodeproj/project.pbxproj b/facebook/macios/native/MauiFacebook.xcodeproj/project.pbxproj index 33794e1..e8530d6 100644 --- a/facebook/macios/native/MauiFacebook.xcodeproj/project.pbxproj +++ b/facebook/macios/native/MauiFacebook.xcodeproj/project.pbxproj @@ -404,8 +404,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/facebook/facebook-ios-sdk"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 14.1.0; + kind = exactVersion; + version = 16.3.1; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/facebook/macios/native/MauiFacebook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/facebook/macios/native/MauiFacebook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 70800b1..aae713b 100644 --- a/facebook/macios/native/MauiFacebook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/facebook/macios/native/MauiFacebook.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/facebook/facebook-ios-sdk", "state" : { - "revision" : "c19607d535864533523d1f437c84035e5fb101cf", - "version" : "14.1.0" + "revision" : "3fe31c168903759de1c5752d12856c5c437c6862", + "version" : "16.3.1" } } ], diff --git a/firebase/macios/Firebase.MaciOS.Binding/Firebase.MaciOS.Binding.csproj b/firebase/macios/Firebase.MaciOS.Binding/Firebase.MaciOS.Binding.csproj index 14367b1..5a83b21 100644 --- a/firebase/macios/Firebase.MaciOS.Binding/Firebase.MaciOS.Binding.csproj +++ b/firebase/macios/Firebase.MaciOS.Binding/Firebase.MaciOS.Binding.csproj @@ -8,10 +8,11 @@ - + + MauiFirebase Firebase @@ -22,5 +23,4 @@ - diff --git a/googlecast/macios/GoogleCast.Binding/GoogleCast.Binding.csproj b/googlecast/macios/GoogleCast.Binding/GoogleCast.Binding.csproj index 8ac1ce0..24f624e 100644 --- a/googlecast/macios/GoogleCast.Binding/GoogleCast.Binding.csproj +++ b/googlecast/macios/GoogleCast.Binding/GoogleCast.Binding.csproj @@ -5,15 +5,15 @@ true true - False $(BuildXcodeProjectsDependsOnTargets);NativeDependencies - + + MauiGoogleCast GoogleCast @@ -37,5 +37,4 @@ - diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..45e2c3b --- /dev/null +++ b/nuget.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/BindingToolTaskTests.cs b/src/CommunityToolkit.Maui.BindingExtensions.Tests/BindingToolTaskTests.cs similarity index 94% rename from eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/BindingToolTaskTests.cs rename to src/CommunityToolkit.Maui.BindingExtensions.Tests/BindingToolTaskTests.cs index 3b7a9e9..8bae523 100644 --- a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/BindingToolTaskTests.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions.Tests/BindingToolTaskTests.cs @@ -1,8 +1,8 @@ using FluentAssertions; -using Microsoft.Maui.BindingExtensions.Build.Tasks; +using CommunityToolkit.Maui.BindingExtensions; using NUnit.Framework; -namespace Microsoft.Maui.BindingExtensions.Build.Tests +namespace CommunityToolkit.Maui.BindingExtensions.Tests { [TestFixture] public class BindingToolTaskTests diff --git a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/Microsoft.Maui.BindingExtensions.Build.Tests.csproj b/src/CommunityToolkit.Maui.BindingExtensions.Tests/CommunityToolkit.Maui.BindingExtensions.Tests.csproj similarity index 76% rename from eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/Microsoft.Maui.BindingExtensions.Build.Tests.csproj rename to src/CommunityToolkit.Maui.BindingExtensions.Tests/CommunityToolkit.Maui.BindingExtensions.Tests.csproj index d597d32..dc06672 100644 --- a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/Microsoft.Maui.BindingExtensions.Build.Tests.csproj +++ b/src/CommunityToolkit.Maui.BindingExtensions.Tests/CommunityToolkit.Maui.BindingExtensions.Tests.csproj @@ -10,15 +10,15 @@ - - + + - + diff --git a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/MockBuildEngine.cs b/src/CommunityToolkit.Maui.BindingExtensions.Tests/MockBuildEngine.cs similarity index 98% rename from eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/MockBuildEngine.cs rename to src/CommunityToolkit.Maui.BindingExtensions.Tests/MockBuildEngine.cs index 00d9ce4..fbbb923 100644 --- a/eng/test/Microsoft.Maui.BindingExtensions.Build.Tests/MockBuildEngine.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions.Tests/MockBuildEngine.cs @@ -2,7 +2,7 @@ using Microsoft.Build.Framework; using NUnit.Framework; -namespace Microsoft.Maui.BindingExtensions.Build.Tests +namespace CommunityToolkit.Maui.BindingExtensions.Tests { public class MockBuildEngine : IBuildEngine4 { diff --git a/eng/Microsoft.Maui.BindingExtensions.Build.Tasks.sln b/src/CommunityToolkit.Maui.BindingExtensions.sln similarity index 72% rename from eng/Microsoft.Maui.BindingExtensions.Build.Tasks.sln rename to src/CommunityToolkit.Maui.BindingExtensions.sln index 029cc15..011b359 100644 --- a/eng/Microsoft.Maui.BindingExtensions.Build.Tasks.sln +++ b/src/CommunityToolkit.Maui.BindingExtensions.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.11.34809.278 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.BindingExtensions.Build.Tasks", "src\Microsoft.Maui.BindingExtensions.Build.Tasks\Microsoft.Maui.BindingExtensions.Build.Tasks.csproj", "{D1497B0B-A62D-49AD-833B-EFE4F87B1BEE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Maui.BindingExtensions", "CommunityToolkit.Maui.BindingExtensions\CommunityToolkit.Maui.BindingExtensions.csproj", "{D1497B0B-A62D-49AD-833B-EFE4F87B1BEE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.BindingExtensions.Build.Tests", "test\Microsoft.Maui.BindingExtensions.Build.Tests\Microsoft.Maui.BindingExtensions.Build.Tests.csproj", "{7BF30708-BC47-4379-8DC0-E7093AC2FED6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Maui.BindingExtensions.Tests", "CommunityToolkit.Maui.BindingExtensions.Tests\CommunityToolkit.Maui.BindingExtensions.Tests.csproj", "{7BF30708-BC47-4379-8DC0-E7093AC2FED6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/CommunityToolkit.Maui.BindingExtensions/CommunityToolkit.Maui.BindingExtensions.csproj b/src/CommunityToolkit.Maui.BindingExtensions/CommunityToolkit.Maui.BindingExtensions.csproj new file mode 100644 index 0000000..04bbe4e --- /dev/null +++ b/src/CommunityToolkit.Maui.BindingExtensions/CommunityToolkit.Maui.BindingExtensions.csproj @@ -0,0 +1,50 @@ + + + + netstandard2.0 + enable + enable + + + + CommunityToolkit.Maui.BindingExtensions + Toolkit with build tasks and extensions that support .NET MAUI slim binding projects + Microsoft + Microsoft + © Microsoft Corporation. All rights reserved. + MIT + https://github.com/Redth/DotNet.Platform.SlimBindings + https://github.com/Redth/DotNet.Platform.SlimBindings + CommunityToolkit.Maui.BindingExtensions + CommunityToolkit.Maui.BindingExtensions is a set of build tasks and extensions for .NET MAUI, .NET for Android, and .NET for iOS binding projects + nuget.png + $(AssemblyName) ($(TargetFramework)) + 1.0.0.0 + 1.0.0.0 + 0.0.1-pre1 + $(Version)$(VersionSuffix) + true + net,maui,netmaui,toolkit,kit,communitytoolkit,netmauitoolkit,mauicommunitytoolkit,slimbinding,binding + README.md + false + true + + + + + + + + + + + + + + + + + + + + diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/MSBuildExtensions.cs b/src/CommunityToolkit.Maui.BindingExtensions/MSBuildExtensions.cs similarity index 95% rename from eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/MSBuildExtensions.cs rename to src/CommunityToolkit.Maui.BindingExtensions/MSBuildExtensions.cs index 9827379..7c5325d 100644 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/MSBuildExtensions.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions/MSBuildExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Build.Utilities; -namespace Microsoft.Maui.BindingExtensions.Build.Tasks +namespace CommunityToolkit.Maui.BindingExtensions { public static class MSBuildExtensions { diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/BindingToolTask.cs b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/BindingToolTask.cs similarity index 88% rename from eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/BindingToolTask.cs rename to src/CommunityToolkit.Maui.BindingExtensions/Tasks/BindingToolTask.cs index 94a4779..c02cfd8 100644 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/BindingToolTask.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/BindingToolTask.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Framework; using Microsoft.Build.Utilities; -namespace Microsoft.Maui.BindingExtensions.Build.Tasks +namespace CommunityToolkit.Maui.BindingExtensions { public abstract class BindingToolTask : ToolTask { @@ -13,6 +13,9 @@ public abstract class BindingToolTask : ToolTask StringBuilder toolOutput = new StringBuilder(); + [Output] + public string ConsoleOutput { get; set; } = string.Empty; + public BindingToolTask() { } @@ -27,6 +30,7 @@ public override bool Execute() Log.LogCodedError($"{TaskPrefix}0000", toolOutput.ToString().Trim()); } + ConsoleOutput = toolOutput.ToString(); toolOutput.Clear(); return taskResult; } diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Gradle.cs b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/Gradle.cs similarity index 96% rename from eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Gradle.cs rename to src/CommunityToolkit.Maui.BindingExtensions/Tasks/Gradle.cs index 844e4ad..c6e060b 100644 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Gradle.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/Gradle.cs @@ -4,7 +4,7 @@ using Microsoft.Build.Framework; -namespace Microsoft.Maui.BindingExtensions.Build.Tasks +namespace CommunityToolkit.Maui.BindingExtensions { public class Gradle : BindingToolTask { diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Sharpie.cs b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/Sharpie.cs similarity index 95% rename from eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Sharpie.cs rename to src/CommunityToolkit.Maui.BindingExtensions/Tasks/Sharpie.cs index df7ba7f..eac638c 100644 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/Sharpie.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/Sharpie.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Framework; -namespace Microsoft.Maui.BindingExtensions.Build.Tasks +namespace CommunityToolkit.Maui.BindingExtensions { public class Sharpie : BindingToolTask { diff --git a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/XcodeBuild.cs b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/XcodeBuild.cs similarity index 94% rename from eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/XcodeBuild.cs rename to src/CommunityToolkit.Maui.BindingExtensions/Tasks/XcodeBuild.cs index 05d3a5c..7072547 100644 --- a/eng/src/Microsoft.Maui.BindingExtensions.Build.Tasks/Tasks/XcodeBuild.cs +++ b/src/CommunityToolkit.Maui.BindingExtensions/Tasks/XcodeBuild.cs @@ -3,7 +3,7 @@ using Microsoft.Build.Framework; -namespace Microsoft.Maui.BindingExtensions.Build.Tasks +namespace CommunityToolkit.Maui.BindingExtensions { public class XcodeBuild : BindingToolTask { diff --git a/eng/Common.android.targets b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.android.targets similarity index 69% rename from eng/Common.android.targets rename to src/CommunityToolkit.Maui.BindingExtensions/targets/Common.android.targets index 9b2fbb5..0917b91 100644 --- a/eng/Common.android.targets +++ b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.android.targets @@ -1,6 +1,5 @@ - @@ -16,23 +15,36 @@ + + <_BuildGradleProjectsBeforeTargets Condition=" '$(IsRunningOuterBuild)' == 'true' "> + DispatchToInnerBuilds; + + <_BuildGradleProjectsDependsOn Condition=" '$(IsRunningOuterBuild)' != 'true' "> + _ResolveMonoAndroidSdks; + + + + + <_GradleInputs Include="$(MSBuildProjectFullPath)" /> <_GradleInputs Include="%(GradleProjectReference.FullPath)/**/*.java" /> <_GradleInputs Include="%(GradleProjectReference.FullPath)/**/*.gradle" /> <_GradleInputs Include="%(GradleProjectReference.FullPath)/**/*.xml" /> <_GradleInputs Include="%(GradleProjectReference.FullPath)/**/*.properties"/> <_GradleInputs Remove="%(GradleProjectReference.FullPath)/%(GradleProjectReference.ModuleName)/build/**/*" /> + <_GradleOutputs Include="@(GradleProjectReference->'%(FullPath)/%(ModuleName)/build/outputs/aar/%(ModuleName)-$(GradleProjectConfiguration).aar')" /> - + Outputs="@(_GradleOutputs)" > + + - + %(GradleProjectReference.Bind) %(GradleProjectReference.Pack) %(GradleProjectReference.Visible) diff --git a/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.macios.targets b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.macios.targets new file mode 100644 index 0000000..8e67ad0 --- /dev/null +++ b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.macios.targets @@ -0,0 +1,143 @@ + + + + + + + + Release + true + true + true + + false + + <_XcArchiveExtraArgs>$(_XcArchiveExtraArgs) ENABLE_BITCODE=NO SKIP_INSTALL=NO SWIFT_INSTALL_OBJC_HEADER=YES BUILD_LIBRARY_FOR_DISTRIBUTION=YES + <_XcArchiveExtraArgs>$(_XcArchiveExtraArgs) OTHER_LDFLAGS="-ObjC" OTHER_SWIFT_FLAGS="-no-verify-emitted-module-interface" OBJC_CFLAGS="-fno-objc-msgsend-selector-stubs -ObjC" + + + + + Framework + true + %(RootDir)%(Directory)build/%(Filename)/ios.xcarchive + %(RootDir)%(Directory)build/%(Filename)/iossimulator.xcarchive + %(RootDir)%(Directory)build/%(Filename)/maccatalyst.xcarchive + + + + + <_BuildXcodeProjectsBeforeTargets> + BeforeBuild; + + <_BuildXcodeProjectsBeforeTargets Condition=" '$(IsRunningOuterBuild)' == 'true' "> + DispatchToInnerBuilds; + + + + + + + <_XcbInputs Include="$(MSBuildProjectFullPath)" /> + <_XcbInputs Include="%(XcodeProjectReference.RootDir)%(XcodeProjectReference.Directory)**/*.swift" /> + <_XcbInputs Include="%(XcodeProjectReference.RootDir)%(XcodeProjectReference.Directory)**/*.h" /> + <_XcbInputs Include="%(XcodeProjectReference.RootDir)%(XcodeProjectReference.Directory)**/*.pbxproj" /> + <_XcbInputs Include="%(XcodeProjectReference.RootDir)%(XcodeProjectReference.Directory)**/*.xcworkspace"/> + <_XcbInputs Remove="%(XcodeProjectReference.RootDir)%(XcodeProjectReference.Directory)build/**/*')" /> + <_XcbOutputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)build/%(Filename)/BuildXcodeFramework.stamp')" /> + + + + + + + + + + + + + + + + + + + + <_CreateXcFxArgs Include="-create-xcframework" /> + <_CreateXcFxArgs Condition=" '$(XcodeBuildiOS)' == 'true' " + Include="@(XcodeProjectReference->'-archive %(XCArchiveiOS) -framework %(SchemeName).framework')" /> + <_CreateXcFxArgs Condition=" '$(XcodeBuildiOSSimulator)' == 'true' " + Include="@(XcodeProjectReference->'-archive %(XCArchiveiOSSimulator) -framework %(SchemeName).framework')" /> + <_CreateXcFxArgs Condition=" '$(XcodeBuildMacCatalyst)' == 'true' " + Include="@(XcodeProjectReference->'-archive %(XCArchiveMacCatalyst) -framework %(SchemeName).framework')" /> + <_CreateXcFxArgs Include="@(XcodeProjectReference->'-output %(RootDir)%(Directory)build/%(Filename)/%(SchemeName).xcframework')" /> + + + + + + + + %(XcodeProjectReference.Kind) + %(XcodeProjectReference.SmartLink) + + + + + + + + + + + + <_SharpieInputs Condition=" '$(XcodeBuildiOS)' == 'true' " + Include="%(XcodeProjectReference.XCArchiveiOS)/**/*.*" /> + <_SharpieInputs Condition=" '$(XcodeBuildiOS)' != 'true' and '$(XcodeBuildMacCatalyst)' == 'true' " + Include="%(XcodeProjectReference.XCArchiveMacCatalyst)/**/*.*" /> + <_SharpieOutputs Include="@(XcodeProjectReference->'%(RootDir)%(Directory)build/sharpie/_SharpieBindXcodeProjects.stamp')" /> + + + + + + + + + + + <_SharpieBindXcodeSdkName Condition=" '$(_SharpieBindXcodeSdkName)' == '' ">$([System.Text.RegularExpressions.Regex]::Match($(_SharpieXcodeSdksOutput), `iphoneos[^; \n\r\t]+`)) + + + + <_ObjSharpieArgs Include="@(XcodeProjectReference->'--output="%(RootDir)%(Directory)build/sharpie" --namespace=%(SharpieNamespace) --sdk=$(_SharpieBindXcodeSdkName)')" /> + <_ObjSharpieArgs Condition=" '$(XcodeBuildiOS)' == 'true' " + Include="@(XcodeProjectReference->'--scope="%(XCArchiveiOS)/Products/Library/Frameworks/%(SchemeName).framework/Headers" "%(XCArchiveiOS)/Products/Library/Frameworks/%(SchemeName).framework/Headers/%(SchemeName)-Swift.h"')" /> + <_ObjSharpieArgs Condition=" '$(XcodeBuildiOS)' != 'true' and '$(XcodeBuildMacCatalyst)' == 'true' " + Include="@(XcodeProjectReference->'--scope="%(XCArchiveMacCatalyst)/Products/Library/Frameworks/%(SchemeName).framework/Headers" "%(XCArchiveMacCatalyst)/Products/Library/Frameworks/%(SchemeName).framework/Headers/%(SchemeName)-Swift.h"')" /> + + + + + + + + diff --git a/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.props b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.props new file mode 100644 index 0000000..ac1e36e --- /dev/null +++ b/src/CommunityToolkit.Maui.BindingExtensions/targets/Common.props @@ -0,0 +1,12 @@ + + + + + false + false + true + CommunityToolkit.Maui.BindingExtensions.dll + $(USERPROFILE) + + + diff --git a/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.multitargeting.props b/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.multitargeting.props new file mode 100644 index 0000000..d0dcc4b --- /dev/null +++ b/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.multitargeting.props @@ -0,0 +1,8 @@ + + + + + true + + + diff --git a/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.targets b/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.targets new file mode 100644 index 0000000..ebb1a02 --- /dev/null +++ b/src/CommunityToolkit.Maui.BindingExtensions/targets/CommunityToolkit.Maui.BindingExtensions.targets @@ -0,0 +1,9 @@ + + + + + + + + +