### Automate SDK Version Update with `update_version.sh` Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Use this script to automate bumping the SDK version. It handles updating `swift-tools-version` and deployment targets, downloading frameworks, computing checksums, and patching `Package.swift`. Ensure `~/.netrc` is configured before running. ```bash # Step 1: Ensure ~/.netrc is configured (see above) # Step 2: Edit the VERSION variable in update_version.sh # VERSION="25.11.6" → VERSION="26.1.0" (for example) # Step 3: Run the script from the repo root ./update_version.sh # The script performs per-framework downloads and checksum computation: # Downloading: https://rbsc.repositories.cloud.sap/.../SAPCommon/26.1.0/SAPCommon-26.1.0-Release.xcframework.zip # Downloading: https://rbsc.repositories.cloud.sap/.../SAPFiori/26.1.0/SAPFiori-26.1.0-Release.xcframework.zip # ... (repeats for all 7 frameworks) # Step 4: Verify all checksums are unique (identical checksums = failed download) grep "Checksum" Package.swift # let sapCommonChecksum = "abc123..." # let sapFioriChecksum = "def456..." ← all must differ # let sapFioriFlowsChecksum = "ghi789..." # Step 5: Commit and open a pull request git add Package.swift git commit -m "chore: bump SDK to 26.1.0" ``` -------------------------------- ### Set Up RBSC Authentication with .netrc Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Configure your S-User credentials in ~/.netrc for accessing the SAP RBSC binary repository. Ensure file permissions are restricted to 600. Use curl -n to verify connectivity. ```bash # Create or edit ~/.netrc cat >> ~/.netrc << 'EOF' machine rbsc.repositories.cloud.sap login sap-xxxxxx password xxxxxxxxxxxxxxxxxx EOF # Restrict file permissions (required by netrc spec) chmod 600 ~/.netrc # Verify connectivity to RBSC (expects HTTP 200 or 302, not 401/403) curl -n -I https://rbsc.repositories.cloud.sap/nexus3/repository/maven73555000100900007915/ios/SAPCommon/25.11.6/SAPCommon-25.11.6-Release.xcframework.zip # Expected: HTTP/1.1 200 OK (with valid credentials) # If HTTP 403: check your S-User license at https://help.sap.com/docs/RBSC/... ``` -------------------------------- ### CI: Verify Swift Package Binary Targets Source: https://context7.com/sap/cloud-sdk-ios/llms.txt This CI step ensures all XCFramework binaries can be downloaded from RBSC and verifies their checksums. It also confirms the presence of downloaded artifacts. ```yaml # .github/workflows/ci.yml jobs: verify-swift-package-binaryTargets: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Create .netrc for RBSC access uses: little-core-labs/netrc-creds@master with: machine: rbsc.repositories.cloud.sap login: 0000202418-iossdk password: ${{ secrets.RSBC_USER_BASICAUTH_PWD }} - run: swift package reset # clear stale cache - run: swift package resolve # downloads all 7 XCFramework zips + verifies checksums - run: ls .build/artifacts/cloud-sdk-ios # confirms artifacts present ``` -------------------------------- ### CI: Verify Swift Package Platform Constraints Source: https://context7.com/sap/cloud-sdk-ios/llms.txt This CI step validates that the declared minimum deployment target in Package.swift aligns with the SDK version family. It exits with an error if a mismatch is detected. ```yaml verify-swift-package-platform: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Verify version/platform alignment run: | VERSION=$(grep 'let version' Package.swift) PLATFORM=$(grep 'platforms' Package.swift) # SDK 25.11.x → must declare iOS 18 [[ "$VERSION" == *"\"25.11"* ]] && [[ "$PLATFORM" == *18* ]] && exit 0 # SDK 9.x → iOS 15; SDK 10.x/24.4/24.8 → iOS 16; SDK 24.12/25.4/25.8 → iOS 17 echo "Platform mismatch for version $VERSION" && exit 1 ``` -------------------------------- ### Package.swift Binary Target Structure for SAP SDK Frameworks Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Defines binary targets for each SAP SDK framework in Package.swift, pointing to versioned XCFramework zip files on RBSC with SHA-256 checksums for integrity. ```swift // Package.swift (current: v25.11.6, iOS 18+, swift-tools-version:6.0) // swift-tools-version:6.0 import PackageDescription let version = "25.11.6" let root = "https://rbsc.repositories.cloud.sap/nexus3/repository/maven73555000100900007915/ios" let sapCommonChecksum = "ae569a2a78035882a5746d762a3d57eb65f02e83033436864308db5c432c3b2e" let sapFioriChecksum = "f8ea85b35f4d9659308f2f8e8e87b90a7521d9eb3e839e2e2b0620fcbdcf4cd5" let sapFoundationChecksum = "68217ce28c9ce87513a714149f84b884a5cc84c29238e898c933d01333e34c93" // ... other checksums let package = Package( name: "cloud-sdk-ios", platforms: [.iOS(.v18)], products: [ .library(name: "SAPCommon", targets: ["SAPCommon"]), .library(name: "SAPFiori", targets: ["SAPFiori"]), .library(name: "SAPFioriFlows", targets: ["SAPFioriFlows"]), .library(name: "SAPFoundation", targets: ["SAPFoundation"]), .library(name: "SAPOData", targets: ["SAPOData"]), .library(name: "SAPOfflineOData",targets: ["SAPOfflineOData"]), .library(name: "SAPML", targets: ["SAPML"]), ], targets: [ .binaryTarget( name: "SAPCommon", url: "\(root)/SAPCommon/\(version)/SAPCommon-\(version)-Release.xcframework.zip", checksum: sapCommonChecksum ), .binaryTarget( name: "SAPFoundation", url: "\(root)/SAPFoundation/\(version)/SAPFoundation-\(version)-Release.xcframework.zip", checksum: sapFoundationChecksum ), // ... remaining binaryTargets follow same pattern ] ) ``` -------------------------------- ### Add SAP BTP SDK for iOS Package to Xcode Project Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Integrate the cloud-sdk-ios Swift Package into your Xcode project by adding its URL. Select the desired framework products for your app target. ```swift // In Xcode: File > Add Packages... > Search or Enter Package URL: // https://github.com/SAP/cloud-sdk-ios // Or declare in your own Package.swift dependency: // Package.swift let package = Package( name: "MyEnterpriseApp", platforms: [.iOS(.v18)], dependencies: [ .package( url: "https://github.com/SAP/cloud-sdk-ios.git", from: "25.11.6" ) ], targets: [ .target( name: "MyEnterpriseApp", dependencies: [ .product(name: "SAPCommon", package: "cloud-sdk-ios"), .product(name: "SAPFoundation", package: "cloud-sdk-ios"), .product(name: "SAPFiori", package: "cloud-sdk-ios"), .product(name: "SAPFioriFlows", package: "cloud-sdk-ios"), .product(name: "SAPOData", package: "cloud-sdk-ios"), .product(name: "SAPOfflineOData",package: "cloud-sdk-ios"), .product(name: "SAPML", package: "cloud-sdk-ios"), ] ) ] ) ``` -------------------------------- ### Add SAP Cloud SDK Package Collection to Xcode Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Load the signed `collection-signed.json` into Xcode's package browser to access all SDK-related binary and open-source packages. This provides a browsable collection of available SDK versions and components. ```text # In Xcode: File > Add Packages... > click "+" > Add Swift Package Collection # Paste the following URL and click Load: https://raw.githubusercontent.com/SAP/cloud-sdk-ios/main/collection-signed.json # The collection includes: # - cloud-sdk-ios (binary: SAPCommon, SAPFiori, SAPFioriFlows, SAPFoundation, # SAPOData, SAPOfflineOData, SAPML) → latest: 9.2.7 # - cloud-sdk-ios-fiori (open-source: FioriSwiftUI, FioriCharts, # FioriThemeManager) → latest: 3.3.0 # - cloud-sdk-ios-fiori-ar (open-source: FioriAR) → latest: 3.0.1 # - cloud-sdk-ios-cai (open-source: SAPCAI) → latest: 2.0.2 ``` -------------------------------- ### Generate and Sign Swift Package Collection Source: https://context7.com/sap/cloud-sdk-ios/llms.txt This workflow generates an unsigned package collection, signs it with a private certificate, and then commits the signed collection back to the repository. ```yaml steps: # 1. Build Apple's collection generator toolchain - run: | git clone https://github.com/apple/swift-package-collection-generator.git cd swift-package-collection-generator && git checkout 5.7 swift build -c release cp .build/release/package-collection-generate ../bin/ cp .build/release/package-collection-sign ../bin/ # 2. Generate unsigned collection (fetches metadata from GitHub via PAT) - run: bin/package-collection-generate packages.json collection.json -v \ --auth-token github:github.com:${{ secrets.PAT }} # 3. Sign with SAP's Apple Developer certificate - run: | echo "$CERTIFICATE_CONTENT_B64" | base64 --decode > spm_collection.cer echo "$PRIVATE_KEY_CONTENT" > spm_collection.pem bin/package-collection-sign collection.json collection-signed.json \ spm_collection.pem spm_collection.cer # 4. Auto-PR the updated collection-signed.json back to main - uses: peter-evans/create-pull-request@v5 with: add-paths: collection-signed.json commit-message: 'chore: auto create/update collection-signed.json' branch: updatePackageCollection ``` -------------------------------- ### RBSC Repository URL Mapping for SDK Versions Source: https://context7.com/sap/cloud-sdk-ios/llms.txt This mapping within `update_version.sh` determines the Nexus repository hosting XCFramework artifacts based on the SDK version family. It also indicates the minimum required iOS deployment target for each family. ```bash # Version family → RBSC repository mapping (from update_version.sh): # SDK 6.x → maven73554900100900005307 (iOS 13+) # SDK 7.x → maven73555000100900005862 (iOS 14+) # SDK 8.x → maven73554900100900006843 (iOS 14+) # SDK 9.x → maven73555000100900006345 (iOS 15+) # SDK 10.x → maven73554900100900008062 (iOS 16+) # SDK 24.4 → maven73554900100900008403 (iOS 16+) # SDK 24.8, 24.12, 25.4, 25.8, 25.11, 26.1 → maven73555000100900007915 (iOS 17/18+) # SDK 26.4, 26.8, 26.11 → maven735549001009000010451 # Direct download URL pattern (requires ~/.netrc): VERSION="25.11.6" ROOT="https://rbsc.repositories.cloud.sap/nexus3/repository/maven73555000100900007915/ios" FRAMEWORK="SAPFoundation" curl -n -L -f \ "$ROOT/$FRAMEWORK/$VERSION/$FRAMEWORK-$VERSION-Release.xcframework.zip" \ --output "$FRAMEWORK.zip" # Compute checksum for Package.swift: swift package compute-checksum "$FRAMEWORK.zip" # Output: 68217ce28c9ce87513a714149f84b884a5cc84c29238e898c933d01333e34c93 ``` -------------------------------- ### Add SAPCAI Package Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Use this code to add the SAPCAI package as a Swift Package Manager dependency. Requires iOS 14+. ```swift .package(url: "https://github.com/SAP/cloud-sdk-ios-cai.git", from: "2.0.2") ``` -------------------------------- ### Regenerate Signed Package Collection with GitHub Actions Source: https://context7.com/sap/cloud-sdk-ios/llms.txt The `spm-collection.yml` workflow automatically regenerates `collection-signed.json` when `packages.json` is updated. It utilizes Apple's `swift-package-collection-generator` and an SAP-issued Apple Developer certificate. ```yaml # .github/workflows/spm-collection.yml (key steps shown) # Trigger: push to packages.json, or manual dispatch on: push: paths: ["packages.json"] workflow_dispatch: inputs: commitChanges: { required: true, default: "true" } ``` -------------------------------- ### Add FioriSwiftUI Package Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Use this code to add the FioriSwiftUI package as a Swift Package Manager dependency. Requires iOS 15+. ```swift .package(url: "https://github.com/SAP/cloud-sdk-ios-fiori.git", from: "3.3.0") ``` -------------------------------- ### Clear SPM Cache and Re-resolve Packages Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Use these commands to clear the local Swift Package Manager cache and force a fresh resolution of packages, which can resolve 'invalid archive' errors. ```bash # Close Xcode first, then run: rm -rf "$HOME/Library/Caches/org.swift.swiftpm/" rm -rf "$HOME/Library/org.swift.swiftpm" # Re-resolve the package from scratch: swift package reset swift package resolve # Verify the downloaded artifacts: ls .build/artifacts/cloud-sdk-ios/ ``` -------------------------------- ### Add FioriAR Package Source: https://context7.com/sap/cloud-sdk-ios/llms.txt Use this code to add the FioriAR package as a Swift Package Manager dependency. Requires iOS 15+. ```swift .package(url: "https://github.com/SAP/cloud-sdk-ios-fiori-ar.git", from: "3.0.1") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.