Преглед изворни кода

Merge branch 'master' of https://git.yishihui.com/iOS/BFCommonKit

* 'master' of https://git.yishihui.com/iOS/BFCommonKit:
  update podspec
  update podspec
  update podspec
  update podspec
  update podspec
  update podspec
  update podspec
  1.打包1.5.2(票圈视频 3.0.1 发版)
harry пре 3 година
родитељ
комит
22568b72ec

+ 7 - 17
BFCommonKit.podspec

@@ -8,7 +8,7 @@
 # update framework 2021.11.1
 Pod::Spec.new do |s|
   s.name             = 'BFCommonKit'
-  s.version          = '1.5.1'
+  s.version          = '1.5.2'
   s.summary          = '基础库'
   s.swift_version    = '5.0'
   s.description      = <<-DESC
@@ -23,15 +23,8 @@ TODO: Add long description of the pod here.
   s.subspec 'BFConfig' do |gg|
     gg.source_files = 'BFCommonKit/Classes/BFConfig/*'
     gg.frameworks = 'UIKit'
-  end
-  s.subspec 'BFBase' do |bb|
-    bb.source_files = 'BFCommonKit/Classes/BFBase/**/*'
-    bb.frameworks = 'UIKit', 'WebKit'
-    bb.dependency 'Alamofire','5.4.4'
-    bb.dependency 'SnapKit','5.0.1'
-    bb.dependency 'BFCommonKit/BFUtility'
-    bb.dependency 'BFCommonKit/BFConfig'
-    bb.dependency 'BFCommonKit/BFCategorys'
+    gg.dependency 'BFCommonKit/BFEnums'
+    gg.dependency 'BFCommonKit/BFCategorys'
   end
   s.subspec 'BFEnums' do |ee|
     ee.source_files = 'BFCommonKit/Classes/BFEnums/*'
@@ -53,12 +46,9 @@ TODO: Add long description of the pod here.
     uu.dependency 'BFCommonKit/BFCategorys'
     uu.dependency 'BFCommonKit/BFConfig'
   end
-  s.subspec 'BFDebug' do |dd|
-    dd.source_files = 'BFCommonKit/Classes/BFDebug/*'
-    dd.frameworks = 'UIKit','MessageUI','WebKit'
-    dd.dependency 'BFCommonKit/BFCategorys'
-  end
-   s.resource_bundles = {
+  s.pod_target_xcconfig = { 'skip_validation' => true }
+  s.resource_bundles = {
       'BFCommonKit_Resources' => ['BFCommonKit/Assets/*']
-    }
+  }
+  # s.prepare_command = '/usr/local/bin/Python3 BFShell/build_lib.py'
 end

+ 1 - 1
BFCommonKit/Classes/BFCategorys/BFColor+Ext.swift

@@ -10,7 +10,7 @@ import Foundation
 import UIKit
 
 public extension UIColor {
-    class func hexColor(hexadecimal: String, alpha:CGFloat = 1) -> UIColor {
+    public class func hexColor(hexadecimal: String, alpha:CGFloat = 1) -> UIColor {
         var cstr = hexadecimal.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased() as NSString
         if cstr.length < 6 {
             return UIColor.clear

+ 69 - 0
BFShell/build_lib.py

@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+import glob
+import os
+
+
+def del_files(path):
+    try:
+        fileNames = glob.glob(path + r'/*')
+        for fileName in fileNames:
+            try:
+                os.remove(fileName)
+                print("del_files - remove:%s" % fileNames)
+            except:
+                print("del_files - remove:删除文件失败")
+            else:
+                print("del_files - remove:删除文件完成")
+    except:
+        try:
+            os.mkdir(fileName)
+            print("del_files - mkdir:%s " % fileName)
+        except:
+            print("del_files - mkdir:删除文件夹失败")
+            del_files(fileName)
+            os.rmdir(fileName)
+        else:
+            print("del_files - mkdir:删除文件夹完成")
+    else:
+        print("del_files - glob:获取rifleName失败")
+
+
+# 替换文件内容
+def replace_swiftUIText(code_file):
+    try:
+        fo = open(code_file, 'r')
+        code_text = fo.read()
+        print("替换前:", code_text)
+        if "canImport(SwiftUI) && canImport(Combine)" in code_text and "canImport(SwiftUI) && canImport(Combine) && (" \
+                                                                       "arch(arm64) || arch(x86_64))" not in code_text:
+            code_text = code_text.replace("canImport(SwiftUI) && canImport(Combine)", "canImport(SwiftUI) && canImport("
+                                                                                      "Combine) "
+                                                                                      "&& (arch(arm64) || arch(x86_64))")
+            print("替换后:", code_text)
+            os.remove(code_file)
+            fo = open(code_file, 'w+')
+            fo.write(code_text)
+            fo.closed
+        else:
+            print("没有变化")
+    except IOError:
+        print("文件错误")
+    else:
+        print("没有变化")
+
+
+
+#def search_file(file_name, search_path, pathsep = os.pathsep):
+#  for path in search_path.split(pathsep):
+#    candidate = os.path.join(path, file_name)
+#    if os.path.isfile(candidate):
+#      return os.path.abspath(candidate)
+#
+
+replace_swiftUIText("/../Pods/Kingfisher/Sources/General/KFOptionsSetter.swift")
+del_files("./Pods/Kingfisher/Sources/SwiftUI")
+
+fo = open("/Users/sanw/Desktop/file.txt", "a+")
+fo.write("\n当前工作目录路径getcwd:%s \n" % os.getcwd())
+fo.write("当前工作目录路径path:%s \n" % os.path.abspath('.'))
+fo.close()

+ 2 - 4
Example/BFCommonKit.xcodeproj/project.pbxproj

@@ -275,7 +275,6 @@
 				"${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework",
 				"${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework",
 				"${BUILT_PRODUCTS_DIR}/KingfisherWebP/KingfisherWebP.framework",
-				"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
 				"${BUILT_PRODUCTS_DIR}/Toast-Swift/Toast_Swift.framework",
 				"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
 			);
@@ -286,7 +285,6 @@
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainAccess.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KingfisherWebP.framework",
-				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Toast_Swift.framework",
 				"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
 			);
@@ -434,7 +432,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MTL_ENABLE_DEBUG_INFO = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -480,7 +478,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";

+ 1 - 2
Example/BFCommonKit/ViewController.swift

@@ -8,7 +8,7 @@
 
 import UIKit
 import BFCommonKit
-class ViewController: PQBaseViewController {
+class ViewController: UIViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -17,7 +17,6 @@ class ViewController: PQBaseViewController {
         btn.frame = CGRect.init(x: 100, y: 100, width: 100, height: 100)
         btn.backgroundColor = UIColor.hexColor(hexadecimal: "#3DC1C1")
         view.addSubview(btn)
-        leftBackButton()
     }
 
     override func didReceiveMemoryWarning() {

+ 1 - 0
Example/Podfile

@@ -4,6 +4,7 @@ platform :ios, '10.0'
 
 target 'BFCommonKit_Example' do
   pod 'BFCommonKit', :path => '../'
+# pod "BFCommonKit",      :git => 'https://git.yishihui.com/iOS/BFCommonKit.git'
 
   target 'BFCommonKit_Tests' do
     inherit! :search_paths

+ 12 - 23
Example/Podfile.lock

@@ -1,25 +1,17 @@
 PODS:
   - Alamofire (5.4.4)
-  - BFCommonKit (1.5.0):
-    - BFCommonKit/BFBase (= 1.5.0)
-    - BFCommonKit/BFCategorys (= 1.5.0)
-    - BFCommonKit/BFConfig (= 1.5.0)
-    - BFCommonKit/BFDebug (= 1.5.0)
-    - BFCommonKit/BFEnums (= 1.5.0)
-    - BFCommonKit/BFUtility (= 1.5.0)
-  - BFCommonKit/BFBase (1.5.0):
-    - Alamofire (= 5.4.4)
-    - BFCommonKit/BFCategorys
-    - BFCommonKit/BFConfig
-    - BFCommonKit/BFUtility
-    - SnapKit (= 5.0.1)
-  - BFCommonKit/BFCategorys (1.5.0):
+  - BFCommonKit (1.5.2):
+    - BFCommonKit/BFCategorys (= 1.5.2)
+    - BFCommonKit/BFConfig (= 1.5.2)
+    - BFCommonKit/BFEnums (= 1.5.2)
+    - BFCommonKit/BFUtility (= 1.5.2)
+  - BFCommonKit/BFCategorys (1.5.2):
     - KingfisherWebP (= 1.3.0)
-  - BFCommonKit/BFConfig (1.5.0)
-  - BFCommonKit/BFDebug (1.5.0):
+  - BFCommonKit/BFConfig (1.5.2):
     - BFCommonKit/BFCategorys
-  - BFCommonKit/BFEnums (1.5.0)
-  - BFCommonKit/BFUtility (1.5.0):
+    - BFCommonKit/BFEnums
+  - BFCommonKit/BFEnums (1.5.2)
+  - BFCommonKit/BFUtility (1.5.2):
     - Alamofire (= 5.4.4)
     - BFCommonKit/BFCategorys
     - BFCommonKit/BFConfig
@@ -41,7 +33,6 @@ PODS:
   - libwebp/mux (1.2.1):
     - libwebp/demux
   - libwebp/webp (1.2.1)
-  - SnapKit (5.0.1)
   - Toast-Swift (5.0.1)
 
 DEPENDENCIES:
@@ -54,7 +45,6 @@ SPEC REPOS:
     - Kingfisher
     - KingfisherWebP
     - libwebp
-    - SnapKit
     - Toast-Swift
 
 EXTERNAL SOURCES:
@@ -63,14 +53,13 @@ EXTERNAL SOURCES:
 
 SPEC CHECKSUMS:
   Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9
-  BFCommonKit: 8afeb14571a71f9ba92d82507976ca2bce899dc1
+  BFCommonKit: a730c6fb330ac0521a691c7da6d7a4fe764e2767
   KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
   Kingfisher: 016c8b653a35add51dd34a3aba36b580041acc74
   KingfisherWebP: dec17a5eb1af2658791bde1f93ae9a853678f826
   libwebp: 98a37e597e40bfdb4c911fc98f2c53d0b12d05fc
-  SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
   Toast-Swift: 9b6a70f28b3bf0b96c40d46c0c4b9d6639846711
 
-PODFILE CHECKSUM: 5c138dc5d174c9336dd4473cb26265c7619334aa
+PODFILE CHECKSUM: 46a6541d329ac57725f417e3184d8a4670ea443f
 
 COCOAPODS: 1.11.2

+ 0 - 1
_Pods.xcodeproj

@@ -1 +0,0 @@
-Example/Pods/Pods.xcodeproj