6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 10f4fd2b
Changed files
azure/templates/build-ios.yml | 119 +++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 49 deletions(-)
Diff
diff --git a/azure/templates/build-ios.yml b/azure/templates/build-ios.yml
index e66bfd8e..7a0e1f7d 100644
--- a/azure/templates/build-ios.yml
+++ b/azure/templates/build-ios.yml
@@ -4,26 +4,16 @@ variables:
value: releasetest
pool:
- vmImage: 'macOS-latest'
+ vmImage: 'macOS-14'
steps:
-
- # Install Flutter SDK
- - script: |
- git clone https://github.com/flutter/flutter.git -b stable --depth 1 $(Pipeline.Workspace)/flutter
- displayName: "Install Flutter SDK"
-
- - script: |
- echo "$(Pipeline.Workspace)/flutter/bin" >> $GITHUB_PATH
- displayName: "Add Flutter to PATH"
-
- # Download and copy the .env file
+ # Download secure file from Azure library
- task: DownloadSecureFile@1
inputs:
secureFile: '.env'
-
+
+ # Copy the .env file to the project directory
- task: CopyFiles@2
- displayName: "Copy .env file"
inputs:
sourceFolder: '$(Agent.TempDirectory)'
contents: '**/*.env'
@@ -32,22 +22,50 @@ steps:
# Install Apple certificate for code signing
- task: InstallAppleCertificate@2
- displayName: "Install Apple Certificate"
+ displayName: Install certificate
inputs:
certSecureFile: 'cpcert.p12'
- certPwd: '$(cppwd)'
+ certPwd: '$(cppwd)' # Assuming cppwd is a parameter or pipeline variable
keychain: 'temp'
- # Install provisioning profile
+ # Install Apple provisioning profile
- task: InstallAppleProvisioningProfile@1
- displayName: "Install Provisioning Profile"
+ displayName: Install provisioning file
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'CP_Test.mobileprovision'
+ # Install Flutter SDK
+ - task: FlutterInstall@0
+ displayName: "Install Flutter SDK"
+ inputs:
+ mode: 'auto'
+ channel: 'stable'
+ version: 'latest'
+
+ # Run Flutter diagnostics
+ - task: FlutterCommand@0
+ displayName: "Run Flutter diagnostics"
+ inputs:
+ projectDirectory: '.'
+ arguments: 'doctor -v'
+
+ # Run custom Pigeon script
+ - task: ShellScript@2
+ displayName: "Run Pigeon script"
+ inputs:
+ scriptPath: "$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/pigeon.sh"
+
+ # Analyze Flutter code
+ - task: FlutterAnalyzeTask@0
+ inputs:
+ projectDirectory: '$(Build.SourcesDirectory)/comwell_key_app'
+ pubGet: true
+ extraArgs: --no-fatal-infos --no-fatal-warnings
+
# Install CocoaPods dependencies
- task: Bash@3
- displayName: "Install CocoaPods Dependencies"
+ displayName: "Install CocoaPods dependencies"
inputs:
targetType: 'inline'
script: |
@@ -57,28 +75,39 @@ steps:
# Copy SeosMobileKeysSDK to the Xcode project directory
- task: CopyFiles@2
- displayName: "Copy SeosMobileKeysSDK to Xcode Project"
+ displayName: "Copy SeosMobileKeysSDK framework to Xcode project"
inputs:
sourceFolder: '$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/XCFrameworks/'
contents: 'SeosMobileKeysSDK.xcframework/**'
targetFolder: '$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks/'
flattenFolders: false
- # Ensure SeosMobileKeysSDK is linked properly
- - task: Bash@3
- displayName: "Ensure SeosMobileKeysSDK is Linked"
+ # Ensure the custom XCFramework is added to the Xcode project
+ - task: Xcode@5
+ displayName: "Integrate XCFramework into Xcode project"
inputs:
- targetType: 'inline'
- script: |
- cd $(Build.SourcesDirectory)/comwell_key_app/ios
- if [ ! -d "Frameworks/SeosMobileKeysSDK.xcframework" ]; then
- echo "Error: SeosMobileKeysSDK.xcframework not found!"
- exit 1
- fi
+ actions: "build"
+ scheme: "$(flavor)" # Make sure to use the correct scheme that includes the custom XCFramework
+ sdk: "iphoneos"
+ configuration: "Release"
+ xcWorkspacePath: "$(Build.SourcesDirectory)/comwell_key_app/ios/Runner.xcworkspace"
+ xcodeVersion: "default"
+ packageApp: false
+ args: |
+ -target Runner
+ -project $(Build.SourcesDirectory)/comwell_key_app/ios/Runner.xcodeproj
+ -destination generic/platform=iOS
# Build the iOS application
+ - task: FlutterCommand@0
+ displayName: "Build Flutter iOS project"
+ inputs:
+ projectDirectory: '$(Build.SourcesDirectory)/comwell_key_app'
+ arguments: 'build ios --no-codesign --flavor=$(flavor) --build-name=1.0.0 --build-number=1'
+
+ # Code Sign ipa for Distribution
- task: Xcode@5
- displayName: "Build and Sign iOS App"
+ displayName: "Code Sign ipa for Distribution"
inputs:
actions: "build"
scheme: "$(flavor)" # Ensure this uses the correct scheme
@@ -90,34 +119,26 @@ steps:
signingOption: "manual"
signingIdentity: "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
provisioningProfileUuid: "$(APPLE_PROV_PROFILE_UUID)"
- args: |
- OTHER_LDFLAGS="$(inherited) -framework SeosMobileKeysSDK"
- FRAMEWORK_SEARCH_PATHS="$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks"
- SWIFT_INCLUDE_PATHS="$(Build.SourcesDirectory)/comwell_key_app/ios/Frameworks/SeosMobileKeysSDK.xcframework"
- # Verify that the framework is included in the build
- - task: Bash@3
- displayName: "Verify Framework Inclusion"
- inputs:
- targetType: 'inline'
- script: |
- if ! nm $(Build.SourcesDirectory)/comwell_key_app/build/ios/Release-iphoneos/Runner.app/Runner | grep -q SeosMobileKeysSDK; then
- echo "Error: SeosMobileKeysSDK framework not included in the build!"
- exit 1
- fi
+ # Uncomment to run unit tests
+ # - task: FlutterTest@0
+ # displayName: "Run unit tests"
+ # inputs:
+ # generateCodeCoverageReport: true
+ # projectDirectory: '$(Build.SourcesDirectory)'
- # Copy the IPA to staging directory
+ # Copy app to staging directory
- task: CopyFiles@2
- displayName: "Copy IPA to Staging Directory"
+ displayName: "Copy app to staging directory"
inputs:
sourceFolder: '$(Agent.BuildDirectory)'
contents: '**/ipa/*.ipa'
targetFolder: '$(Build.StagingDirectory)'
flattenFolders: true
- # Publish the IPA file
+ # Publish IPA file
- task: PublishBuildArtifacts@1
- displayName: "Publish IPA File"
+ displayName: "Publish IPA file"
inputs:
PathtoPublish: '$(Build.StagingDirectory)'
ArtifactName: 'IPA'