From f1192bb886242dcad49da4cfddd7cd77d4602fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=80=E6=9C=88?= Date: Mon, 29 Jan 2024 17:08:23 +0800 Subject: [PATCH] Release 4.6.2 --- Gemfile | 5 - Gemfile.lock | 248 ------------------ SensorsAnalyticsSDK.podspec | 6 +- SensorsAnalyticsSDK.xcodeproj/project.pbxproj | 16 +- .../Core/SensorsAnalyticsSDK.m | 6 +- .../DebugMode/SensorsAnalyticsSDK+DebugMode.m | 9 + .../{Core => Resources}/PrivacyInfo.xcprivacy | 0 fastlane/.env | 8 - fastlane/Fastfile | 174 ------------ .../actions/sa_push_git_tags_to_remote.rb | 47 ---- fastlane/actions/sa_read_release_note.rb | 57 ---- fastlane/modify_version.sh | 57 ---- fastlane/replace_code.sh | 20 -- 13 files changed, 27 insertions(+), 626 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock rename SensorsAnalyticsSDK/{Core => Resources}/PrivacyInfo.xcprivacy (100%) delete mode 100644 fastlane/.env delete mode 100644 fastlane/Fastfile delete mode 100644 fastlane/actions/sa_push_git_tags_to_remote.rb delete mode 100644 fastlane/actions/sa_read_release_note.rb delete mode 100755 fastlane/modify_version.sh delete mode 100755 fastlane/replace_code.sh diff --git a/Gemfile b/Gemfile deleted file mode 100644 index b91f36dc..00000000 --- a/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" -gem "cocoapods" -gem "xcode-install" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 069b8c46..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,248 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.2) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.2) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - atomos (0.1.3) - aws-eventstream (1.1.0) - aws-partitions (1.310.0) - aws-sdk-core (3.94.1) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.239.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.30.0) - aws-sdk-core (~> 3, >= 3.71.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.63.1) - aws-sdk-core (~> 3, >= 3.83.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.3) - aws-eventstream (~> 1.0, >= 1.0.2) - babosa (1.0.3) - claide (1.0.3) - cocoapods (1.9.1) - activesupport (>= 4.0.2, < 5) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.1) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.6.6) - nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.1) - activesupport (>= 4.0.2, < 6) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.5.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored (1.2) - colored2 (3.1.2) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - concurrent-ruby (1.1.6) - declarative (0.0.10) - declarative-option (0.1.0) - digest-crc (0.5.1) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) - escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) - excon (0.73.0) - faraday (0.17.3) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) - http-cookie (~> 1.0.0) - faraday_middleware (0.13.1) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.7) - fastlane (2.146.1) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) - aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.2, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) - colored - commander-fastlane (>= 4.4.6, < 5.0.0) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 0.17) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.13.1) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.29.2, < 0.37.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) - json (< 3.0.0) - jwt (~> 2.1.0) - mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) - multipart-post (~> 2.0.0) - plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - ffi (1.12.2) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - google-api-client (0.36.4) - addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) - google-cloud-core (1.5.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.3.1) - faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.0) - google-cloud-storage (1.26.1) - addressable (~> 2.5) - digest-crc (~> 0.4) - google-api-client (~> 0.33) - google-cloud-core (~> 1.2) - googleauth (~> 0.9) - mini_mime (~> 1.0) - googleauth (0.12.0) - faraday (>= 0.17.3, < 2.0) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (~> 0.14) - highline (1.7.10) - http-cookie (1.0.3) - domain_name (~> 0.5) - httpclient (2.8.3) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jmespath (1.4.0) - json (2.3.0) - jwt (2.1.0) - memoist (0.16.2) - mini_magick (4.10.1) - mini_mime (1.0.2) - minitest (5.14.0) - molinillo (0.6.6) - multi_json (1.14.1) - multi_xml (0.6.0) - multipart-post (2.0.0) - nanaimo (0.2.6) - nap (1.1.0) - naturally (2.2.0) - netrc (0.11.0) - os (1.1.0) - plist (3.5.0) - public_suffix (2.0.5) - representable (3.0.4) - declarative (< 0.1.0) - declarative-option (< 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rouge (2.0.7) - ruby-macho (1.4.0) - rubyzip (1.3.0) - security (0.1.3) - signet (0.14.0) - addressable (~> 2.3) - faraday (>= 0.17.3, < 2.0) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.8) - CFPropertyList - naturally - slack-notifier (2.3.2) - terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - tty-cursor (0.7.1) - tty-screen (0.7.1) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - typhoeus (1.3.1) - ethon (>= 0.9.0) - tzinfo (1.2.7) - thread_safe (~> 0.1) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.7) - unicode-display_width (1.7.0) - word_wrap (1.0.0) - xcode-install (2.6.4) - claide (>= 0.9.1, < 1.1.0) - fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.16.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.2.6) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.0) - xcpretty (~> 0.2, >= 0.0.7) - -PLATFORMS - ruby - -DEPENDENCIES - cocoapods - fastlane - xcode-install - -BUNDLED WITH - 1.17.2 diff --git a/SensorsAnalyticsSDK.podspec b/SensorsAnalyticsSDK.podspec index 3bc577b1..85ceace3 100644 --- a/SensorsAnalyticsSDK.podspec +++ b/SensorsAnalyticsSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SensorsAnalyticsSDK" - s.version = "4.6.1" + s.version = "4.6.2" s.summary = "The official iOS SDK of Sensors Analytics." s.homepage = "http://www.sensorsdata.cn" s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" } @@ -14,6 +14,10 @@ Pod::Spec.new do |s| s.libraries = 'icucore', 'z' + s.resource_bundle = { + 'SensorsAnalyticsSDK' => ['SensorsAnalyticsSDK/Resources/PrivacyInfo.xcprivacy'] + } + s.subspec '__Store' do |store| store.source_files = 'SensorsAnalyticsSDK/Store/*.{h,m}' store.public_header_files = 'SensorsAnalyticsSDK/Store/SABaseStoreManager.h', 'SensorsAnalyticsSDK/Store/SAStorePlugin.h', 'SensorsAnalyticsSDK/Store/SAAESStorePlugin.h' diff --git a/SensorsAnalyticsSDK.xcodeproj/project.pbxproj b/SensorsAnalyticsSDK.xcodeproj/project.pbxproj index 8e80a0a2..2a426a5d 100644 --- a/SensorsAnalyticsSDK.xcodeproj/project.pbxproj +++ b/SensorsAnalyticsSDK.xcodeproj/project.pbxproj @@ -189,6 +189,7 @@ 4DD1296A25F8E451008C0B1E /* SAViewNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DD1296125F8E451008C0B1E /* SAViewNode.h */; }; 4DD1296B25F8E451008C0B1E /* SAViewNodeFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DD1296225F8E451008C0B1E /* SAViewNodeFactory.h */; }; 4DD1296D25F8E451008C0B1E /* SAViewNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DD1296425F8E451008C0B1E /* SAViewNode.m */; }; + 4DDDF83F2B6243CD0029577E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 4DDDF83E2B6243CD0029577E /* PrivacyInfo.xcprivacy */; }; 4DDE42CF29262934007EDA27 /* UIApplication+SAAutoTrack.m in Sources */ = {isa = PBXBuildFile; fileRef = A8356D912656459A00FD64AA /* UIApplication+SAAutoTrack.m */; }; 4DDE42D029262993007EDA27 /* SALoggerPrePostFixFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D2D53792591EB0600805141 /* SALoggerPrePostFixFormatter.m */; }; 4DDE42D129262A13007EDA27 /* SADatabaseUnitTest.m in Sources */ = {isa = PBXBuildFile; fileRef = F214CE57249A07DF00A2633D /* SADatabaseUnitTest.m */; }; @@ -523,7 +524,6 @@ F2CD8A7A28A2410A00A186B8 /* SAExposureConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = F2CD8A7828A2410A00A186B8 /* SAExposureConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; F2CD8A7B28A2410A00A186B8 /* SAExposureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = F2CD8A7928A2410A00A186B8 /* SAExposureConfig.m */; }; F2CFD14726EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = F2CFD14526EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F2D769D42B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */; }; F2E36483287682E6008D9151 /* SADeviceWhiteList.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E36481287682E6008D9151 /* SADeviceWhiteList.h */; }; F2E36484287682E6008D9151 /* SADeviceWhiteList.m in Sources */ = {isa = PBXBuildFile; fileRef = F2E36482287682E6008D9151 /* SADeviceWhiteList.m */; }; F2E364872876EE94008D9151 /* SASlinkCreator.h in Headers */ = {isa = PBXBuildFile; fileRef = F2E364852876EE94008D9151 /* SASlinkCreator.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -790,6 +790,7 @@ 4DD1296125F8E451008C0B1E /* SAViewNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SAViewNode.h; sourceTree = ""; }; 4DD1296225F8E451008C0B1E /* SAViewNodeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SAViewNodeFactory.h; sourceTree = ""; }; 4DD1296425F8E451008C0B1E /* SAViewNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SAViewNode.m; sourceTree = ""; }; + 4DDDF83E2B6243CD0029577E /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 4DF6FDF92832660800585FCC /* SAQueryRecordInterceptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SAQueryRecordInterceptor.h; sourceTree = ""; }; 4DF6FDFA2832660800585FCC /* SAQueryRecordInterceptor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SAQueryRecordInterceptor.m; sourceTree = ""; }; 8809805327FDA05600EB2B3D /* SAInterceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SAInterceptor.h; sourceTree = ""; }; @@ -1122,7 +1123,6 @@ F2CD8A7828A2410A00A186B8 /* SAExposureConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SAExposureConfig.h; sourceTree = ""; }; F2CD8A7928A2410A00A186B8 /* SAExposureConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SAExposureConfig.m; sourceTree = ""; }; F2CFD14526EB04A8007A9253 /* SAConfigOptions+RemoteConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SAConfigOptions+RemoteConfig.h"; sourceTree = ""; }; - F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; F2E36481287682E6008D9151 /* SADeviceWhiteList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SADeviceWhiteList.h; sourceTree = ""; }; F2E36482287682E6008D9151 /* SADeviceWhiteList.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SADeviceWhiteList.m; sourceTree = ""; }; F2E364852876EE94008D9151 /* SASlinkCreator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SASlinkCreator.h; sourceTree = ""; }; @@ -1536,6 +1536,14 @@ path = Config; sourceTree = ""; }; + 4DDDF83D2B6243CD0029577E /* Resources */ = { + isa = PBXGroup; + children = ( + 4DDDF83E2B6243CD0029577E /* PrivacyInfo.xcprivacy */, + ); + path = Resources; + sourceTree = ""; + }; 880F37D824AC31A6005AC8A0 /* Tracker */ = { isa = PBXGroup; children = ( @@ -1595,7 +1603,6 @@ 881A40F4253D7B4F00854F69 /* SensorsAnalyticsSDK+Private.h */, 45A565BB263C17E400C9C41B /* SAAppLifecycle.h */, 45A565BA263C17E400C9C41B /* SAAppLifecycle.m */, - F2D769D32B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy */, ); path = Core; sourceTree = ""; @@ -2127,6 +2134,7 @@ CB30BFD122840EBF0004061D /* SensorsAnalyticsSDK */ = { isa = PBXGroup; children = ( + 4DDDF83D2B6243CD0029577E /* Resources */, F2B643F328322EE800544BD2 /* AppExtension */, 88EC2DEE2757688400EF9778 /* Store */, A806642526905F6C00FFDEBA /* ChannelMatch */, @@ -2692,7 +2700,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - F2D769D42B4D4C6F00F127B2 /* PrivacyInfo.xcprivacy in Resources */, + 4DDDF83F2B6243CD0029577E /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m index 52ade5ee..06c5ee02 100755 --- a/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m +++ b/SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m @@ -68,7 +68,7 @@ #import #endif -#define VERSION @"4.6.1" +#define VERSION @"4.6.2" void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag; @@ -905,10 +905,6 @@ - (void)stopFlushTimer { }); } -- (SensorsAnalyticsDebugMode)debugMode { - return self.configOptions.debugMode; -} - #pragma mark - SensorsData Analytics - (void)profilePushKey:(NSString *)pushTypeKey pushId:(NSString *)pushId { diff --git a/SensorsAnalyticsSDK/DebugMode/SensorsAnalyticsSDK+DebugMode.m b/SensorsAnalyticsSDK/DebugMode/SensorsAnalyticsSDK+DebugMode.m index 496de526..655c7d75 100644 --- a/SensorsAnalyticsSDK/DebugMode/SensorsAnalyticsSDK+DebugMode.m +++ b/SensorsAnalyticsSDK/DebugMode/SensorsAnalyticsSDK+DebugMode.m @@ -25,10 +25,19 @@ #import "SensorsAnalyticsSDK+DebugMode.h" #import "SADebugModeManager.h" +@interface SensorsAnalyticsSDK() +@property (nonatomic, strong) SAConfigOptions *configOptions; + +@end + @implementation SensorsAnalyticsSDK (DebugMode) - (void)showDebugInfoView:(BOOL)show { [[SADebugModeManager defaultManager] setShowDebugAlertView:show]; } +- (SensorsAnalyticsDebugMode)debugMode { + return self.configOptions.debugMode; +} + @end diff --git a/SensorsAnalyticsSDK/Core/PrivacyInfo.xcprivacy b/SensorsAnalyticsSDK/Resources/PrivacyInfo.xcprivacy similarity index 100% rename from SensorsAnalyticsSDK/Core/PrivacyInfo.xcprivacy rename to SensorsAnalyticsSDK/Resources/PrivacyInfo.xcprivacy diff --git a/fastlane/.env b/fastlane/.env deleted file mode 100644 index 637edf59..00000000 --- a/fastlane/.env +++ /dev/null @@ -1,8 +0,0 @@ - -GITLAB_PATH="~/Documents/Git/sa-sdk-ios" -GITHUB_PATH="~/Documents/GitHub/sa-sdk-ios" - -GITHUB_OWNER="minchaozhang" -GITHUB_REPOSITORY="sa-sdk-ios" - -FRAMEWORK_NAME=SensorsAnalyticsSDK diff --git a/fastlane/Fastfile b/fastlane/Fastfile deleted file mode 100644 index ab93edb3..00000000 --- a/fastlane/Fastfile +++ /dev/null @@ -1,174 +0,0 @@ -# Customise this file, documentation can be found here: -# https://github.com/fastlane/fastlane/tree/master/fastlane/docs -# All available actions: https://docs.fastlane.tools/actions -# can also be listed using the `fastlane actions` command - -# Change the syntax highlighting to Ruby -# All lines starting with a # are ignored when running `fastlane` - -# If you want to automatically update fastlane if a new version is available: -# update_fastlane - -# This is the minimum version number required. -# Update this, if you use features of a newer version -fastlane_version "2.28.3" - -default_platform :ios - -platform :ios do - - desc "Runs all the tests" - lane :test do - scan - end - - desc "Commit" - lane :commit do |options| - if !options[:version] - raise "No version specified!".red - end - - git_add( - path: "." - ) - - # commit the branch - git_commit( - path: ".", - message: "Release #{options[:version]}" - ) - - #push the branch - push_to_git_remote( - remote: options[:remote] - ) - end - - desc "Prepare release new version" - lane :prepare_release do |options| - if !options[:version] - raise "No version specified!".red - end - - if options[:skip_modify_version] != true - sh("chmod 777 ./modify_version.sh") - sh("./modify_version.sh #{ENV["FRAMEWORK_NAME"]} #{options[:version]} #{options[:branch]}") - - commit( - version: options[:version], - remote: options[:remote] - ) - end - - if options[:skip_replace_code] != true - sh("chmod 777 ./replace_code.sh") - sh("./replace_code.sh #{ENV["GITLAB_PATH"]} #{ENV["GITHUB_PATH"]} #{options[:version]} #{options[:branch]}") - end - end - - - lane :github_tag do |options| - if !options[:version] - raise "No version specified!".red - end - - # tag the repo - add_git_tag( - tag: "v#{options[:version]}" - ) - - # push the tag - if options[:skip_push_tags] != true - sa_push_git_tags_to_remote( - remote: options[:remote] - ) - end - end - - lane :github_release do |options| - if !options[:version] - raise "No version specified!".red - end - if !options[:api_token] - raise "No version specified!".red - end - - file_path = options[:file_path] ? options[:file_path] : (ENV["GITHUB_RELEASE_NOTE"] ? ENV["GITHUB_RELEASE_NOTE"] : "fastlane/ReleaseNote.md") - body = sa_read_release_note( - file_path: file_path - ) - - owner=ENV["GITHUB_OWNER"] - repo=ENV["GITHUB_REPOSITORY"] - github_release = set_github_release( - repository_name: "#{owner}/#{repo}", - api_token: "#{options[:api_token]}", - name: "Release #{options[:version]}", - tag_name: "v#{options[:version]}", - description: body - ) - end - - lane :cocoapods_push do |options| - pod_push( - allow_warnings: options[:allow_warnings] - ) - end - - lane :github_push do |options| - if options[:skip_github_commit] != true - commit( - version: options[:version], - remote: options[:remote] - ) - end - - if options[:skip_github_tag] != true - github_tag( - version: options[:version], - remote: options[:remote], - skip_push_tags: options[:skip_push_tags] - ) - end - - if options[:skip_github_release] != true - github_release( - version: options[:version], - remote: options[:remote], - api_token: options[:api_token], - ) - end - - if options[:skip_pod_push] != true - cocoapods_push( - allow_warnings: options[:allow_warnings] - ) - end - end - - lane :release do |options| - if !options[:version] - raise "No version specified!".red - end - - branch = options[:branch] ? options[:branch] : "master" - remote = options[:remote] ? options[:remote] : "origin" - prepare_release( - version: options[:version], - branch: branch, - remote: remote, - skip_modify_version: options[:skip_modify_version], - skip_replace_code: options[:skip_replace_code] - ) - - skip_push_tags = options[:skip_push_tags] ? options[:skip_push_tags] : false - skip_github_commit = options[:skip_github_commit] ? options[:skip_github_commit] : false - skip_github_tag = options[:skip_github_tag] ? options[:skip_github_tag] : false - skip_github_release = options[:skip_github_release] ? options[:skip_github_release] : false - skip_pod_push = options[:skip_pod_push] ? options[:skip_pod_push] : false - allow_warnings = options[:allow_warnings] ? options[:allow_warnings] : true - sh("cd #{ENV["GITHUB_PATH"]} && fastlane github_push version:#{options[:version]} branch:#{branch} remote:#{remote} api_token:#{options[:api_token]} skip_push_tags:#{skip_push_tags} skip_github_commit:#{skip_github_commit} skip_github_tag:#{skip_github_tag} skip_github_release:#{skip_github_release} skip_pod_push:#{skip_pod_push} allow_warnings:#{allow_warnings}") - end -end - - diff --git a/fastlane/actions/sa_push_git_tags_to_remote.rb b/fastlane/actions/sa_push_git_tags_to_remote.rb deleted file mode 100644 index c921ee13..00000000 --- a/fastlane/actions/sa_push_git_tags_to_remote.rb +++ /dev/null @@ -1,47 +0,0 @@ -module Fastlane - module Actions - class SaPushGitTagsToRemoteAction < Action - def self.run(params) - commands = ["git", "push"] - - if params[:remote] - commands << "#{params[:remote]}" - end - - commands << "--tags" - - result = Actions.sh("#{commands.join(" ")}") - UI.success("Tags pushed to remote") - return result - end - - ##################################################### - # @!group Documentation - ##################################################### - - def self.description - "Push local tags to the remote - this will only push tags" - end - - def self.available_options - [ - FastlaneCore::ConfigItem.new(key: :remote, - env_name: "FL_PUSH_GIT_TAGS_REMOTE", - description: "The remote to push tags too", - is_string:true, - optional:true) - ] - end - - def self.author - ['vittoriom'] - end - - def self.is_supported?(platform) - true - end - end - end - end - - diff --git a/fastlane/actions/sa_read_release_note.rb b/fastlane/actions/sa_read_release_note.rb deleted file mode 100644 index 2e08166f..00000000 --- a/fastlane/actions/sa_read_release_note.rb +++ /dev/null @@ -1,57 +0,0 @@ -module Fastlane - module Actions - - class SaReadReleaseNoteAction < Action - def self.replace(filepath, regexp, *args, &block) - content = File.read(filepath).gsub(regexp, *args, &block) - File.open(filepath, 'wb') { |file| file.write(content) } - end - - def self.run(params) - file = File.new("#{params[:file_path]}", "r") - if file - content = file.sysread(1000) - UI.success("#{params[:file_path]} content: \n #{content} \n") - return content.force_encoding('UTF-8') - else - raise "No ReleaseNote found in #{params[:file_path]}".red - end - end - - ##################################################### - # @!group Documentation - ##################################################### - - def self.description - "Read release note form a file" - end - - def self.details - "Read release note form a file." - end - - def self.available_options - [ - FastlaneCore::ConfigItem.new(key: :file_path, - description: "Path for the file", - is_string: true, - optional: false), - ] - end - - def self.output - end - - def self.return_value - end - - def self.authors - ["minchaozhang"] - end - - def self.is_supported?(platform) - return true - end - end - end -end diff --git a/fastlane/modify_version.sh b/fastlane/modify_version.sh deleted file mode 100755 index 05e42015..00000000 --- a/fastlane/modify_version.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -FRAMEWORK_NAME=$1 -VERSION=$2 -BRANCH=$3 - -SRCROOT_PATH=.. - -cd $SRCROOT_PATH -git checkout $BRANCH -git pull - -###################### -# Podspec version -###################### -POD_PAHT=./${FRAMEWORK_NAME}.podspec -if [[ $BRANCH == 'pre' ]]; then - POD_PAHT=./${FRAMEWORK_NAME}-pre.podspec -fi - -POD_VERSION_CODE=" s.version = " -if [ `grep -c "\"${VERSION}\"" $POD_PAHT` == '0' ]; then - LINE=`grep -n "${POD_VERSION_CODE}" ${POD_PAHT} | head -1 | cut -d ":" -f 1` - LINE=$((${LINE} - 1)) - echo "${POD_VERSION_CODE} at line: ${LINE}" - - sed -i '' "/${POD_VERSION_CODE}/d" ${POD_PAHT} - sed -i '' "${LINE} a\ - \\${POD_VERSION_CODE}\"${VERSION}\" - " ${POD_PAHT} -fi - -###################### -# Lib version -###################### -LIB_VERSION_PATH=${FRAMEWORK_NAME}/${FRAMEWORK_NAME}.m -LIB_VERSION_CODE="#define VERSION @" -if [ `grep -c "${LIB_VERSION_CODE}\"${VERSION}\"" ${LIB_VERSION_PATH}` == '0' ]; then - LINE=`grep -n "${LIB_VERSION_CODE}" ${LIB_VERSION_PATH} | head -1 | cut -d ":" -f 1` - LINE=$((${LINE} - 1)) - echo "${LIB_VERSION_CODE} at line: ${LINE}" - - sed -i '' "/${LIB_VERSION_CODE}/d" ${LIB_VERSION_PATH} - sed -i '' "${LINE} a\ - \\${LIB_VERSION_CODE}\"${VERSION}\" - " ${LIB_VERSION_PATH} -fi - -###################### -# GitLab -###################### -# 提交版本修改代码 -#git add . -#git commit -m "修改版本号为:${VERSION}" -#git push - -exit 0 diff --git a/fastlane/replace_code.sh b/fastlane/replace_code.sh deleted file mode 100755 index c36f28c5..00000000 --- a/fastlane/replace_code.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -GITLAB_PATH=$1 -GITHUB_PATH=$2 - -VERSION=$3 -BRANCH=$4 - -###################### -# Podspec version -###################### - -cd ${GITHUB_PATH} -git checkout ${BRANCH} -git pull - -rm -rf ${GITHUB_PATH}/* -cp -rf ${GITLAB_PATH}/* ${GITHUB_PATH} - -exit 0