Skip to content

Commit

Permalink
test: Demo 升级至 iOS 12.0,避免使用 Xcode 15 + SPM 报错
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Sep 20, 2023
1 parent e447199 commit 7d5de7f
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 63 deletions.
50 changes: 30 additions & 20 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
04F675662628293800077374 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04F675652628293800077374 /* AdSupport.framework */; };
33A0F692F1D1738D6854E19A /* Pods_HostApplicationTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42F5EA0EFE2552358C35A0F5 /* Pods_HostApplicationTests.framework */; };
3406842B2A668EB700E25216 /* A3PageEventsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 3406842A2A668EB700E25216 /* A3PageEventsTest.m */; };
341A579A2ABAA23E0052840A /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 341A57992ABAA2380052840A /* libc++.tbd */; };
34486D3D27B1049000FA8223 /* UITapGestureRecognizerAutotrackTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 34486D3B27B102B000FA8223 /* UITapGestureRecognizerAutotrackTest.m */; };
34664587278EEEA6009C351C /* A0GrowingAnalyticsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 047BF3A224F638BB0028FE94 /* A0GrowingAnalyticsTest.m */; };
346E0B3B29F2724400A12E4E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 346E0B3A29F2724400A12E4E /* AppDelegate.swift */; };
Expand Down Expand Up @@ -304,6 +305,7 @@
3406842A2A668EB700E25216 /* A3PageEventsTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = A3PageEventsTest.m; sourceTree = "<group>"; };
34106BB228FECB0D00E7DB01 /* Crasher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Crasher.h; sourceTree = "<group>"; };
34106BB328FECB0E00E7DB01 /* Crasher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Crasher.mm; sourceTree = "<group>"; };
341A57992ABAA2380052840A /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; };
34486D3B27B102B000FA8223 /* UITapGestureRecognizerAutotrackTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UITapGestureRecognizerAutotrackTest.m; sourceTree = "<group>"; };
346E0B3829F2724300A12E4E /* Example-macOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-macOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
346E0B3A29F2724400A12E4E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -529,6 +531,7 @@
349975FA28BF301500466640 /* iAd.framework in Frameworks */,
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
04F675662628293800077374 /* AdSupport.framework in Frameworks */,
341A579A2ABAA23E0052840A /* libc++.tbd in Frameworks */,
349975F828BF301000466640 /* AdServices.framework in Frameworks */,
A9D21D06460258FAC4736A26 /* Pods_Example.framework in Frameworks */,
);
Expand Down Expand Up @@ -1350,6 +1353,7 @@
6003F58C195388D20070C39A /* Frameworks */ = {
isa = PBXGroup;
children = (
341A57992ABAA2380052840A /* libc++.tbd */,
349975F928BF301500466640 /* iAd.framework */,
349975F728BF300F00466640 /* AdServices.framework */,
04F675652628293800077374 /* AdSupport.framework */,
Expand Down Expand Up @@ -2488,7 +2492,6 @@
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "-Xcc -Wno-error=non-modular-include-in-framework-module";
PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
Expand Down Expand Up @@ -2543,7 +2546,6 @@
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "-Xcc -Wno-error=non-modular-include-in-framework-module";
PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
Expand Down Expand Up @@ -2586,7 +2588,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -2633,7 +2635,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -2690,7 +2692,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -2747,7 +2749,7 @@
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -2791,7 +2793,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -2837,7 +2839,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -2883,7 +2885,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -2929,7 +2931,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -2974,7 +2976,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -3020,7 +3022,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -3065,7 +3067,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -3111,7 +3113,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -3156,7 +3158,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -3202,7 +3204,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -3249,7 +3251,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
Expand Down Expand Up @@ -3298,7 +3300,7 @@
"$(inherited)",
"\"$(SRCROOT)/..\"",
);
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down Expand Up @@ -3401,9 +3403,13 @@
"\"$(SRCROOT)/..\"",
);
INFOPLIST_FILE = "Example/GrowingIO-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
);
PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -3435,9 +3441,13 @@
"\"$(SRCROOT)/..\"",
);
INFOPLIST_FILE = "Example/GrowingIO-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
);
PRODUCT_BUNDLE_IDENTIFIER = "GrowingIO.GrowingIOTest-";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 6 additions & 0 deletions Example/Example/Others/SwiftUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
// 参考:https://github.com/firebase/firebase-ios-sdk/tree/master/FirebaseAnalyticsSwift
#if canImport(SwiftUI)
import SwiftUI
#if canImport(GrowingAnalytics)
import GrowingAnalytics
#endif

#if canImport(GrowingAutotracker)
import GrowingAutotracker
#endif

@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
@objc class SwiftUIViewWrapper: NSObject {
Expand Down
38 changes: 19 additions & 19 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#source 'https://github.com/growingio/giospec.git'
#source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '11.0'
platform :ios, '12.0'
use_frameworks!

install!'cocoapods',:deterministic_uuids=>false, :warn_for_unused_master_specs_repo=>false
Expand All @@ -11,62 +11,62 @@ project 'Example'

target 'Example' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Advert', :path => '../'
pod 'GrowingAnalytics/ImpressionTrack', :path => '../'

# pod 'GrowingAnalytics/Tracker', :path => '../'
# pod 'GrowingAnalytics/Hybrid', :path => '../'
pod 'GrowingAnalytics/Advert', :path => '../'
# pod 'GrowingAnalytics/Flutter', :path => '../'
# pod 'GrowingAnalytics/DISABLE_IDFA', :path => '../' #禁用idfa

pod 'GrowingAPM'
# pod 'GrowingAPM/UIMonitor'
# pod 'GrowingAPM/CrashMonitor'
pod 'GrowingAnalytics/APM', :path => '../'

pod 'GrowingAnalytics/ImpressionTrack', :path => '../'
pod 'GrowingToolsKit', '>= 1.2.1'

pod 'SDCycleScrollView', '~> 1.75'
pod 'LBXScan/LBXNative', '2.3'
pod 'LBXScan/UI', '2.3'
# pod 'Bugly'
pod 'GrowingToolsKit', '>= 1.1.3'
end

target 'GrowingAnalyticsTests' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Tracker', :path => '../'
pod 'GrowingAnalytics/ImpressionTrack', :path => '../'
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Tracker', :path => '../'
pod 'GrowingAnalytics/ImpressionTrack', :path => '../'
end

target 'GrowingAnalyticsStartTests' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Tracker', :path => '../'
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Tracker', :path => '../'
end

target 'HostApplicationTests' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'KIF', :configurations => ['Debug']
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'KIF', :configurations => ['Debug']
end

target 'ProtobufTests' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Autotracker', :path => '../'
end

target 'AdvertTests' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Advert', :path => '../'
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Advert', :path => '../'
end

target 'ExampleiOS13' do
pod 'GrowingAnalytics/Autotracker', :path => '../'
pod 'GrowingAnalytics/Advert', :path => '../'

# 这一行勿删,避免 Multiple commands produce 报错
# 背景:GrowingToolsKit(version 1.0.9+) 依赖 GrowingAPM
# 其目的在于告诉 Cocoapods 在执行 pod install 时,使用 target 'Example' 中所集成的 GrowingAPM,
# 而不是再去集成一个新的 GrowingAPM,其将导致生成 2 个 GrowingAPM Pod Target,编译会出现 Multiple commands produce 报错
pod 'GrowingAPM'
pod 'GrowingToolsKit', '>= 1.1.3'

pod 'GrowingToolsKit', '>= 1.2.1'
end

target 'Example-macOS' do
Expand All @@ -77,7 +77,7 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
Expand Down
Loading

0 comments on commit 7d5de7f

Please sign in to comment.