Skip to content

Commit

Permalink
RUMM-2054 Build xcframework with tvos slices
Browse files Browse the repository at this point in the history
  • Loading branch information
maxep committed Mar 18, 2022
1 parent f4365b9 commit bc37c48
Showing 1 changed file with 39 additions and 30 deletions.
69 changes: 39 additions & 30 deletions tools/distribution/src/release/assets/gh_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ def validate(self, zip_directory: DirectoryMatcher):
'ios-arm64_x86_64-simulator/**/arm64-apple-ios-simulator.swiftinterface',
'ios-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'ios-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',

'tvos-arm64',
'tvos-arm64/BCSymbolMaps/*.bcsymbolmap',
'tvos-arm64/dSYMs/*.dSYM',
'tvos-arm64/**/arm64.swiftinterface',
'tvos-arm64/**/arm64-apple-ios.swiftinterface',

'tvos-arm64_x86_64-simulator',
'tvos-arm64_x86_64-simulator/dSYMs/*.dSYM',
'tvos-arm64_x86_64-simulator/**/arm64.swiftinterface',
'tvos-arm64_x86_64-simulator/**/arm64-apple-ios-simulator.swiftinterface',
'tvos-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'tvos-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',
])


Expand All @@ -67,6 +80,18 @@ def validate(self, zip_directory: DirectoryMatcher):
'ios-arm64_x86_64-simulator/**/arm64-apple-ios-simulator.swiftinterface',
'ios-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'ios-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',

'tvos-arm64',
'tvos-arm64/BCSymbolMaps/*.bcsymbolmap',
'tvos-arm64/dSYMs/*.dSYM',
'tvos-arm64/**/arm64.swiftinterface',
'tvos-arm64/**/arm64-apple-ios.swiftinterface',

'tvos-arm64_x86_64-simulator',
'tvos-arm64_x86_64-simulator/**/arm64.swiftinterface',
'tvos-arm64_x86_64-simulator/**/arm64-apple-ios-simulator.swiftinterface',
'tvos-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'tvos-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',
])


Expand All @@ -88,6 +113,16 @@ def validate(self, zip_directory: DirectoryMatcher):
'ios-arm64_x86_64-simulator/dSYMs/*.dSYM',
'ios-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'ios-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',

'tvos-arm64',
'tvos-arm64/BCSymbolMaps/*.bcsymbolmap',
'tvos-arm64/**/arm64.swiftinterface',
'tvos-arm64/**/arm64-apple-ios.swiftinterface',

'tvos-arm64_x86_64-simulator',
'tvos-arm64_x86_64-simulator/dSYMs/*.dSYM',
'tvos-arm64_x86_64-simulator/**/x86_64.swiftinterface',
'tvos-arm64_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',
])


Expand All @@ -102,34 +137,9 @@ def validate(self, zip_directory: DirectoryMatcher):
zip_directory.get('CrashReporter.xcframework').assert_it_has_files([
'ios-arm64_arm64e_armv7_armv7s',
'ios-arm64_i386_x86_64-simulator',
])


class KronosXCFrameworkValidator(XCFrameworkValidator):
name = 'Kronos.xcframework'

def should_be_included(self, in_version: Version):
min_version = Version.parse('1.5.0') # First version that depends on Kronos
max_version = Version.parse('1.8.99') # Last version that depends on Kronos
return in_version.is_newer_than_or_equal(min_version) and max_version.is_newer_than_or_equal(in_version)

def validate(self, zip_directory: DirectoryMatcher):
zip_directory.get('Kronos.xcframework').assert_it_has_files([
'ios-arm64_armv7',
'ios-arm64_armv7/BCSymbolMaps/*.bcsymbolmap',
'ios-arm64_armv7/dSYMs/*.dSYM',
'ios-arm64_armv7/**/arm.swiftinterface',
'ios-arm64_armv7/**/arm64-apple-ios.swiftinterface',
'ios-arm64_armv7/**/arm64.swiftinterface',
'ios-arm64_armv7/**/armv7-apple-ios.swiftinterface',
'ios-arm64_armv7/**/armv7.swiftinterface',

'ios-arm64_i386_x86_64-simulator',
'ios-arm64_i386_x86_64-simulator/dSYMs/*.dSYM',
'ios-arm64_i386_x86_64-simulator/**/arm64-apple-ios-simulator.swiftinterface',
'ios-arm64_i386_x86_64-simulator/**/i386-apple-ios-simulator.swiftinterface',
'ios-arm64_i386_x86_64-simulator/**/x86_64-apple-ios-simulator.swiftinterface',
'ios-arm64_i386_x86_64-simulator/**/x86_64.swiftinterface',
'tvos-arm64',
'tvos-arm64_x86_64-simulator',
])


Expand All @@ -138,7 +148,6 @@ def validate(self, zip_directory: DirectoryMatcher):
DatadogObjcXCFrameworkValidator(),
DatadogCrashReportingXCFrameworkValidator(),
CrashReporterXCFrameworkValidator(),
KronosXCFrameworkValidator(),
]


Expand All @@ -160,9 +169,9 @@ def __init__(self, add_xcode_version: bool):

# Produce XCFrameworks with carthage:
# - only checkout and `--no-build` as it will build in the next command:
shell('carthage bootstrap --platform iOS --no-build')
shell('carthage bootstrap --platform iOS,tvOS --no-build')
# - `--no-build` as it will build in the next command:
shell('carthage build --platform iOS --use-xcframeworks --no-use-binaries --no-skip-current')
shell('carthage build --platform iOS,tvOS --use-xcframeworks --no-use-binaries --no-skip-current')

# Create `.zip` archive:
zip_archive_name = f'Datadog-{read_sdk_version()}.zip'
Expand Down

0 comments on commit bc37c48

Please sign in to comment.