-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from macblazer/78-sbom-generation-is-taking-ex…
…tremely-long Improve performance of analysis with large number of pods
- Loading branch information
Showing
10 changed files
with
2,383 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,6 @@ | |
|
||
module CycloneDX | ||
module CocoaPods | ||
VERSION = '1.4.0' | ||
VERSION = '1.4.1' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
RSpec.describe CycloneDX::CocoaPods::PodfileAnalyzer do | ||
let(:fixtures) { Pathname.new(File.expand_path('../../fixtures', __dir__)) } | ||
let(:empty_podfile) { 'EmptyPodfile/Podfile' } | ||
let(:large_podfile) { 'LargePodfile/Podfile' } | ||
let(:simple_pod) { 'SimplePod/Podfile' } | ||
let(:restricted_pod) { 'RestrictedPod/Podfile' } | ||
let(:tests_pod) { 'TestingPod/Podfile' } | ||
|
@@ -103,6 +104,35 @@ | |
expect(pod_names.length).to eq(dependencies.length) | ||
end | ||
|
||
it 'should load large podfiles quickly' do | ||
analyzer = CycloneDX::CocoaPods::PodfileAnalyzer.new(logger: @logger) | ||
|
||
pod_file = Pod::Podfile.from_file(fixtures + large_podfile) | ||
expect(pod_file).not_to be_nil | ||
lock_file = Pod::Lockfile.from_file(fixtures + "#{large_podfile}.lock") | ||
expect(lock_file).not_to be_nil | ||
|
||
included_pods, dependencies = analyzer.parse_pods(pod_file, lock_file) | ||
|
||
# Only 104 pods listed in the Podfile, but there are 187 pods counting all 104 plus dependencies. | ||
expect(included_pods.count).to eq(187) | ||
# There are 187 pods here! We only verify some of them. | ||
pod_names = included_pods.map(&:name) | ||
expect(pod_names.first(6)).to eq(['boost', 'DoubleConversion', 'Dynatrace', | ||
'Dynatrace/xcframework', 'EXApplication', 'EXConstants']) | ||
expect(pod_names.last(5)).to eq(['VisionCameraOcr', 'Yoga', 'ZXingObjC/Core', | ||
'ZXingObjC/OneD', 'ZXingObjC/PDF417']) | ||
# rubocop:disable Layout/LineLength | ||
expect(dependencies.first).to eq([ | ||
'pkg:cocoapods/[email protected]?download_url=..%2Fnode_modules%2Freact-native%2Fthird-party-podspecs%2Fboost.podspec', | ||
[] | ||
]) | ||
# rubocop:enable Layout/LineLength | ||
|
||
# Each of the pods should have an entry in the dependencies hash | ||
expect(pod_names.length).to eq(dependencies.length) | ||
end | ||
|
||
it 'should find all simple pods' do | ||
analyzer = CycloneDX::CocoaPods::PodfileAnalyzer.new(logger: @logger) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
project 'SampleProject.xcodeproj' | ||
platform :osx, '11.0' | ||
|
||
target 'SampleProject' do | ||
pod 'Alamofire' | ||
pod 'boost' | ||
pod 'DoubleConversion' | ||
pod 'EXApplication' | ||
pod 'EXConstants' | ||
pod 'EXJSONUtils' | ||
pod 'EXManifests' | ||
pod 'Expo' | ||
pod 'expo-dev-client' | ||
pod 'expo-dev-launcher' | ||
pod 'expo-dev-menu' | ||
pod 'expo-dev-menu-interface' | ||
pod 'ExpoAsset' | ||
pod 'ExpoCamera' | ||
pod 'ExpoCellular' | ||
pod 'ExpoClipboard' | ||
pod 'ExpoCrypto' | ||
pod 'ExpoDevice' | ||
pod 'ExpoFileSystem' | ||
pod 'ExpoFont' | ||
pod 'ExpoHead' | ||
pod 'ExpoKeepAwake' | ||
pod 'ExpoLocalAuthentication' | ||
pod 'ExpoModulesCore' | ||
pod 'ExpoNetwork' | ||
pod 'ExpoScreenOrientation' | ||
pod 'ExpoSecureStore' | ||
pod 'ExpoWebBrowser' | ||
pod 'EXSplashScreen' | ||
pod 'EXUpdatesInterface' | ||
pod 'FBLazyVector' | ||
pod 'fmt' | ||
pod 'glog' | ||
pod 'hermes-engine' | ||
pod 'jail-monkey' | ||
pod 'RCT-Folly' | ||
pod 'RCT-Folly/Fabric' | ||
pod 'RCTDeprecation' | ||
pod 'RCTRequired' | ||
pod 'RCTTypeSafety' | ||
pod 'React' | ||
pod 'React-callinvoker' | ||
pod 'React-Codegen' | ||
pod 'React-Core' | ||
pod 'React-Core/RCTWebSocket' | ||
pod 'React-CoreModules' | ||
pod 'React-cxxreact' | ||
pod 'React-debug' | ||
pod 'React-Fabric' | ||
pod 'React-FabricImage' | ||
pod 'React-featureflags' | ||
pod 'React-graphics' | ||
pod 'React-hermes' | ||
pod 'React-ImageManager' | ||
pod 'React-jserrorhandler' | ||
pod 'React-jsi' | ||
pod 'React-jsiexecutor' | ||
pod 'React-jsinspector' | ||
pod 'React-jsitracing' | ||
pod 'React-logger' | ||
pod 'React-Mapbuffer' | ||
pod 'react-native-dynatrace' | ||
pod 'react-native-keyboard-controller' | ||
pod 'react-native-netinfo' | ||
pod 'react-native-piwik-pro-sdk' | ||
pod 'react-native-safe-area-context' | ||
pod 'react-native-simple-crypto' | ||
pod 'react-native-webview' | ||
pod 'react-native-worklets-core' | ||
pod 'React-nativeconfig' | ||
pod 'React-NativeModulesApple' | ||
pod 'React-perflogger' | ||
pod 'React-RCTActionSheet' | ||
pod 'React-RCTAnimation' | ||
pod 'React-RCTAppDelegate' | ||
pod 'React-RCTBlob' | ||
pod 'React-RCTFabric' | ||
pod 'React-RCTImage' | ||
pod 'React-RCTLinking' | ||
pod 'React-RCTNetwork' | ||
pod 'React-RCTSettings' | ||
pod 'React-RCTText' | ||
pod 'React-RCTVibration' | ||
pod 'React-rendererdebug' | ||
pod 'React-rncore' | ||
pod 'React-RuntimeApple' | ||
pod 'React-RuntimeCore' | ||
pod 'React-runtimeexecutor' | ||
pod 'React-RuntimeHermes' | ||
pod 'React-runtimescheduler' | ||
pod 'React-utils' | ||
pod 'ReactCommon/turbomodule/core' | ||
pod 'RNCAsyncStorage' | ||
pod 'RNCMaskedView' | ||
pod 'RNCPicker' | ||
pod 'RNDateTimePicker' | ||
pod 'RNGestureHandler' | ||
pod 'RNReanimated' | ||
pod 'RNScreens' | ||
pod 'RNSVG' | ||
pod 'ssl-pinning' | ||
pod 'VisionCamera' | ||
pod 'VisionCameraOcr' | ||
pod 'Yoga' | ||
end |
Oops, something went wrong.