Commit 57ec4645 authored by Fabio Pelosin's avatar Fabio Pelosin

[Installer] Call per install hooks before cleaning

parent c9105e1b
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
###### Bug fixes ###### Bug fixes
- Pre install hooks are called before the Pods are cleaned.
- Fixed and issue which prevent the inclusion of OTHER_CFLAGS and - Fixed and issue which prevent the inclusion of OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS in the release builds of the Pods project. OTHER_CPLUSPLUSFLAGS in the release builds of the Pods project.
......
...@@ -26,6 +26,8 @@ module Pod ...@@ -26,6 +26,8 @@ module Pod
# @return [Pod::Project] the `Pods/Pods.xcodeproj` project. # @return [Pod::Project] the `Pods/Pods.xcodeproj` project.
# #
# @note This value is not yet set in the pre install callbacks.
#
def project def project
installer.pods_project installer.pods_project
end end
......
...@@ -18,6 +18,12 @@ module Pod ...@@ -18,6 +18,12 @@ module Pod
target_definition.dependencies target_definition.dependencies
end end
# @return [Pathname] The path of the Pods dir.
#
def sandbox_dir
sandbox.root
end
# @return [Pathname] The path of the prefix_header # @return [Pathname] The path of the prefix_header
# #
def prefix_header_filename def prefix_header_filename
......
...@@ -99,13 +99,14 @@ module Pod ...@@ -99,13 +99,14 @@ module Pod
UI.section "Downloading dependencies" do UI.section "Downloading dependencies" do
create_file_accessors create_file_accessors
install_pod_sources install_pod_sources
run_pre_install_hooks
clean_pod_sources
end end
end end
def generate_pods_project def generate_pods_project
UI.section "Generating Pods project" do UI.section "Generating Pods project" do
prepare_pods_project prepare_pods_project
run_pre_install_hooks
install_file_references install_file_references
install_targets install_targets
run_post_install_hooks run_post_install_hooks
...@@ -240,15 +241,24 @@ module Pod ...@@ -240,15 +241,24 @@ module Pod
end end
end end
@pod_installers ||= []
pod_installer = PodSourceInstaller.new(sandbox, specs_by_platform) pod_installer = PodSourceInstaller.new(sandbox, specs_by_platform)
pod_installer.clean = config.clean? pod_installer.clean = config.clean?
pod_installer.aggressive_cache = config.aggressive_cache? pod_installer.aggressive_cache = config.aggressive_cache?
pod_installer.generate_docs = config.generate_docs? pod_installer.generate_docs = config.generate_docs?
pod_installer.install_docs = config.install_docs? pod_installer.install_docs = config.install_docs?
pod_installer.install! pod_installer.install!
@pod_installers << pod_installer
@installed_specs.concat(specs_by_platform.values.flatten) @installed_specs.concat(specs_by_platform.values.flatten)
end end
def clean_pod_sources
return unless @pod_installers
@pod_installers.each do |pod_installer|
pod_installer.clean!
end
end
# Creates the Pods project from scratch if it doesn't exists. # Creates the Pods project from scratch if it doesn't exists.
# #
# @return [void] # @return [void]
......
...@@ -82,6 +82,16 @@ module Pod ...@@ -82,6 +82,16 @@ module Pod
def install! def install!
download_source unless predownloaded? || local? download_source unless predownloaded? || local?
generate_docs if generate_docs? generate_docs if generate_docs?
end
# Cleans the installations if appropriate.
#
# @todo As the pre install hooks need to run before cleaning this
# method should be refactored.
#
# @return [void]
#
def clean!
clean_installation if clean? && !local? clean_installation if clean? && !local?
end end
......
...@@ -49,7 +49,9 @@ Targets: ...@@ -49,7 +49,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -60,7 +62,9 @@ Targets: ...@@ -60,7 +62,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -32,10 +32,10 @@ Downloading dependencies ...@@ -32,10 +32,10 @@ Downloading dependencies
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
-> Using Reachability (3.1.0) -> Using Reachability (3.1.0)
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -47,7 +47,9 @@ Targets: ...@@ -47,7 +47,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -58,7 +60,9 @@ Targets: ...@@ -58,7 +60,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -20,10 +20,10 @@ Comparing resolved specification to the sandbox manifest ...@@ -20,10 +20,10 @@ Comparing resolved specification to the sandbox manifest
Downloading dependencies Downloading dependencies
-> Installing PodTest (1.0) -> Installing PodTest (1.0)
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -42,7 +42,9 @@ Targets: ...@@ -42,7 +42,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -53,7 +55,9 @@ Targets: ...@@ -53,7 +55,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -14,10 +14,10 @@ Comparing resolved specification to the sandbox manifest ...@@ -14,10 +14,10 @@ Comparing resolved specification to the sandbox manifest
Downloading dependencies Downloading dependencies
-> Installing Reachability (3.1.0) -> Installing Reachability (3.1.0)
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -64,7 +64,9 @@ Targets: ...@@ -64,7 +64,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -75,7 +77,9 @@ Targets: ...@@ -75,7 +77,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
...@@ -127,7 +131,9 @@ Targets: ...@@ -127,7 +131,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -138,7 +144,9 @@ Targets: ...@@ -138,7 +144,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods-SampleApp_2.xcconfig Base Configuration: Pods-SampleApp_2.xcconfig
- Debug: - Debug:
...@@ -187,7 +195,9 @@ Targets: ...@@ -187,7 +195,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -198,7 +208,9 @@ Targets: ...@@ -198,7 +208,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods-test.xcconfig Base Configuration: Pods-test.xcconfig
- Debug: - Debug:
......
...@@ -50,10 +50,10 @@ Downloading dependencies ...@@ -50,10 +50,10 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -43,7 +43,9 @@ Targets: ...@@ -43,7 +43,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -54,7 +56,9 @@ Targets: ...@@ -54,7 +56,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -29,10 +29,10 @@ Downloading dependencies ...@@ -29,10 +29,10 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -44,7 +44,9 @@ Targets: ...@@ -44,7 +44,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -53,7 +55,9 @@ Targets: ...@@ -53,7 +55,9 @@ Targets:
PRODUCT_NAME: $(TARGET_NAME) PRODUCT_NAME: $(TARGET_NAME)
IPHONEOS_DEPLOYMENT_TARGET: '6.0' IPHONEOS_DEPLOYMENT_TARGET: '6.0'
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
......
...@@ -29,11 +29,11 @@ Downloading dependencies ...@@ -29,11 +29,11 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
- Podfile
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Podfile
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -42,7 +42,9 @@ Targets: ...@@ -42,7 +42,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -53,7 +55,9 @@ Targets: ...@@ -53,7 +55,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -32,10 +32,10 @@ Downloading dependencies ...@@ -32,10 +32,10 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -43,7 +43,9 @@ Targets: ...@@ -43,7 +43,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -54,7 +56,9 @@ Targets: ...@@ -54,7 +56,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -18,10 +18,10 @@ Comparing resolved specification to the sandbox manifest ...@@ -18,10 +18,10 @@ Comparing resolved specification to the sandbox manifest
Downloading dependencies Downloading dependencies
-> Using Reachability (3.1.0) -> Using Reachability (3.1.0)
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -9,6 +9,6 @@ EXTERNAL SOURCES: ...@@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:podspec: Reachability.podspec :podspec: Reachability.podspec
SPEC CHECKSUMS: SPEC CHECKSUMS:
Reachability: fc385e96bfc6d73ff55de863145498352d1c12ea Reachability: c1e48cc25f8e7cba878c83ad1981d334ef325522
COCOAPODS: 0.17.0.rc2 COCOAPODS: 0.17.0.rc2
...@@ -11,7 +11,6 @@ Pod::Spec.new do |s| ...@@ -11,7 +11,6 @@ Pod::Spec.new do |s|
s.requires_arc = false s.requires_arc = false
def s.pre_install(pod, target_definition) def s.pre_install(pod, target_definition)
# Replace strings in existing files # Replace strings in existing files
pod.source_files.each do |file| pod.source_files.each do |file|
replaced = file.read.gsub("kReachabilityChangedNotification", "kTEST") replaced = file.read.gsub("kReachabilityChangedNotification", "kTEST")
...@@ -21,13 +20,10 @@ Pod::Spec.new do |s| ...@@ -21,13 +20,10 @@ Pod::Spec.new do |s|
# Add new files # Add new files
File.open(pod.root + "TestClass.h", 'w') { |file| file.write("// TEST") } File.open(pod.root + "TestClass.h", 'w') { |file| file.write("// TEST") }
File.open(pod.root + "TestClass.m", 'w') { |file| file.write("// TEST") } File.open(pod.root + "TestClass.m", 'w') { |file| file.write("// TEST") }
dependencies = target_definition.dependencies.map(&:to_s) * ", "
File.open(pod.root + "DependenciesList.txt", 'w') { |file| file.write(dependencies) }
end end
def s.post_install(target) def s.post_install(library)
dependencies = library.dependencies.map(&:to_s) * ", "
File.open(library.sandbox_dir + "DependenciesList.txt", 'w') { |file| file.write(dependencies) }
end end
end end
...@@ -9,6 +9,6 @@ EXTERNAL SOURCES: ...@@ -9,6 +9,6 @@ EXTERNAL SOURCES:
:podspec: Reachability.podspec :podspec: Reachability.podspec
SPEC CHECKSUMS: SPEC CHECKSUMS:
Reachability: fc385e96bfc6d73ff55de863145498352d1c12ea Reachability: c1e48cc25f8e7cba878c83ad1981d334ef325522
COCOAPODS: 0.17.0.rc2 COCOAPODS: 0.17.0.rc2
...@@ -46,7 +46,9 @@ Targets: ...@@ -46,7 +46,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -57,7 +59,9 @@ Targets: ...@@ -57,7 +59,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -32,11 +32,11 @@ Downloading dependencies ...@@ -32,11 +32,11 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
- Reachability
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Reachability
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -11,7 +11,6 @@ Pod::Spec.new do |s| ...@@ -11,7 +11,6 @@ Pod::Spec.new do |s|
s.requires_arc = false s.requires_arc = false
def s.pre_install(pod, target_definition) def s.pre_install(pod, target_definition)
# Replace strings in existing files # Replace strings in existing files
pod.source_files.each do |file| pod.source_files.each do |file|
replaced = file.read.gsub("kReachabilityChangedNotification", "kTEST") replaced = file.read.gsub("kReachabilityChangedNotification", "kTEST")
...@@ -21,13 +20,10 @@ Pod::Spec.new do |s| ...@@ -21,13 +20,10 @@ Pod::Spec.new do |s|
# Add new files # Add new files
File.open(pod.root + "TestClass.h", 'w') { |file| file.write("// TEST") } File.open(pod.root + "TestClass.h", 'w') { |file| file.write("// TEST") }
File.open(pod.root + "TestClass.m", 'w') { |file| file.write("// TEST") } File.open(pod.root + "TestClass.m", 'w') { |file| file.write("// TEST") }
dependencies = target_definition.dependencies.map(&:to_s) * ", "
File.open(pod.root + "DependenciesList.txt", 'w') { |file| file.write(dependencies) }
end end
def s.post_install(target) def s.post_install(library)
dependencies = library.dependencies.map(&:to_s) * ", "
File.open(library.sandbox_dir + "DependenciesList.txt", 'w') { |file| file.write(dependencies) }
end end
end end
...@@ -55,7 +55,9 @@ Targets: ...@@ -55,7 +55,9 @@ Targets:
DEBUG_INFORMATION_FORMAT: dwarf-with-dsym DEBUG_INFORMATION_FORMAT: dwarf-with-dsym
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
COPY_PHASE_STRIP: 'YES' COPY_PHASE_STRIP: 'YES'
...@@ -63,7 +65,9 @@ Targets: ...@@ -63,7 +65,9 @@ Targets:
SDKROOT: macosx SDKROOT: macosx
PRODUCT_NAME: $(TARGET_NAME) PRODUCT_NAME: $(TARGET_NAME)
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
ARCHS: $(ARCHS_STANDARD_64_BIT) ARCHS: $(ARCHS_STANDARD_64_BIT)
GCC_ENABLE_OBJC_EXCEPTIONS: 'YES' GCC_ENABLE_OBJC_EXCEPTIONS: 'YES'
...@@ -117,7 +121,9 @@ Targets: ...@@ -117,7 +121,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -128,7 +134,9 @@ Targets: ...@@ -128,7 +134,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods-iOS App.xcconfig Base Configuration: Pods-iOS App.xcconfig
- Debug: - Debug:
......
...@@ -26,10 +26,10 @@ Comparing resolved specification to the sandbox manifest ...@@ -26,10 +26,10 @@ Comparing resolved specification to the sandbox manifest
Downloading dependencies Downloading dependencies
-> Installing PodTest (1.0) -> Installing PodTest (1.0)
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -43,7 +43,9 @@ Targets: ...@@ -43,7 +43,9 @@ Targets:
PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS} PODS_HEADERS_SEARCH_PATHS: ${PODS_BUILD_HEADERS_SEARCH_PATHS}
GCC_C_LANGUAGE_STANDARD: gnu99 GCC_C_LANGUAGE_STANDARD: gnu99
OTHER_LDFLAGS: '' OTHER_LDFLAGS: ''
OTHER_CFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
GCC_VERSION: com.apple.compilers.llvm.clang.1_0 GCC_VERSION: com.apple.compilers.llvm.clang.1_0
ALWAYS_SEARCH_USER_PATHS: 'NO' ALWAYS_SEARCH_USER_PATHS: 'NO'
SDKROOT: iphoneos SDKROOT: iphoneos
...@@ -54,7 +56,9 @@ Targets: ...@@ -54,7 +56,9 @@ Targets:
INSTALL_PATH: $(BUILT_PRODUCTS_DIR) INSTALL_PATH: $(BUILT_PRODUCTS_DIR)
SKIP_INSTALL: 'YES' SKIP_INSTALL: 'YES'
PODS_ROOT: ${SRCROOT} PODS_ROOT: ${SRCROOT}
OTHER_CPLUSPLUSFLAGS: -DNS_BLOCK_ASSERTIONS=1 OTHER_CPLUSPLUSFLAGS:
- -DNS_BLOCK_ASSERTIONS=1
- $(inherited)
ARCHS: $(ARCHS_STANDARD_32_BIT) ARCHS: $(ARCHS_STANDARD_32_BIT)
Base Configuration: Pods.xcconfig Base Configuration: Pods.xcconfig
- Debug: - Debug:
......
...@@ -32,10 +32,10 @@ Downloading dependencies ...@@ -32,10 +32,10 @@ Downloading dependencies
HEAD is now at f7176f4 updated podspec HEAD is now at f7176f4 updated podspec
$ /usr/bin/git checkout -b activated-pod-commit 2>&1 $ /usr/bin/git checkout -b activated-pod-commit 2>&1
Switched to a new branch 'activated-pod-commit' Switched to a new branch 'activated-pod-commit'
- Running pre install hooks
Generating Pods project Generating Pods project
- Creating Pods project - Creating Pods project
- Running pre install hooks
- Adding source files to Pods project - Adding source files to Pods project
- Adding resources to Pods project - Adding resources to Pods project
- Linking headers - Linking headers
......
...@@ -135,13 +135,13 @@ module Pod ...@@ -135,13 +135,13 @@ module Pod
pod 'SSZipArchive', '0.1.0' pod 'SSZipArchive', '0.1.0'
pre_install do |installer| pre_install do |installer|
memo = "PODS:#{installer.pods * ', '} TARGETS:#{installer.project.targets * ', '}" memo = "PODS:#{installer.pods * ', '} LIBRARIES:#{installer.libraries.map(&:name) * ', '}"
File.open(installer.config.sandbox_root + 'memo.txt', 'w') {|f| f.puts memo} File.open(installer.config.sandbox_root + 'memo.txt', 'w') {|f| f.puts memo}
end end
end end
Installer.new(config.sandbox, podfile).install! Installer.new(config.sandbox, podfile).install!
File.open(config.sandbox_root + 'memo.txt','rb').read.should == "PODS:SSZipArchive (0.1.0) TARGETS:\n" File.open(config.sandbox_root + 'memo.txt','rb').read.should == "PODS:SSZipArchive (0.1.0) LIBRARIES:Pods\n"
end end
#--------------------------------------# #--------------------------------------#
......
...@@ -22,6 +22,10 @@ module Pod ...@@ -22,6 +22,10 @@ module Pod
@rep.dependencies.should == [Dependency.new('AFNetworking')] @rep.dependencies.should == [Dependency.new('AFNetworking')]
end end
it "returns the sandbox dir" do
@rep.sandbox_dir.should == temporary_directory + 'Pods'
end
it "returns the path of the prefix header" do it "returns the path of the prefix header" do
@lib.support_files_root = temporary_directory @lib.support_files_root = temporary_directory
@rep.prefix_header_filename.should == temporary_directory + 'Pods-MyApp-prefix.pch' @rep.prefix_header_filename.should == temporary_directory + 'Pods-MyApp-prefix.pch'
......
...@@ -107,6 +107,7 @@ module Pod ...@@ -107,6 +107,7 @@ module Pod
it "cleans the paths non used by the installation" do it "cleans the paths non used by the installation" do
@installer.clean = true @installer.clean = true
@installer.install! @installer.install!
@installer.clean!
unused_file = config.sandbox.root + 'BananaLib/sub-dir/sub-dir-2/somefile.txt' unused_file = config.sandbox.root + 'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file.should.not.exist unused_file.should.not.exist
end end
...@@ -114,6 +115,7 @@ module Pod ...@@ -114,6 +115,7 @@ module Pod
it "preserves important files like the LICENSE and the README" do it "preserves important files like the LICENSE and the README" do
@installer.clean = true @installer.clean = true
@installer.install! @installer.install!
@installer.clean!
readme_file = config.sandbox.root + 'BananaLib/README' readme_file = config.sandbox.root + 'BananaLib/README'
readme_file.should.exist readme_file.should.exist
end end
...@@ -121,6 +123,7 @@ module Pod ...@@ -121,6 +123,7 @@ module Pod
it "doesn't performs any cleaning if instructed to do so" do it "doesn't performs any cleaning if instructed to do so" do
@installer.clean = false @installer.clean = false
@installer.install! @installer.install!
@installer.clean!
unused_file = config.sandbox.root + 'BananaLib/sub-dir/sub-dir-2/somefile.txt' unused_file = config.sandbox.root + 'BananaLib/sub-dir/sub-dir-2/somefile.txt'
unused_file.should.exist unused_file.should.exist
end end
......
...@@ -44,17 +44,14 @@ module Pod ...@@ -44,17 +44,14 @@ module Pod
@installer.stubs(:integrate_user_project) @installer.stubs(:integrate_user_project)
end end
it "in runs the pre-install hooks before adding the file references" do it "in runs the pre-install hooks before cleaning the Pod sources" do
@installer.unstub(:generate_pods_project) @installer.unstub(:download_dependencies)
@installer.stubs(:prepare_pods_project) @installer.stubs(:create_file_accessors)
@installer.stubs(:install_targets) @installer.stubs(:install_pod_sources)
@installer.stubs(:run_post_install_hooks)
@installer.stubs(:write_pod_project)
@installer.stubs(:write_lockfiles)
def @installer.run_pre_install_hooks def @installer.run_pre_install_hooks
@hook_called = true @hook_called = true
end end
def @installer.install_file_references def @installer.clean_pod_sources
@hook_called.should.be.true @hook_called.should.be.true
end end
@installer.install! @installer.install!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment