Compare commits

...

16 Commits
0.4.2 ... 0.5.0

Author SHA1 Message Date
Leave
ac0a841212
Merge pull request #62 from leavez/custom_options
Add ability to set custom options for prebuiding
2019-04-17 14:28:12 +08:00
Leave
0af792fac0
Merge branch '0.5.0' into custom_options 2019-04-17 14:27:43 +08:00
Leavez
e2b96c462a Merge generated swift headers for xcode 10.2
close #58
2019-04-17 14:08:01 +08:00
Leavez
e8997b7a10 fix typo 2019-04-17 13:37:10 +08:00
Leavez
41b2b46d4c add demo project 2019-04-16 19:50:53 +08:00
Leavez
84cdaa6f8d add demo folder 2019-04-16 19:42:47 +08:00
Leavez
bdabee15ac bump to 0.4.3 2019-04-01 13:01:38 +08:00
Leavez
ab914346a4 fix #50 2019-04-01 13:00:31 +08:00
leavez
3043ef216f ensure lipo dsym won't generate error if non-exist 2019-03-29 01:56:43 +08:00
leavez
e732532816 fix for non-compiling error printing 2019-03-29 01:47:02 +08:00
leavez
097527ab1f make sure xcpretty won't crash, as it's not improtant 2019-03-29 01:21:13 +08:00
leavez
10415b4a42 Update build_framework.rb 2019-03-29 01:19:44 +08:00
leavez
31f65ef345 use xcpretty to print fail log 2019-03-29 01:19:30 +08:00
leavez
d51dc68409 abort when build error 2019-03-24 23:48:35 +08:00
leavez
b2ef58c49b add API for custom_build_option 2019-03-24 23:22:16 +08:00
leavez
7965225d8e add custom_build_option for buiding 2019-03-24 22:03:24 +08:00
19 changed files with 883 additions and 24 deletions

View File

@ -13,13 +13,14 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/leavez/cocoapods-binary'
spec.license = 'MIT'
spec.files = `git ls-files`.split($/).reject{|f| f.start_with? "test/"}
spec.files = `git ls-files`.split($/).reject{|f| f.start_with?("test/") || f.start_with?('demo/')}
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
spec.add_dependency "cocoapods", ">= 1.5.0", "< 2.0"
spec.add_dependency "fourflusher", "~> 2.0"
spec.add_dependency "xcpretty", "~> 0.3.0"
spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'

2
demo/.bundle/config Normal file
View File

@ -0,0 +1,2 @@
---
BUNDLE_PATH: "./.bundler_cache"

50
demo/.gitignore vendored Normal file
View File

@ -0,0 +1,50 @@
# Created by https://www.gitignore.io/api/xcode,cocoapods
# Edit at https://www.gitignore.io/?templates=xcode,cocoapods
### CocoaPods ###
## CocoaPods GitIgnore Template
# CocoaPods - Only use to conserve bandwidth / Save time on Pushing
# - Also handy if you have a large number of dependant pods
# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
Pods/
### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## User settings
xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings
# End of https://www.gitignore.io/api/xcode,cocoapods
# the bundler local cache
.bundler_cache/

7
demo/Gemfile Normal file
View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem 'cocoapods', '1.6.1'
gem 'cocoapods-binary', :path => "../"

84
demo/Gemfile.lock Normal file
View File

@ -0,0 +1,84 @@
PATH
remote: ..
specs:
cocoapods-binary (0.4.3)
cocoapods (>= 1.5.0, < 2.0)
fourflusher (~> 2.0)
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.6.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.6.1)
cocoapods-deintegrate (>= 1.0.2, < 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.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.2.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.8.1, < 2.0)
cocoapods-core (1.6.1)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.5)
escape (0.0.4)
fourflusher (2.2.0)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
molinillo (0.6.6)
nanaimo (0.2.6)
nap (1.1.0)
netrc (0.11.0)
ruby-macho (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.8.2)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (= 1.6.1)
cocoapods-binary!
BUNDLED WITH
2.0.1

12
demo/Podfile Normal file
View File

@ -0,0 +1,12 @@
platform :ios, '9.0'
plugin 'cocoapods-binary'
use_frameworks!
all_binary!
target 'demo' do
pod 'Masonry'
end

16
demo/Podfile.lock Normal file
View File

@ -0,0 +1,16 @@
PODS:
- Masonry (1.1.0)
DEPENDENCIES:
- Masonry
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Masonry
SPEC CHECKSUMS:
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
PODFILE CHECKSUM: 5daab9dbab4736d6a1b3df2ffa8d856285c16553
COCOAPODS: 1.6.1

View File

@ -0,0 +1,417 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */ = {isa = PBXBuildFile; fileRef = 89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */; };
7ADC04F6B6AD86B4711FC662 /* Pods_demo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0282097ED33E34DF2FB40193 /* Pods_demo.framework */; };
8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */; };
8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BC2E4C9225F2B8600EC0609 /* ViewController.swift */; };
8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0282097ED33E34DF2FB40193 /* Pods_demo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demo.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6F9AD13F2ED88EAB7A9128D7 /* libPods-demoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-demoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = BDWebImage_demo.m; sourceTree = "<group>"; };
8BC2E4C4225F2B8600EC0609 /* demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8BC2E4C9225F2B8600EC0609 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
8BC2E4D1225F2B8700EC0609 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8BC2E4D3225F2B8700EC0609 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9A8064F1F3E5738D234C80E2 /* Pods-demoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.release.xcconfig"; path = "Target Support Files/Pods-demoTests/Pods-demoTests.release.xcconfig"; sourceTree = "<group>"; };
C55F7BF03CC970F91505F490 /* Pods-demoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoTests.debug.xcconfig"; path = "Target Support Files/Pods-demoTests/Pods-demoTests.debug.xcconfig"; sourceTree = "<group>"; };
E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.release.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.release.xcconfig"; sourceTree = "<group>"; };
F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demo.debug.xcconfig"; path = "Target Support Files/Pods-demo/Pods-demo.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8BC2E4C1225F2B8600EC0609 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7ADC04F6B6AD86B4711FC662 /* Pods_demo.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
03BCE6F733E8AF8755385CE8 /* Frameworks */ = {
isa = PBXGroup;
children = (
6F9AD13F2ED88EAB7A9128D7 /* libPods-demoTests.a */,
0282097ED33E34DF2FB40193 /* Pods_demo.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
48064E0CABFB2B206E032E3B /* demos */ = {
isa = PBXGroup;
children = (
89A7B09D8E1B9A5928206B3D /* BDWebImage_demo.m */,
);
name = demos;
path = ./demos;
sourceTree = "<group>";
};
8BC2E4BB225F2B8600EC0609 = {
isa = PBXGroup;
children = (
8BC2E4C6225F2B8600EC0609 /* demo */,
8BC2E4C5225F2B8600EC0609 /* Products */,
D25B1A678978B02ABFF01D1C /* Pods */,
03BCE6F733E8AF8755385CE8 /* Frameworks */,
);
sourceTree = "<group>";
};
8BC2E4C5225F2B8600EC0609 /* Products */ = {
isa = PBXGroup;
children = (
8BC2E4C4225F2B8600EC0609 /* demo.app */,
);
name = Products;
sourceTree = "<group>";
};
8BC2E4C6225F2B8600EC0609 /* demo */ = {
isa = PBXGroup;
children = (
8BC2E4C7225F2B8600EC0609 /* AppDelegate.swift */,
8BC2E4C9225F2B8600EC0609 /* ViewController.swift */,
8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */,
8BC2E4D3225F2B8700EC0609 /* Info.plist */,
48064E0CABFB2B206E032E3B /* demos */,
);
path = demo;
sourceTree = "<group>";
};
D25B1A678978B02ABFF01D1C /* Pods */ = {
isa = PBXGroup;
children = (
F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */,
E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */,
C55F7BF03CC970F91505F490 /* Pods-demoTests.debug.xcconfig */,
9A8064F1F3E5738D234C80E2 /* Pods-demoTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8BC2E4C3225F2B8600EC0609 /* demo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */;
buildPhases = (
4A7278B702427200DBDC45CB /* [CP] Check Pods Manifest.lock */,
8BC2E4C0225F2B8600EC0609 /* Sources */,
8BC2E4C1225F2B8600EC0609 /* Frameworks */,
8BC2E4C2225F2B8600EC0609 /* Resources */,
27E132FE722A29856F619A3D /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = demo;
productName = demo;
productReference = 8BC2E4C4225F2B8600EC0609 /* demo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
8BC2E4BC225F2B8600EC0609 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1020;
TargetAttributes = {
8BC2E4C3225F2B8600EC0609 = {
CreatedOnToolsVersion = 10.2;
};
};
binary = binary;
};
buildConfigurationList = 8BC2E4BF225F2B8600EC0609 /* Build configuration list for PBXProject "demo" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 8BC2E4BB225F2B8600EC0609;
productRefGroup = 8BC2E4C5225F2B8600EC0609 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8BC2E4C3225F2B8600EC0609 /* demo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8BC2E4C2225F2B8600EC0609 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8BC2E4D2225F2B8700EC0609 /* LaunchScreen.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
27E132FE722A29856F619A3D /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh",
"${PODS_ROOT}/Masonry/Masonry.framework",
"${PODS_ROOT}/Masonry/Masonry.framework.dSYM",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework",
"${DWARF_DSYM_FOLDER_PATH}/Masonry.framework.dSYM",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-demo/Pods-demo-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
4A7278B702427200DBDC45CB /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-demo-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8BC2E4C0225F2B8600EC0609 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8BC2E4CA225F2B8600EC0609 /* ViewController.swift in Sources */,
8BC2E4C8225F2B8600EC0609 /* AppDelegate.swift in Sources */,
2E1AEA2ADE0B2C6D0E8CB73C /* BDWebImage_demo.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
8BC2E4D0225F2B8700EC0609 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
8BC2E4D1225F2B8700EC0609 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
8BC2E4DF225F2B8800EC0609 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
8BC2E4E0225F2B8800EC0609 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
8BC2E4E2225F2B8800EC0609 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = F8A8B289BFEAE54B0D540472 /* Pods-demo.debug.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = demo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.leavez.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
8BC2E4E3225F2B8800EC0609 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E9C2707150376AA5D63E8BAE /* Pods-demo.release.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = demo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = me.leavez.demo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
8BC2E4BF225F2B8600EC0609 /* Build configuration list for PBXProject "demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8BC2E4DF225F2B8800EC0609 /* Debug */,
8BC2E4E0225F2B8800EC0609 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8BC2E4E1225F2B8800EC0609 /* Build configuration list for PBXNativeTarget "demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8BC2E4E2225F2B8800EC0609 /* Debug */,
8BC2E4E3225F2B8800EC0609 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 8BC2E4BC225F2B8600EC0609 /* Project object */;
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:demo.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,53 @@
//
// AppDelegate.swift
// demo
//
// Created by Leavez on 2019/04/16.
// Copyright © 2019 binary. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let viewController = ViewController(nibName: nil, bundle: nil)
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = viewController
self.window = window
window.makeKeyAndVisible()
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>

43
demo/demo/Info.plist Normal file
View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -0,0 +1,21 @@
//
// ViewController.swift
// demo
//
// Created by Leavez on 2019/04/16.
// Copyright © 2019 binary. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
view.backgroundColor = .white
}
}

View File

@ -0,0 +1,16 @@
// this is a demo for usage
#import <UIKit/UIKit.h>
#import <Masonry/Masonry.h>
void masonry_demo() {
UIView *parent_view = [UIView new];
UIView *view1 = [UIView new];
[parent_view addSubview:view1];
[view1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
}

View File

@ -24,6 +24,32 @@ module Pod
DSL.dont_remove_source_code = true
end
# Add custom xcodebuild option to the prebuiling aciton
#
# You may use this for your special demands. For example: the default archs in dSYMs
# of prebuilt frameworks is 'arm64 armv7 x86_64', and no 'i386' for 32bit simulator.
# It may generate a warning when building for a 32bit simulator. You may add following
# to your podfile
#
# ` set_custom_xcodebuild_options_for_prebuilt_frameworks :simulator => "ARCHS=$(ARCHS_STANDARD)" `
#
# @options String or Hash
#
# If is a String, it will apply for device and simulator. Use it just like in the commandline.
# If is a Hash, it should be like this: { :device => "XXXXX", :simulator => "XXXXX" }
#
def set_custom_xcodebuild_options_for_prebuilt_frameworks(options)
if options.kind_of? Hash
DSL.custom_build_options = [ options[:device] ] unless options[:device].nil?
DSL.custom_build_options_simulator = [ options[:simulator] ] unless options[:simulator].nil?
elsif options.kind_of? String
DSL.custom_build_options = [options]
DSL.custom_build_options_simulator = [options]
else
raise "Wrong type."
end
end
private
class_attr_accessor :prebuild_all
prebuild_all = false
@ -33,6 +59,11 @@ module Pod
class_attr_accessor :dont_remove_source_code
dont_remove_source_code = false
class_attr_accessor :custom_build_options
class_attr_accessor :custom_build_options_simulator
self.custom_build_options = []
self.custom_build_options_simulator = []
end
end
end

View File

@ -120,13 +120,26 @@ module Pod
output_path = sandbox.framework_folder_path_for_pod_name(target.name)
output_path.mkpath unless output_path.exist?
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled)
Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)
# save the resource paths for later installing
if target.static_framework? and !target.resource_paths.empty?
framework_path = output_path + target.framework_name
standard_sandbox_path = sandbox.standard_sanbox_path
path_objects = target.resource_paths.map do |path|
resources = begin
if Pod::VERSION.start_with? "1.5"
target.resource_paths
else
# resource_paths is Hash{String=>Array<String>} on 1.6 and above
# (use AFNetworking to generate a demo data)
# https://github.com/leavez/cocoapods-binary/issues/50
target.resource_paths.values.flatten
end
end
raise "Wrong type: #{resources}" unless resources.kind_of? Array
path_objects = resources.map do |path|
object = Prebuild::Passer::ResourcePath.new
object.real_file_path = framework_path + File.basename(path)
object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'

View File

@ -1,3 +1,3 @@
module CocoapodsBinary
VERSION = "0.4.2"
VERSION = "0.4.3"
end

View File

@ -1,4 +1,5 @@
require 'fourflusher'
require 'xcpretty'
CONFIGURATION = "Release"
PLATFORMS = { 'iphonesimulator' => 'iOS',
@ -15,7 +16,10 @@ def build_for_iosish_platform(sandbox,
target,
device,
simulator,
bitcode_enabled)
bitcode_enabled,
custom_build_options = [], # Array<String>
custom_build_options_simulator = [] # Array<String>
)
deployment_target = target.platform.deployment_target.to_s
@ -26,47 +30,77 @@ def build_for_iosish_platform(sandbox,
if bitcode_enabled
other_options += ['BITCODE_GENERATION_MODE=bitcode']
end
xcodebuild(sandbox, target_label, device, deployment_target, other_options)
xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])
is_succeed, _ = xcodebuild(sandbox, target_label, device, deployment_target, other_options + custom_build_options)
exit 1 unless is_succeed
is_succeed, _ = xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'] + custom_build_options_simulator)
exit 1 unless is_succeed
# paths
root_name = target.pod_name
module_name = target.product_module_name
device_framwork_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{module_name}.framework"
simulator_framwork_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{module_name}.framework"
device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{root_name}/#{module_name}.framework"
simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{root_name}/#{module_name}.framework"
device_binary = device_framwork_path + "/#{module_name}"
simulator_binary = simulator_framwork_path + "/#{module_name}"
device_binary = device_framework_path + "/#{module_name}"
simulator_binary = simulator_framework_path + "/#{module_name}"
return unless File.file?(device_binary) && File.file?(simulator_binary)
# the device_lib path is the final output file path
# combine the bianries
# combine the binaries
tmp_lipoed_binary_path = "#{build_dir}/#{root_name}"
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}`
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true
# collect the swiftmodule file for various archs.
device_swiftmodule_path = device_framwork_path + "/Modules/#{module_name}.swiftmodule"
simulator_swiftmodule_path = simulator_framwork_path + "/Modules/#{module_name}.swiftmodule"
device_swiftmodule_path = device_framework_path + "/Modules/#{module_name}.swiftmodule"
simulator_swiftmodule_path = simulator_framework_path + "/Modules/#{module_name}.swiftmodule"
if File.exist?(device_swiftmodule_path)
FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
end
# combine the generated swift headers
# (In xcode 10.2, the generated swift headers vary for each archs)
# https://github.com/leavez/cocoapods-binary/issues/58
simulator_generated_swift_header_path = simulator_framework_path + "/Headers/#{module_name}-Swift.h"
device_generated_swift_header_path = device_framework_path + "/Headers/#{module_name}-Swift.h"
if File.exist? simulator_generated_swift_header_path
device_header = File.read(device_generated_swift_header_path)
simulator_header = File.read(simulator_generated_swift_header_path)
# https://github.com/Carthage/Carthage/issues/2718#issuecomment-473870461
combined_header_content = %Q{
#if TARGET_OS_SIMULATOR // merged by cocoapods-binary
#{simulator_header}
#else // merged by cocoapods-binary
#{device_header}
#endif // merged by cocoapods-binary
}
File.write(device_generated_swift_header_path, combined_header_content.strip)
end
# handle the dSYM files
device_dsym = "#{device_framwork_path}.dSYM"
device_dsym = "#{device_framework_path}.dSYM"
if File.exist? device_dsym
# lipo the simulator dsym
tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}`
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
FileUtils.mv tmp_lipoed_binary_path, "#{device_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
simulator_dsym = "#{simulator_framework_path}.dSYM"
if File.exist? simulator_dsym
tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}`
puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
end
# move
FileUtils.mv device_dsym, output_path, :force => true
end
# output
output_path.mkpath unless output_path.exist?
FileUtils.mv device_framwork_path, output_path, :force => true
FileUtils.mv device_framework_path, output_path, :force => true
end
@ -75,7 +109,23 @@ def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_optio
platform = PLATFORMS[sdk]
args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil?
args += other_options
Pod::Executable.execute_command 'xcodebuild', args, true
log = `xcodebuild #{args.join(" ")} 2>&1`
exit_code = $?.exitstatus # Process::Status
is_succeed = (exit_code == 0)
if !is_succeed
begin
# 64 represent command invalid. http://www.manpagez.com/man/3/sysexits/
raise "shouldn't be handle by xcpretty" if exit_code == 64
printer = XCPretty::Printer.new({:formatter => XCPretty::Simple, :colorize => 'auto'})
log.each_line do |line|
printer.pretty_print(line)
end
rescue
puts log
end
end
[is_succeed, log]
end
@ -94,7 +144,7 @@ module Pod
# [Pathname] output_path
# output path for generated frameworks
#
def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false)
def self.build(sandbox_root_path, target, output_path, bitcode_enabled = false, custom_build_options=[], custom_build_options_simulator=[])
return unless not target == nil
@ -104,8 +154,8 @@ module Pod
# -- build the framework
case target.platform.name
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled)
when :osx then xcodebuild(sandbox, target.label)
when :ios then build_for_iosish_platform(sandbox, build_dir, output_path, target, 'iphoneos', 'iphonesimulator', bitcode_enabled, custom_build_options, custom_build_options_simulator)
when :osx then xcodebuild(sandbox, target.label, 'macosx', nil, custom_build_options)
# when :tvos then build_for_iosish_platform(sandbox, build_dir, target, 'appletvos', 'appletvsimulator')
# when :watchos then build_for_iosish_platform(sandbox, build_dir, target, 'watchos', 'watchsimulator')
else raise "Unsupported platform for '#{target.name}': '#{target.platform.name}'" end