Skip to content

Commit

Permalink
Apple multiplatform app detection (#262)
Browse files Browse the repository at this point in the history
* Pull go-xcode@supported-platforms

* Update go-xcode

* Add test for apple multiplatform project

* Update go-xcode

* Update ios_test.go
  • Loading branch information
godrei authored Jul 7, 2023
1 parent d68c1db commit 7c671dd
Show file tree
Hide file tree
Showing 15 changed files with 1,053 additions and 82 deletions.
240 changes: 240 additions & 0 deletions _tests/integration/ios_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func TestIOS(t *testing.T) {
sampleSPMResultYML,
sampleSPMVersions,
},
{
"samples-ios-swiftui-bitrise-todos",
"https://github.com/bitrise-io/samples-ios-swiftui-bitrise-todos",
"",
appleMultiplatformAppResultYAML,
appleMultiplatformAppVersions,
},
}

helper.Execute(t, testCases)
Expand Down Expand Up @@ -917,6 +924,7 @@ warnings_with_recommendations:
`, sampleAppClipVersions...)

var sampleSPMVersions = []interface{}{
// iOS
models.FormatVersion,

// ios-spm-test-config/deploy
Expand Down Expand Up @@ -1025,3 +1033,235 @@ warnings:
warnings_with_recommendations:
ios: []
`, sampleSPMVersions...)

var appleMultiplatformAppVersions = []interface{}{
// iOS
models.FormatVersion,

// ios-test-missing-shared-schemes-config/deploy
steps.ActivateSSHKeyVersion,
steps.GitCloneVersion,
steps.RecreateUserSchemesVersion,
steps.XcodeTestVersion,
steps.XcodeArchiveVersion,
steps.DeployToBitriseIoVersion,

// ios-test-missing-shared-schemes-config/primary
steps.ActivateSSHKeyVersion,
steps.GitCloneVersion,
steps.RecreateUserSchemesVersion,
steps.XcodeTestVersion,
steps.DeployToBitriseIoVersion,

// macOS
models.FormatVersion,

// ios-test-missing-shared-schemes-config/deploy
steps.ActivateSSHKeyVersion,
steps.GitCloneVersion,
steps.CertificateAndProfileInstallerVersion,
steps.RecreateUserSchemesVersion,
steps.XcodeTestMacVersion,
steps.XcodeArchiveMacVersion,
steps.DeployToBitriseIoVersion,

// ios-test-missing-shared-schemes-config/primary
steps.ActivateSSHKeyVersion,
steps.GitCloneVersion,
steps.RecreateUserSchemesVersion,
steps.XcodeTestMacVersion,
steps.DeployToBitriseIoVersion,
}

var appleMultiplatformAppResultYAML = fmt.Sprintf(`options:
ios:
title: Project or Workspace path
summary: The location of your Xcode project or Xcode workspace files, stored as
an Environment Variable. In your Workflows, you can specify paths relative to
this path.
env_key: BITRISE_PROJECT_PATH
type: selector
value_map:
Bitrise TODOs Sample.xcodeproj:
title: Scheme name
summary: An Xcode scheme defines a collection of targets to build, a configuration
to use when building, and a collection of tests to execute. Only shared
schemes are detected automatically but you can use any scheme as a target
on Bitrise. You can change the scheme at any time in your Env Vars.
env_key: BITRISE_SCHEME
type: selector
value_map:
Bitrise TODOs Sample:
title: Distribution method
summary: The export method used to create an .ipa file in your builds,
stored as an Environment Variable. You can change this at any time,
or even create several .ipa files with different export methods in the
same build.
env_key: BITRISE_DISTRIBUTION_METHOD
type: selector
value_map:
ad-hoc:
config: ios-test-missing-shared-schemes-config
app-store:
config: ios-test-missing-shared-schemes-config
development:
config: ios-test-missing-shared-schemes-config
enterprise:
config: ios-test-missing-shared-schemes-config
macos:
title: Project or Workspace path
summary: The location of your Xcode project or Xcode workspace files, stored as
an Environment Variable. In your Workflows, you can specify paths relative to
this path.
env_key: BITRISE_PROJECT_PATH
type: selector
value_map:
Bitrise TODOs Sample.xcodeproj:
title: Scheme name
summary: An Xcode scheme defines a collection of targets to build, a configuration
to use when building, and a collection of tests to execute. Only shared
schemes are detected automatically but you can use any scheme as a target
on Bitrise. You can change the scheme at any time in your Env Vars.
env_key: BITRISE_SCHEME
type: selector
value_map:
Bitrise TODOs Sample:
title: |-
Application export method
NOTE: `+"`none`"+` means: Export a copy of the application without re-signing.
summary: The export method used to create an .app file in your builds,
stored as an Environment Variable. You can change this at any time,
or even create several .app files with different export methods in the
same build.
env_key: BITRISE_EXPORT_METHOD
type: selector
value_map:
app-store:
config: macos-test-missing-shared-schemes-config
developer-id:
config: macos-test-missing-shared-schemes-config
development:
config: macos-test-missing-shared-schemes-config
none:
config: macos-test-missing-shared-schemes-config
configs:
ios:
ios-test-missing-shared-schemes-config: |
format_version: "%s"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ios
workflows:
deploy:
description: |
The workflow tests, builds and deploys the app using *Deploy to bitrise.io* step.
For testing the *retry_on_failure* test repetition mode is enabled.
Next steps:
- Set up [Connecting to an Apple service with API key](https://devcenter.bitrise.io/en/accounts/connecting-to-services/connecting-to-an-apple-service-with-api-key.html##).
- Or further customise code signing following our [iOS code signing](https://devcenter.bitrise.io/en/code-signing/ios-code-signing.html) guide.
steps:
- activate-ssh-key@%s: {}
- git-clone@%s: {}
- recreate-user-schemes@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- xcode-test@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- test_repetition_mode: retry_on_failure
- cache_level: none
- xcode-archive@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- distribution_method: $BITRISE_DISTRIBUTION_METHOD
- automatic_code_signing: api-key
- cache_level: none
- deploy-to-bitrise-io@%s: {}
primary:
description: |
The workflow executes the tests. The *retry_on_failure* test repetition mode is enabled.
Next steps:
- Check out [Getting started with iOS apps](https://devcenter.bitrise.io/en/getting-started/getting-started-with-ios-apps.html).
steps:
- activate-ssh-key@%s: {}
- git-clone@%s: {}
- recreate-user-schemes@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- xcode-test@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- test_repetition_mode: retry_on_failure
- cache_level: none
- deploy-to-bitrise-io@%s: {}
macos:
macos-test-missing-shared-schemes-config: |
format_version: "%s"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: macos
workflows:
deploy:
steps:
- activate-ssh-key@%s: {}
- git-clone@%s: {}
- certificate-and-profile-installer@%s: {}
- recreate-user-schemes@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- xcode-test-mac@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- xcode-archive-mac@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- export_method: $BITRISE_EXPORT_METHOD
- deploy-to-bitrise-io@%s: {}
primary:
steps:
- activate-ssh-key@%s: {}
- git-clone@%s: {}
- recreate-user-schemes@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- xcode-test-mac@%s:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- deploy-to-bitrise-io@%s: {}
warnings:
ios: []
macos: []
warnings_with_recommendations:
ios:
- error: |-
No shared schemes found for project: Bitrise TODOs Sample.xcodeproj.
Automatically generated schemes may differ from the ones in your project.
Make sure to <a href="https://support.bitrise.io/hc/en-us/articles/4405779956625">share your schemes</a> for the expected behaviour.
recommendations:
DetailedError:
title: We couldn’t parse your project files.
description: |-
You can fix the problem and try again, or skip auto-configuration and set up your project manually. Our auto-configurator returned the following error:
No shared schemes found for project: Bitrise TODOs Sample.xcodeproj.
Automatically generated schemes may differ from the ones in your project.
Make sure to <a href="https://support.bitrise.io/hc/en-us/articles/4405779956625">share your schemes</a> for the expected behaviour.
macos:
- error: |-
No shared schemes found for project: Bitrise TODOs Sample.xcodeproj.
Automatically generated schemes may differ from the ones in your project.
Make sure to <a href="https://support.bitrise.io/hc/en-us/articles/4405779956625">share your schemes</a> for the expected behaviour.
recommendations:
DetailedError:
title: We couldn’t parse your project files.
description: |-
You can fix the problem and try again, or skip auto-configuration and set up your project manually. Our auto-configurator returned the following error:
No shared schemes found for project: Bitrise TODOs Sample.xcodeproj.
Automatically generated schemes may differ from the ones in your project.
Make sure to <a href="https://support.bitrise.io/hc/en-us/articles/4405779956625">share your schemes</a> for the expected behaviour.`, appleMultiplatformAppVersions...)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/bitrise-io/go-steputils v1.0.1
github.com/bitrise-io/go-utils v1.0.1
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.18
github.com/bitrise-io/go-xcode v1.0.6
github.com/bitrise-io/go-xcode v1.0.12
github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1
github.com/bitrise-io/stepman v0.0.0-20210517135458-203f7a48d37a
github.com/google/go-cmp v0.5.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ github.com/bitrise-io/go-utils v1.0.1 h1:e7mepVBkVN1DXRPESNXb0djEw6bxB6B93p/Q74z
github.com/bitrise-io/go-utils v1.0.1/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.18 h1:+JEzJ3N4FWxnMS9n6RiBEc9s5w4ZR8NW1Tz061mhn3g=
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.18/go.mod h1:Laih4ji980SQkRgdnMCH0g4u2GZI/5nnbqmYT9UfKFQ=
github.com/bitrise-io/go-xcode v1.0.6 h1:hSKwkDXUn9/gMk6HiJRUvurGWelfQEBWcO7JAvXi+y8=
github.com/bitrise-io/go-xcode v1.0.6/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
github.com/bitrise-io/go-xcode v1.0.12 h1:r8hziEOr6mV6XLWv8ZXZ4hgGyNEG+JzdU/68A+Ws42g=
github.com/bitrise-io/go-xcode v1.0.12/go.mod h1:Y0Wu2dXm0MilJ/4D3+gPHaNMlUcP+1DjIPoLPykq7wY=
github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1 h1:iQZl/dKHp14xol7ye4e9FaSrw8o27TF5/nv3aUDfdD0=
github.com/bitrise-io/goinp v0.0.0-20210504152833-8559b0680ab1/go.mod h1:iRbd8zAXLeNy+0gic0eqNCxXvDGe8ZEY/uYX2CCeAoo=
github.com/bitrise-io/gows v0.0.0-20210505125306-dd92ff463938/go.mod h1:3Cp9ceJ8wHl1Av6oEE2ff1iWaYLliQuD+oaNdyM0NWQ=
Expand Down
29 changes: 25 additions & 4 deletions vendor/github.com/bitrise-io/go-xcode/pathfilters/pathfilters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c671dd

Please sign in to comment.