diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67d00af..42a355b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: with: dotnet-version: "10.0.x" + - name: Validate feature selection + run: bash tests/validate-feature-selection.sh + - name: Install iOS workload run: | dotnet workload install ios diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 67c1c1b..fa519bb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -71,6 +71,9 @@ jobs: with: dotnet-version: "10.0.x" + - name: Validate feature selection + run: bash tests/validate-feature-selection.sh + - name: Install iOS workload run: | dotnet workload install ios diff --git a/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.props b/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.props index 2dd050c..27f7324 100644 --- a/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.props +++ b/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.props @@ -1,9 +1,6 @@ Login - <_KapuschFacebookFeaturesDelimited>;$([System.String]::Copy('$(KapuschFacebookFeatures)').Replace(' ', '')); - <_KapuschFacebookLoginEnabled>$([System.String]::Copy('$(_KapuschFacebookFeaturesDelimited)').Contains(';Login;')) - <_KapuschFacebookShareEnabled>$([System.String]::Copy('$(_KapuschFacebookFeaturesDelimited)').Contains(';Share;')) false diff --git a/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.targets b/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.targets index 3b64a5e..d76447a 100644 --- a/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.targets +++ b/src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.targets @@ -1,5 +1,10 @@ + + <_KapuschFacebookFeaturesDelimited>;$([System.String]::Copy('$(KapuschFacebookFeatures)').Replace(' ', '')); + <_KapuschFacebookLoginEnabled>$([System.String]::Copy('$(_KapuschFacebookFeaturesDelimited)').Contains(';Login;')) + <_KapuschFacebookShareEnabled>$([System.String]::Copy('$(_KapuschFacebookFeaturesDelimited)').Contains(';Share;')) <_KapuschFacebookInteropPackageRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..')) diff --git a/tests/FeatureSelection.proj b/tests/FeatureSelection.proj new file mode 100644 index 0000000..ca4e472 --- /dev/null +++ b/tests/FeatureSelection.proj @@ -0,0 +1,21 @@ + + + + + + $(RequestedFacebookFeatures) + + + + + + + + + diff --git a/tests/validate-feature-selection.sh b/tests/validate-feature-selection.sh new file mode 100644 index 0000000..6f3bc49 --- /dev/null +++ b/tests/validate-feature-selection.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -euo pipefail + +project="tests/FeatureSelection.proj" + +dotnet msbuild "$project" -t:ValidateFeatureSelection -p:ExpectedLoginEnabled=True -p:ExpectedShareEnabled=False + +dotnet msbuild "$project" -t:ValidateFeatureSelection -p:RequestedFacebookFeatures=Share -p:ExpectedLoginEnabled=False -p:ExpectedShareEnabled=True + +dotnet msbuild "$project" -t:ValidateFeatureSelection -p:RequestedFacebookFeatures=Login%3BShare -p:ExpectedLoginEnabled=True -p:ExpectedShareEnabled=True