From 3c9a195118fb6e8a020584f91ccb5b58d3861841 Mon Sep 17 00:00:00 2001 From: adonisyuan Date: Thu, 18 Jan 2018 16:59:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0podspec=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E5=9B=A0=E6=AD=A4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E7=A8=8B=E6=96=87=E4=BB=B6=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0.gitignore=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 30 ++++ Demo/OOMDetector.xcodeproj/project.pbxproj | 26 ++-- OOMDetector.podspec | 145 ++++++++++++++++++ .../libOOMDetector.xcodeproj/project.pbxproj | 2 + 4 files changed, 193 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 OOMDetector.podspec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a03e31 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# General +.DS_Store + +# Xcode +# + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.xcuserdatad +xcuserdata/ + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# + +Pods/ diff --git a/Demo/OOMDetector.xcodeproj/project.pbxproj b/Demo/OOMDetector.xcodeproj/project.pbxproj index 1330ab2..940ae59 100644 --- a/Demo/OOMDetector.xcodeproj/project.pbxproj +++ b/Demo/OOMDetector.xcodeproj/project.pbxproj @@ -13,12 +13,12 @@ 6B8C22ED1F8E494C007DE399 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B8C22EC1F8E494C007DE399 /* Assets.xcassets */; }; 6B8C22F01F8E494C007DE399 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6B8C22EE1F8E494C007DE399 /* LaunchScreen.storyboard */; }; 6B8C22F31F8E494C007DE399 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8C22F21F8E494C007DE399 /* main.m */; }; - 6B9A04F31FD5816F00414B1F /* libOOMDetector.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A04F41FD5816F00414B1F /* libOOMDetector.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 6B9A04F51FD5823800414B1F /* BaseDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8C22E71F8E494C007DE399 /* BaseDemoViewController.m */; }; 6B9A04F61FD5823800414B1F /* DemoViewController2.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B12C7011F974AB8000B42F0 /* DemoViewController2.m */; }; 6B9A04F71FD5823800414B1F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8C22E41F8E494C007DE399 /* AppDelegate.m */; }; 6BADA10D1FA8AC0F00668479 /* DemoViewController3.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BADA10C1FA8AC0F00668479 /* DemoViewController3.m */; }; 6BF6879C1FC3C4D500054160 /* MyOOMDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BF6879B1FC3C4D500054160 /* MyOOMDataManager.m */; }; + 7DE3285020107E9B007A188B /* libOOMDetector.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DE3285120107E9B007A188B /* libOOMDetector.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -39,11 +39,11 @@ 6B8C22EF1F8E494C007DE399 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 6B8C22F11F8E494C007DE399 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6B8C22F21F8E494C007DE399 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 6B9A04F41FD5816F00414B1F /* libOOMDetector.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = libOOMDetector.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6BADA10B1FA8AC0F00668479 /* DemoViewController3.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoViewController3.h; sourceTree = ""; }; 6BADA10C1FA8AC0F00668479 /* DemoViewController3.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoViewController3.m; sourceTree = ""; }; 6BF6879A1FC3C4D500054160 /* MyOOMDataManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyOOMDataManager.h; sourceTree = ""; }; 6BF6879B1FC3C4D500054160 /* MyOOMDataManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyOOMDataManager.m; sourceTree = ""; }; + 7DE3285120107E9B007A188B /* libOOMDetector.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = libOOMDetector.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6B9A04F31FD5816F00414B1F /* libOOMDetector.framework in Frameworks */, + 7DE3285020107E9B007A188B /* libOOMDetector.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -113,7 +113,7 @@ 6B9A04F21FD5816F00414B1F /* Frameworks */ = { isa = PBXGroup; children = ( - 6B9A04F41FD5816F00414B1F /* libOOMDetector.framework */, + 7DE3285120107E9B007A188B /* libOOMDetector.framework */, ); name = Frameworks; sourceTree = ""; @@ -245,7 +245,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -262,10 +262,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Debug; }; @@ -311,10 +312,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Release; }; @@ -333,15 +336,17 @@ Build_For_Extern, ); INFOPLIST_FILE = OOMDetectorDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; NEW_SETTING = ""; + ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "-lc++"; PRODUCT_BUNDLE_IDENTIFIER = com.tencentgsd.OOMDemo; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Debug; }; @@ -355,7 +360,7 @@ DEVELOPMENT_TEAM = 8D5EHT9KTL; GCC_PREPROCESSOR_DEFINITIONS = Build_For_Extern; INFOPLIST_FILE = OOMDetectorDemo/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; NEW_SETTING = ""; OTHER_LDFLAGS = "-lc++"; @@ -363,6 +368,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Release; }; diff --git a/OOMDetector.podspec b/OOMDetector.podspec new file mode 100644 index 0000000..46d3efd --- /dev/null +++ b/OOMDetector.podspec @@ -0,0 +1,145 @@ +# +# Be sure to run `pod spec lint OOMDetector.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +Pod::Spec.new do |s| + + # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # These will help people to find your library, and whilst it + # can feel like a chore to fill in it's definitely to your advantage. The + # summary should be tweet-length, and the description more in depth. + # + + s.name = "OOMDetector" + s.version = "1.0" + s.summary = "OOMDetector is an iOS memory detector, which is used to detect OutOfMemory warnings, big memory allocations and memory leaks." + + # This description is used to generate tags and improve search results. + # * Think: What does it do? Why did you write it? What is the focus? + # * Try to keep it short, snappy and to the point. + # * Write the description between the DESC delimiters below. + # * Finally, don't worry about the indent, CocoaPods strips it! + s.description = <<-DESC + OOMDetector is a memory detector created by programmers from Tencent, which is used as a framework in an iOS app. + By hooking malloc and vm allocation methods, OOMDetector can monitor all allocations of memory by app. Through counting + the summary volume of memory allocated with time, we can get the proximate memory of the app. + DESC + + s.homepage = "https://github.com/Tencent/OOMDetector" + # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" + + + # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Licensing your code is important. See http://choosealicense.com for more info. + # CocoaPods will detect a license file if there is a named LICENSE* + # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. + # + + # s.license = "MIT" + s.license = { :type => "MIT", :file => "LICENSE" } + + + # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the authors of the library, with email addresses. Email addresses + # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also + # accepts just a name if you'd rather not provide an email address. + # + # Specify a social_media_url where others can refer to, for example a twitter + # profile URL. + # + + # s.author = { "" => "" } + s.author = "Tencent" + # s.authors = { "" => "" } + # s.social_media_url = "http://twitter.com/" + + # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If this Pod runs only on iOS or OS X, then specify the platform and + # the deployment target. You can optionally include the target after the platform. + # + + # s.platform = :ios + s.platform = :ios, "7.0" + + # When using multiple platforms + # s.ios.deployment_target = "5.0" + # s.osx.deployment_target = "10.7" + # s.watchos.deployment_target = "2.0" + # s.tvos.deployment_target = "9.0" + + + # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Specify the location from where the source should be retrieved. + # Supports git, hg, bzr, svn and HTTP. + # + + s.source = { :git => "https://github.com/Tencent/OOMDetector.git", :tag => "#{s.version}" } + + # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # CocoaPods is smart about how it includes source code. For source files + # giving a folder will include any swift, h, m, mm, c & cpp files. + # For header files it will include any header in the folder. + # Not including the public_header_files will make all headers public. + # + + # s.source_files = "libOOMDetector/libOOMDetector", "libOOMDetector/libOOMDetector/**/*.{h,m}", "Demo/**/*.{h,m}" + # s.exclude_files = "libOOMDetector/libOOMDetector/Exclude" + + # s.public_header_files = ['libOOMDetector/libOOMDetector/OOMDetector/common/upload/QQLeakDataUploadCenter.h', 'libOOMDetector/libOOMDetector/OOMDetector/Headers/*.h', 'libOOMDetector/libOOMDetector/OOMDetector/OOMDetector/statistic/OOMStatisticsInfoCenter.h', 'libOOMDetector/libOOMDetector/OOMDetector/common/upload/QQLeakFileUploadCenter.h', 'libOOMDetector/libOOMDetector/libOOMDetector.h'] + + s.source_files = "libOOMDetector/libOOMDetector", "libOOMDetector/libOOMDetector/**/*.{h,m,mm,c}" + s.public_header_files = ['libOOMDetector/libOOMDetector/OOMDetector/common/upload/QQLeakDataUploadCenter.h', 'libOOMDetector/libOOMDetector/OOMDetector/Headers/*.h', 'libOOMDetector/libOOMDetector/OOMDetector/OOMDetector/statistic/OOMStatisticsInfoCenter.h', 'libOOMDetector/libOOMDetector/OOMDetector/common/upload/QQLeakFileUploadCenter.h', 'libOOMDetector/libOOMDetector/libOOMDetector.h'] + + # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # A list of resources included with the Pod. These are copied into the + # target bundle with a build phase script. Anything else will be cleaned. + # You can preserve files from being cleaned, please don't preserve + # non-essential files like tests, examples and documentation. + # + + # s.resource = "icon.png" + # s.resources = "Resources/*.png" + s.resources = "assets/*.gif" + + # s.preserve_paths = "FilesToSave", "MoreFilesToSave" + + + # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # Link your library with frameworks, or libraries. Libraries do not include + # the lib prefix of their name. + # + + # s.framework = "SomeFramework" + # s.frameworks = "SomeFramework", "AnotherFramework" + + # s.library = "iconv" + # s.libraries = "iconv", "xml2" + + + # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # + # If your library depends on compiler flags you can set them in the xcconfig hash + # where they will only apply to your library. If you depend on other Podspecs + # you can include multiple dependencies to ensure it works. + + # s.requires_arc = true + s.requires_arc = false + s.requires_arc = ['libOOMDetector/libOOMDetector/OOMDetector/common/upload/QQLeakDataUploadCenter.mm', 'libOOMDetector/libOOMDetector/OOMDetector/OOMDetector/memoryIndicator/MemoryIndicator.m'] + + + # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } + # s.dependency "JSONKit", "~> 1.4" + +end diff --git a/libOOMDetector/libOOMDetector.xcodeproj/project.pbxproj b/libOOMDetector/libOOMDetector.xcodeproj/project.pbxproj index 5e08a41..8092ad8 100644 --- a/libOOMDetector/libOOMDetector.xcodeproj/project.pbxproj +++ b/libOOMDetector/libOOMDetector.xcodeproj/project.pbxproj @@ -692,6 +692,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Debug; }; @@ -718,6 +719,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "arm64 armv7 armv7s x86_64 i386"; }; name = Release; };