Commit 5f26568f authored by arida's avatar arida

Merge commit '4e3a738e'

parents 4a783738 4e3a738e
......@@ -20,8 +20,8 @@ before_install:
# There is a bug in travis. When using system ruby, bundler is not
# installed and causes the default install action to fail.
- sudo gem install bundler
# RubyGems 2.0.14 isn't a fun time on 2.0.0p645
- if [ "$(ruby -v | cut -d ' ' -f2)" = "2.0.0p645" ]; then sudo gem update --system; fi
# RubyGems 2.0.14 isn't a fun time on 2.0.0p648
- if [ "$(ruby -v | cut -d ' ' -f2)" = "2.0.0p648" ]; then sudo gem update --system; fi
before_script:
- bundle exec pod repo update --silent
......
......@@ -8,19 +8,34 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
* Remove references to the pre-1.0 Migrator.
[Danielle Tomlinson](https://github.com/dantoml)
[#5635](https://github.com/CocoaPods/CocoaPods/pull/5635)
##### Bug Fixes
* Hash scope suffixes if they are over 50 characters to prevent file paths from being too long.
[Danielle Tomlinson](https://github.com/dantoml)
[#5491](https://github.com/CocoaPods/CocoaPods/issues/5491)
## 1.1.0.beta.1 (2016-07-11)
##### Enhancements
* Move Pods Project generation to an `Xcode` Namespace.
[Daniel Tomlinson](https://github.com/dantoml)
[#5480](https://github.com/CocoaPods/CocoaPods/pull/5480)
* Add the ability to inhibit swift warnings.
* Add the ability to inhibit swift warnings.
[Peter Ryszkiewicz](https://github.com/pRizz)
[#5414](https://github.com/CocoaPods/CocoaPods/pull/5414)
* Use `git ls-remote` to skip full clones for branch dependencies.
[Juan Civile](https://github.com/champo)
[#5376](https://github.com/CocoaPods/CocoaPods/issues/5376)
* [repo/push] --use-json to convert podspecs to JSON format when pushing
* [repo/push] --use-json to convert podspecs to JSON format when pushing.
[Mark Schall](https://github.com/maschall)
[#5568](https://github.com/CocoaPods/CocoaPods/pull/5568)
......@@ -32,16 +47,42 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Boris Bügling](https://github.com/neonichu)
[#5558](https://github.com/CocoaPods/CocoaPods/issues/5558)
* Accept `pod repo push` with URL instead of only repo name
* Accept `pod repo push` with URL instead of only repo name.
[Mark Schall](https://github.com/maschall)
[#5572](https://github.com/CocoaPods/CocoaPods/pull/5572)
* [Installer] Set the SWIFT_VERSION for CocoaPods generated targets.
[Danielle Tomlinson](https://github.com/DanToml)
[#5540](https://github.com/CocoaPods/CocoaPods/pulls/5540)
* Print message when skipping user project integration.
[Danielle Tomlinson](https://github.com/dantoml)
[#5517](https://github.com/CocoaPods/CocoaPods/issues/5517)
* Show GitHub Issues that could be related to exceptions.
[Orta Therox](https://github.com/orta)
[#4817](https://github.com/CocoaPods/CocoaPods/issues/4817)
* Improve handling of app extensions, watch os 1 extensions
and framework targets.
[benasher44](https://github.com/benasher44)
[#4203](https://github.com/CocoaPods/CocoaPods/issues/4203)
* Add a license type to generated acknowledgements file in plist.
[Naoto Kaneko](https://github.com/naoty)
[#5436](https://github.com/CocoaPods/CocoaPods/pull/5436)
##### Bug Fixes
* Fix local pod platform conflict error message.
[Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
[#5052](https://github.com/CocoaPods/CocoaPods/issues/5052)
* Avoid use of `activesupport` version 5 to stay compatible with macOS system
Ruby.
[Boris Bügling](https://github.com/neonichu)
[#5602](https://github.com/CocoaPods/CocoaPods/issues/5602)
* Fix installing pods with `use_frameworks` when deduplication is disabled.
[Samuel Giddins](https://github.com/segiddins)
[#5481](https://github.com/CocoaPods/CocoaPods/issues/5481)
......@@ -54,7 +95,8 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#5321](https://github.com/CocoaPods/CocoaPods/issues/5321)
* Use `require` instead of `autoload` to solve an issue with loading `fourflusher`.
* Use `require` instead of `autoload` to solve an issue with loading
`fourflusher`.
[Boris Bügling](https://github.com/neonichu)
[#5445](https://github.com/CocoaPods/CocoaPods/issues/5445)
......@@ -74,6 +116,19 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Boris Bügling](https://github.com/neonichu)
[#5529](https://github.com/CocoaPods/CocoaPods/issues/5529)
* Fix linting with Xcode 8 by disabling it entirely.
[Boris Bügling](https://github.com/neonichu)
[#5528](https://github.com/CocoaPods/CocoaPods/issues/5528)
* Error during install when there are duplicate library names.
[Daniel Tomlinson](https://github.com/dantoml)
[#4014](https://github.com/CocoaPods/CocoaPods/issues/4014)
* Make the `Check Pods Manifest.lock` script write errors to STDERR and improve
POSIX shell compatibility.
[Simon Warta](https://github.com/webmaster128)
[#5595](https://github.com/CocoaPods/CocoaPods/pull/5595)
## 1.0.1 (2016-06-02)
......
# Don't let testing shortcuts get into master by accident
(modified_files + added_files - %w(Dangerfile)).each do |file|
# Don't let testing shortcuts get into master by accident,
# ensuring that we don't get green builds based on a subset of tests
(git.modified_files + git.added_files - %w(Dangerfile)).each do |file|
next unless File.file?(file)
contents = File.read(file)
if file.start_with?('spec')
......@@ -10,14 +10,14 @@
end
# Ensure a clean commits history
if commits.any? { |c| c.message =~ /^Merge branch '#{branch_for_merge}'/ }
if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
fail('Please rebase to get rid of the merge commits in this PR')
end
# Request a CHANGELOG entry, and give an example
has_app_changes = !modified_files.grep(/lib/).empty?
if !modified_files.include?('CHANGELOG.md') && has_app_changes
fail('Please include a CHANGELOG entry to credit yourself! \nYou can find it at [CHANGELOG.md](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md).', :sticky => false)
has_app_changes = !git.modified_files.grep(/lib/).empty?
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
fail("Please include a CHANGELOG entry to credit yourself! \nYou can find it at [CHANGELOG.md](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md).", :sticky => false)
markdown <<-MARKDOWN
Here's an example of your CHANGELOG entry:
......
......@@ -7,10 +7,10 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision: 628a2e908dff578db6e59b1ac6aec99b6f45cb95
revision: db99f5e8b9385473539405a31c4a7ba3790d47f7
branch: master
specs:
cocoapods-core (1.0.1)
cocoapods-core (1.1.0.beta.1)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
......@@ -24,10 +24,10 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 1b15f4c79303843e8f370afa9dd74b8ad0329785
revision: d3b9b2a2f99fab532c46c1a1fa753edcdc7334c3
branch: master
specs:
xcodeproj (1.1.0)
xcodeproj (1.2.0)
activesupport (>= 3)
claide (>= 1.0.0, < 2.0)
colored (~> 1.2)
......@@ -41,14 +41,14 @@ GIT
GIT
remote: https://github.com/CocoaPods/cocoapods-downloader.git
revision: 0803d2280c14347e03cc5753efdca04e3697552c
revision: 1932ea3f6178f588a9932ea80eae96f6a730c78e
branch: master
specs:
cocoapods-downloader (1.0.0)
cocoapods-downloader (1.1.0)
GIT
remote: https://github.com/CocoaPods/cocoapods-plugins.git
revision: 6f7c1c99c6494795e49127bb1fef12f04e0f405f
revision: 710a63c7247e6c55aa62436e2cc659adebc01cef
branch: master
specs:
cocoapods-plugins (1.0.0)
......@@ -79,14 +79,14 @@ GIT
GIT
remote: https://github.com/CocoaPods/cocoapods-try.git
revision: 590fb5aeeda3871861d2c4c3580eee65463a225f
revision: 2c0840a6ba64056931622abc1d11479ffcc4a31b
branch: master
specs:
cocoapods-try (1.0.0)
cocoapods-try (1.1.0)
GIT
remote: https://github.com/segiddins/json.git
revision: d4011cabfaa80e9b0da81947b5e9b38dd47359db
revision: a9588bc4334c2f5bf985f255b61c05eafdcd8907
branch: seg-1.7.7-ruby-2.2
specs:
json (1.7.7)
......@@ -94,23 +94,24 @@ GIT
PATH
remote: .
specs:
cocoapods (1.0.1)
activesupport (>= 4.0.2)
cocoapods (1.1.0.beta.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.0, < 2.0)
cocoapods-core (= 1.0.1)
cocoapods-core (= 1.1.0.beta.1)
cocoapods-deintegrate (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.0.0, < 2.0)
cocoapods-downloader (>= 1.1.0, < 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.0.0, < 2.0)
cocoapods-try (>= 1.0.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
fourflusher (~> 1.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.0)
nap (~> 1.0)
xcodeproj (>= 1.1.0, < 2.0)
xcodeproj (>= 1.2.0, < 2.0)
GEM
remote: https://rubygems.org/
......@@ -125,6 +126,10 @@ GEM
ast (2.2.0)
awesome_print (1.6.1)
bacon (1.2.0)
claide-plugins (0.9.0)
cork (~> 0)
nap (~> 1.0)
open4 (~> 1.3)
clintegracon (0.8.1)
colored (~> 1.2)
diffy
......@@ -134,13 +139,18 @@ GEM
pry (= 0.10.3)
coderay (1.1.0)
colored (1.2)
cork (0.1.0)
colored (~> 1.2)
crack (0.4.2)
safe_yaml (~> 1.0.0)
danger (0.7.4)
claide
danger (0.10.0)
claide (~> 1.0)
claide-plugins (~> 0.9)
colored (~> 1.2)
faraday
git
cork (~> 0.1)
faraday (~> 0)
faraday-http-cache (~> 1.0)
git (~> 1)
octokit (~> 4.2)
redcarpet (~> 3.3)
terminal-table (~> 1)
......@@ -148,9 +158,12 @@ GEM
escape (0.0.4)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.0)
faraday (~> 0.8)
ffi (1.9.6)
fourflusher (1.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.2)
git (1.3.0)
i18n (0.7.0)
inch (0.7.0)
......@@ -181,6 +194,7 @@ GEM
notify (0.5.2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
open4 (1.3.4)
parser (2.3.0.6)
ast (~> 2.2)
powerpack (0.1.1)
......@@ -215,7 +229,7 @@ GEM
sparkr (0.4.1)
term-ansicolor (1.3.2)
tins (~> 1.0)
terminal-table (1.5.2)
terminal-table (1.6.0)
thread_safe (0.3.5)
tins (1.8.1)
tzinfo (1.2.2)
......
......@@ -31,19 +31,21 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'claide', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-deintegrate', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-downloader', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-downloader', '>= 1.1.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-plugins', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-search', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-stats', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-trunk', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-try', '>= 1.0.0', '< 2.0'
s.add_runtime_dependency 'cocoapods-try', '>= 1.1.0', '< 2.0'
s.add_runtime_dependency 'molinillo', '~> 0.5.0'
s.add_runtime_dependency 'xcodeproj', '>= 1.1.0', '< 2.0'
s.add_runtime_dependency 'xcodeproj', '>= 1.2.0', '< 2.0'
s.add_runtime_dependency 'activesupport', '>= 4.0.2'
## Version 5 needs Ruby 2.2, so we specify an upper bound to stay compatible with system ruby
s.add_runtime_dependency 'activesupport', '>= 4.0.2', '< 5'
s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'fourflusher', '~> 1.0.1'
s.add_runtime_dependency 'gh_inspector', '~> 1.0'
s.add_runtime_dependency 'nap', '~> 1.0'
s.add_development_dependency 'bacon', '~> 1.1'
......
......@@ -214,7 +214,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
CC1632E381344B54BA63986B /* [CP] Copy Pods Resources */ = {
......
......@@ -326,7 +326,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
......
......@@ -196,7 +196,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
B81850C1CB84CCCCFC8FFC52 /* [CP] Copy Pods Resources */ = {
......
......@@ -174,7 +174,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
6E2B4891468DB661A63F8065 /* [CP] Embed Pods Frameworks */ = {
......
......@@ -179,7 +179,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -194,12 +194,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
E1D153F1317B0ED8A0A98DE0 /* [CP] Embed Pods Frameworks */ = {
......@@ -209,7 +209,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -252,12 +252,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
23FBFF6CF467540E5F102610 /* [CP] Copy Pods Resources */ = {
......@@ -267,7 +267,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -282,7 +282,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -297,7 +297,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -312,7 +312,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -327,12 +327,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
......
......@@ -165,12 +165,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
4697BF2DD055B93C3DE0E375 /* [CP] Embed Pods Frameworks */ = {
......@@ -180,7 +180,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -195,7 +195,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -335,7 +335,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -350,12 +350,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
766BB1279F3F20E30F8D82AC /* [CP] Embed Pods Frameworks */ = {
......@@ -365,7 +365,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -380,12 +380,12 @@
);
inputPaths = (
);
name = '[CP] Check Pods Manifest.lock';
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
9404B5E651690A16E40B8F95 /* [CP] Copy Pods Resources */ = {
......@@ -395,7 +395,7 @@
);
inputPaths = (
);
name = '[CP] Copy Pods Resources';
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -410,7 +410,7 @@
);
inputPaths = (
);
name = '[CP] Embed Pods Frameworks';
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -62,6 +62,7 @@ module Pod
else
if ENV['COCOA_PODS_ENV'] != 'development'
puts UI::ErrorReport.report(exception)
UI::ErrorReport.search_for_exceptions(exception)
exit 1
else
raise exception
......
module Pod
# The version of the CocoaPods command line tool.
#
VERSION = '1.0.1'.freeze unless defined? Pod::VERSION
VERSION = '1.1.0.beta.1'.freeze unless defined? Pod::VERSION
end
......@@ -37,6 +37,7 @@ module Pod
:Type => 'PSGroupSpecifier',
:Title => sanitize_encoding(spec.name),
:FooterText => sanitize_encoding(license),
:License => sanitize_encoding(spec.license[:type]),
}
end
end
......
......@@ -4,7 +4,7 @@ module Pod
# Generates the xcconfigs for the aggregate targets.
#
class AggregateXCConfig
# @return [Target] the target represented by this xcconfig.
# @return [AggregateTarget] the target represented by this xcconfig.
#
attr_reader :target
......@@ -61,7 +61,14 @@ module Pod
'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
}
if pod_targets.any?(&:uses_swift?)
# For embedded targets, which live in a host target, CocoaPods
# copies all of the embedded target's pod_targets its host
# target. Therefore, this check will properly require the Swift
# libs in the host target, if the embedded target has any pod targets
# that use Swift. Setting this for the embedded target would
# cause an App Store rejection because frameworks cannot be embedded
# in embedded targets.
if !target.requires_host_target? && pod_targets.any?(&:uses_swift?)
config['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'YES'
end
@xcconfig = Xcodeproj::Config.new(config)
......
require 'active_support/core_ext/object/try'
module Pod
module Generator
module XCConfig
......
......@@ -34,7 +34,6 @@ module Pod
autoload :PostInstallHooksContext, 'cocoapods/installer/post_install_hooks_context'
autoload :PreInstallHooksContext, 'cocoapods/installer/pre_install_hooks_context'
autoload :SourceProviderHooksContext, 'cocoapods/installer/source_provider_hooks_context'
autoload :Migrator, 'cocoapods/installer/migrator'
autoload :PodfileValidator, 'cocoapods/installer/podfile_validator'
autoload :PodSourceInstaller, 'cocoapods/installer/pod_source_installer'
autoload :PodSourcePreparer, 'cocoapods/installer/pod_source_preparer'
......@@ -110,11 +109,15 @@ module Pod
prepare
resolve_dependencies
download_dependencies
verify_no_duplicate_framework_names
verify_no_duplicate_framework_and_library_names
verify_no_static_framework_transitive_dependencies
verify_framework_usage
generate_pods_project
integrate_user_project if installation_options.integrate_targets?
if installation_options.integrate_targets?
integrate_user_project
else
UI.section 'Skipping User Project Integration'
end
perform_post_install_actions
end
......@@ -129,7 +132,6 @@ module Pod
deintegrate_if_different_major_version
sandbox.prepare
ensure_plugins_are_installed!
Migrator.migrate(sandbox)
run_plugins_pre_install_hooks
end
end
......@@ -389,23 +391,32 @@ module Pod
end
end
def verify_no_duplicate_framework_names
def verify_no_duplicate_framework_and_library_names
aggregate_targets.each do |aggregate_target|
aggregate_target.user_build_configurations.keys.each do |config|
pod_targets = aggregate_target.pod_targets_for_build_configuration(config)
vendored_frameworks = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_frameworks).uniq
frameworks = vendored_frameworks.map { |fw| fw.basename('.framework') }
file_accessors = pod_targets.flat_map(&:file_accessors)
frameworks = file_accessors.flat_map(&:vendored_frameworks).uniq.map(&:basename)
frameworks += pod_targets.select { |pt| pt.should_build? && pt.requires_frameworks? }.map(&:product_module_name)
verify_no_duplicate_names(frameworks, aggregate_target.label, 'frameworks')
duplicates = frameworks.group_by { |f| f }.select { |_, v| v.size > 1 }.keys
unless duplicates.empty?
raise Informative, "The '#{aggregate_target.label}' target has " \
"frameworks with conflicting names: #{duplicates.to_sentence}."
end
libraries = file_accessors.flat_map(&:vendored_libraries).uniq.map(&:basename)
libraries += pod_targets.select { |pt| pt.should_build? && !pt.requires_frameworks? }.map(&:product_name)
verify_no_duplicate_names(libraries, aggregate_target.label, 'libraries')
end
end
end
def verify_no_duplicate_names(names, label, type)
duplicates = names.map { |n| n.to_s.downcase }.group_by { |f| f }.select { |_, v| v.size > 1 }.keys
unless duplicates.empty?
raise Informative, "The '#{label}' target has " \
"#{type} with conflicting names: #{duplicates.to_sentence}."
end
end
def verify_no_static_framework_transitive_dependencies
aggregate_targets.each do |aggregate_target|
next unless aggregate_target.requires_frameworks?
......
......@@ -226,6 +226,61 @@ module Pod
private
# Copies the pod_targets of any of the app embedded aggregate targets into
# their potential host aggregate target, if that potential host aggregate target's
# user_target hosts any of the app embedded aggregate targets' user_targets
#
# @param [AggregateTarget] aggregate_target the aggregate target whose user_target
# might host one or more of the embedded aggregate targets' user_targets
#
# @param [Array<AggregateTarget>] embedded_aggregate_targets the aggregate targets
# representing the embedded targets to be integrated
#
def copy_embedded_target_pod_targets_to_host(aggregate_target, embedded_aggregate_targets)
return if aggregate_target.requires_host_target?
# Get the uuids of the aggregate_target's user_targets' embedded targets if any
embedded_uuids = Set.new(aggregate_target.user_targets.map do |target|
aggregate_target.user_project.embedded_targets_in_native_target(target).map(&:uuid)
end.flatten)
return if embedded_uuids.empty?
embedded_aggregate_targets.each do |embedded_target|
next unless embedded_target.user_targets.map(&:uuid).any? do |embedded_uuid|
embedded_uuids.include? embedded_uuid
end
raise Informative, "#{aggregate_target.name} must call use_frameworks! because it is hosting an embedded target that calls use_frameworks!." unless aggregate_target.requires_frameworks?
pod_target_names = aggregate_target.pod_targets.map(&:name)
# This embedded target is hosted by the aggregate target's user_target; copy over the non-duplicate pod_targets
aggregate_target.pod_targets = aggregate_target.pod_targets + embedded_target.pod_targets.select do |pod_target|
!pod_target_names.include? pod_target.name
end
end
end
# Raises an error if there are embedded targets in the Podfile, but
# their host targets have not been declared in the Podfile
#
# @param [Array<AggregateTarget>] aggregate_targets the generated
# aggregate targets
#
# @param [Array<AggregateTarget>] embedded_aggregate_targets the aggregate targets
# representing the embedded targets to be integrated
#
def verify_host_targets_in_podfile(aggregate_targets, embedded_aggregate_targets)
aggregate_target_uuids = Set.new aggregate_targets.map(&:user_targets).flatten.map(&:uuid)
embedded_targets_missing_hosts = []
embedded_aggregate_targets.each do |target|
host_uuids = target.user_targets.map do |user_target|
target.user_project.host_targets_for_embedded_target(user_target).map(&:uuid)
end.flatten
embedded_targets_missing_hosts << target unless host_uuids.any? do |uuid|
aggregate_target_uuids.include? uuid
end
end
unless embedded_targets_missing_hosts.empty?
raise Informative, "Unable to find host target for #{embedded_targets_missing_hosts.map(&:name).join(', ')}. Please add the host targets for the embedded targets to the Podfile."
end
end
# Creates the models that represent the targets generated by CocoaPods.
#
# @return [Array<AggregateTarget>]
......@@ -236,6 +291,14 @@ module Pod
aggregate_targets = specs_by_target.keys.map do |target_definition|
generate_target(target_definition, pod_targets)
end
if installation_options.integrate_targets?
# Copy embedded target pods that cannot have their pods embedded as frameworks to their host targets
embedded_targets = aggregate_targets.select(&:requires_host_target?).select(&:requires_frameworks?)
verify_host_targets_in_podfile(aggregate_targets, embedded_targets)
aggregate_targets.each do |target|
copy_embedded_target_pod_targets_to_host(target, embedded_targets)
end
end
aggregate_targets.each do |target|
target.search_paths_aggregate_targets = aggregate_targets.select do |aggregate_target|
target.target_definition.targets_to_inherit_search_paths.include?(aggregate_target.target_definition)
......@@ -277,6 +340,7 @@ module Pod
target.pod_targets = pod_targets.select do |pod_target|
pod_target.target_definitions.include?(target_definition)
end
target
end
......@@ -294,7 +358,7 @@ module Pod
distinct_targets = specs_by_target.each_with_object({}) do |dependency, hash|
target_definition, dependent_specs = *dependency
dependent_specs.group_by(&:root).each do |root_spec, specs|
pod_variant = PodVariant.new(specs, target_definition.platform, target_definition.uses_frameworks?)
pod_variant = PodVariant.new(specs, target_definition.platform, target_definition.uses_frameworks?, target_definition.swift_version)
hash[root_spec] ||= {}
(hash[root_spec][pod_variant] ||= []) << target_definition
end
......
......@@ -16,6 +16,10 @@ module Pod
attr_accessor :requires_frameworks
alias_method :requires_frameworks?, :requires_frameworks
# @return [String] the Swift version
#
attr_accessor :swift_version
# @return [Specification] the root specification
#
def root_spec
......@@ -28,10 +32,11 @@ module Pod
# @param [Platform] platform @see #platform
# @param [Bool] requires_frameworks @see #requires_frameworks?
#
def initialize(specs, platform, requires_frameworks = false)
def initialize(specs, platform, requires_frameworks = false, swift_version = nil)
self.specs = specs
self.platform = platform
self.requires_frameworks = requires_frameworks
self.swift_version = swift_version
end
# @return [Bool] whether the {PodVariant} is equal to another taking all
......@@ -41,7 +46,8 @@ module Pod
self.class == other.class &&
specs == other.specs &&
platform == other.platform &&
requires_frameworks == other.requires_frameworks
requires_frameworks == other.requires_frameworks &&
swift_version == other.swift_version
end
alias_method :eql?, :==
......@@ -51,7 +57,7 @@ module Pod
#
# @!visibility private
def hash
[specs, platform, requires_frameworks].hash
[specs, platform, requires_frameworks, swift_version].hash
end
end
end
......
......@@ -23,7 +23,11 @@ module Pod
#
def scope_suffixes
return { variants.first => nil } if variants.count == 1
scope_by_specs
Hash[scope_by_specs.map do |variant, scope|
require 'digest'
scope = Digest::MD5.hexdigest(scope)[0..7] if !scope.nil? && scope.length >= 50
[variant, scope]
end]
end
# Groups the collection by result of the block.
......
......@@ -44,6 +44,7 @@ module Pod
result.platform = compute_platform(targets)
result.archs = compute_archs(targets)
result.project = user_project
result.target_definition.swift_version = compute_swift_version_from_targets(targets)
result
end
......@@ -205,6 +206,29 @@ module Pod
end
end
end
# Compute the Swift version for the target build configurations. If more
# than one Swift version is defined for a given target, then it will raise.
#
# @param [Array<PBXNativeTarget>] targets
# the targets that are checked for Swift versions.
#
# @return [String] the targets Swift version or nil
#
def compute_swift_version_from_targets(targets)
versions = targets.flat_map(&:build_configurations).
flat_map { |config| config.build_settings['SWIFT_VERSION'] }.
compact.
uniq
case versions.count
when 0
nil
when 1
versions.first
else
raise Informative, 'There may only be up to 1 unique SWIFT_VERSION per target.'
end
end
end
end
end
......
require 'fileutils'
module Pod
class Installer
# Migrates installations performed by previous versions of CocoaPods.
#
class Migrator
class << self
# Performs the migration.
#
# @param [Sandbox] sandbox
# The sandbox which should be migrated.
#
def migrate(sandbox)
return unless sandbox.manifest
end
# @!group Migration Steps
# @!group Private helpers
# Check whether a migration is required
#
# @param [#to_s] target_version
# See Version#new.
#
# @param [Sandbox] sandbox
# The sandbox
#
# @return [void]
#
def installation_minor?(target_version, sandbox)
sandbox.manifest.cocoapods_version < Version.new(target_version)
end
# Makes a path creating any intermediate directory and printing an UI
# message.
#
# @path [#to_s] path
# The path.
#
# @return [void]
#
def make_path(path)
return if path.exist?
UI.message "- Making path #{UI.path(path)}" do
path.mkpath
end
end
# Moves a path to another one printing an UI message.
#
# @path [#to_s] source
# The path to move.
#
# @path [#to_s] destination
# The destination path.
#
# @return [void]
#
def move(source, destination)
return unless source.exist?
make_path(destination.dirname)
UI.message "- Moving #{UI.path(source)} to #{UI.path(destination)}" do
FileUtils.mv(source.to_s, destination.to_s)
end
end
# Deletes a path, including non empty directories, printing an UI
# message.
#
# @path [#to_s] path
# The path.
#
# @return [void]
#
def delete(path)
return unless path.exist?
UI.message "- Deleting #{UI.path(path)}" do
FileUtils.rm_rf(path)
end
end
end
end
end
end
......@@ -20,7 +20,10 @@ module Pod
# @return [Array<Symbol>] the symbol types, which require that the pod
# frameworks are embedded in the output directory / product bundle.
#
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :ui_test_bundle, :app_extension, :watch_extension, :watch2_extension].freeze
# @note This does not include :app_extension or :watch_extension because
# these types must have their frameworks embedded in their host targets
#
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :ui_test_bundle, :watch2_extension].freeze
# @return [String] the name of the embed frameworks phase
#
......@@ -54,6 +57,7 @@ module Pod
add_pods_library
add_embed_frameworks_script_phase
remove_embed_frameworks_script_phase_from_embedded_targets
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
end
......@@ -110,6 +114,20 @@ module Pod
end
end
# Removes the embed frameworks build phase from embedded targets
#
# @note Older versions of CocoaPods would add this build phase to embedded
# targets. They should be removed on upgrade because embedded targets
# will have their frameworks embedded in their host targets.
#
def remove_embed_frameworks_script_phase_from_embedded_targets
native_targets.each do |native_target|
if AggregateTarget::EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include? native_target.symbol_type
remove_embed_frameworks_script_phase(native_target)
end
end
end
def add_embed_frameworks_script_phase_to_target(native_target)
phase = create_or_update_build_phase(native_target, EMBED_FRAMEWORK_PHASE_NAME)
script_path = target.embed_frameworks_script_relative_path
......@@ -121,7 +139,7 @@ module Pod
# @param [PBXNativeTarget] native_target
#
def remove_embed_frameworks_script_phase(native_target)
embed_build_phase = native_target.shell_script_build_phases.find { |bp| bp.name == EMBED_FRAMEWORK_PHASE_NAME }
embed_build_phase = native_target.shell_script_build_phases.find { |bp| bp.name && bp.name.end_with?(EMBED_FRAMEWORK_PHASE_NAME) }
return unless embed_build_phase.present?
native_target.build_phases.delete(embed_build_phase)
end
......@@ -157,10 +175,9 @@ module Pod
native_target.build_phases.unshift(phase).uniq! unless native_target.build_phases.first == phase
phase.shell_script = <<-SH.strip_heredoc
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
SH
......
......@@ -108,7 +108,6 @@ module Pod
def prepare
UI.message '- Creating Pods project' do
@project = create_project
analysis_result.all_user_build_configurations.each do |name, type|
@project.add_build_configuration(name, type)
end
......@@ -138,6 +137,8 @@ module Pod
build_configuration.build_settings['TVOS_DEPLOYMENT_TARGET'] = tvos_deployment_target.to_s if tvos_deployment_target
build_configuration.build_settings['STRIP_INSTALLED_PRODUCT'] = 'NO'
build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES'
build_configuration.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
build_configuration.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = 'NO_SIGNING/' # a bogus provisioning profile ID assumed to be invalid
end
end
end
......
......@@ -21,7 +21,13 @@ module Pod
create_module_map
create_umbrella_header
end
create_embed_frameworks_script
# Because embedded targets live in their host target, CocoaPods
# copies all of the embedded target's pod_targets to its host
# targets. Having this script for the embedded target would
# cause an App Store rejection because frameworks cannot be
# embedded in embedded targets.
#
create_embed_frameworks_script unless target.requires_host_target?
create_bridge_support_file
create_copy_resources_script
create_acknowledgements
......@@ -45,12 +51,13 @@ module Pod
#
def custom_build_settings
settings = {
'MACH_O_TYPE' => 'staticlib',
'OTHER_LDFLAGS' => '',
'OTHER_LIBTOOLFLAGS' => '',
'PODS_ROOT' => '$(SRCROOT)',
'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
'SKIP_INSTALL' => 'YES',
'CODE_SIGN_IDENTITY[sdk=iphoneos*]' => '',
'MACH_O_TYPE' => 'staticlib',
'OTHER_LDFLAGS' => '',
'OTHER_LIBTOOLFLAGS' => '',
'PODS_ROOT' => '$(SRCROOT)',
'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
'SKIP_INSTALL' => 'YES',
}
super.merge(settings)
end
......
......@@ -54,6 +54,10 @@ module Pod
settings['PRIVATE_HEADERS_FOLDER_PATH'] = ''
settings['PUBLIC_HEADERS_FOLDER_PATH'] = ''
end
settings['CODE_SIGN_IDENTITY[sdk=iphoneos*]'] = ''
if target.swift_version
settings['SWIFT_VERSION'] = target.swift_version
end
settings
end
......
......@@ -7,6 +7,9 @@ module Pod
# generated this target.
attr_reader :target_definition
# Product types where the product's frameworks must be embedded in a host target
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :messages_extension, :watch_extension].freeze
# Initialize a new instance
#
# @param [TargetDefinition] target_definition @see target_definition
......@@ -23,6 +26,22 @@ module Pod
@xcconfigs = {}
end
# @return [Boolean] True if the user_target's pods are
# for an extension and must be embedded in a host,
# target, otherwise false.
#
def requires_host_target?
# If we don't have a user_project, then we can't
# glean any info about how this target is going to
# be integrated, so return false since we can't know
# for sure that this target refers to an extension
# target that would require a host target
return false if user_project.nil?
symbol_types = user_targets.map(&:symbol_type).uniq
raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}." unless symbol_types.count == 1
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include? symbol_types[0]
end
# @return [String] the label for the target.
#
def label
......
......@@ -81,6 +81,12 @@ module Pod
end
end
# @return [String] the Swift version for the target.
#
def swift_version
target_definitions.map(&:swift_version).compact.uniq.first
end
# @note The deployment target for the pod target is the maximum of all
# the deployment targets for the current platform of the target
# (or the minimum required to support the current installation
......
require 'cocoapods/user_interface/error_report'
require 'cocoapods/user_interface/inspector_reporter'
module Pod
# Provides support for UI output. It provides support for nested sections of
......
......@@ -2,6 +2,7 @@
require 'rbconfig'
require 'cgi'
require 'gh_inspector'
module Pod
module UserInterface
......@@ -112,6 +113,12 @@ EOS
EOS
end
def search_for_exceptions(exception)
inspector = GhInspector::Inspector.new 'cocoapods', 'cocoapods'
message_delegate = UserInterface::InspectorReporter.new
inspector.search_exception exception, message_delegate
end
private
def `(other)
......
require 'uri'
module Pod
module UserInterface
# Redirects GH-issues delegate callbacks to CocoaPods UI methods.
#
class InspectorReporter
# Called just as the investigation has begun.
# Lets the user know that it's looking for an issue.
#
# @param [query] String unused
#
# @param [GhInspector::Inspector] inspector
# The current inspector
#
# @return [void]
#
def inspector_started_query(_, inspector)
UI.puts "Looking for related issues on #{inspector.repo_owner}/#{inspector.repo_name}..."
end
# Called once the inspector has recieved a report with more than one issue,
# showing the top 3 issues, and offering a link to see more.
#
# @param [GhInspector::InspectionReport] report
# Report a list of the issues
#
# @param [GhInspector::Inspector] inspector
# The current inspector
#
# @return [void]
#
def inspector_successfully_recieved_report(report, _)
report.issues[0..2].each { |issue| print_issue_full(issue) }
if report.issues.count > 3
UI.puts "and #{report.total_results - 3} more at:"
UI.puts report.url
end
end
# Called once the report has been recieved, but when there are no issues found.
#
# @param [GhInspector::InspectionReport] report
# An empty report
#
# @param [GhInspector::Inspector] inspector
# The current inspector
#
# @return [void]
#
def inspector_recieved_empty_report(_, inspector)
UI.puts 'Found no similar issues. To create a new issue, please visit:'
UI.puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/issues/new"
end
# Called when there have been networking issues in creating the report.
#
# @param [Error] error
# The error returned during networking
#
# @param [String] query
# The original search query
#
# @param [GhInspector::Inspector] inspector
# The current inspector
#
# @return [void]
#
def inspector_could_not_create_report(error, query, inspector)
safe_query = URI.escape query
UI.puts 'Could not access the GitHub API, you may have better luck via the website.'
UI.puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/search?q=#{safe_query}&type=Issues&utf8=✓"
UI.puts "Error: #{error.name}"
end
private
def print_issue_full(issue)
safe_url = URI.escape issue.html_url
UI.puts " - #{issue.title}"
UI.puts " #{safe_url} [#{issue.state}] [#{issue.comments} comment#{issue.comments == 1 ? '' : 's'}]"
UI.puts " #{pretty_date(issue.updated_at)}"
UI.puts ''
end
# Taken from http://stackoverflow.com/questions/195740/how-do-you-do-relative-time-in-rails
def pretty_date(date_string)
date = Time.parse(date_string)
a = (Time.now - date).to_i
case a
when 0 then 'just now'
when 1 then 'a second ago'
when 2..59 then a.to_s + ' seconds ago'
when 60..119 then 'a minute ago' # 120 = 2 minutes
when 120..3540 then (a / 60).to_i.to_s + ' minutes ago'
when 3541..7100 then 'an hour ago' # 3600 = 1 hour
when 7101..82_800 then ((a + 99) / 3600).to_i.to_s + ' hours ago'
when 82_801..172_000 then 'a day ago' # 86400 = 1 day
when 172_001..518_400 then ((a + 800) / (60 * 60 * 24)).to_i.to_s + ' days ago'
when 518_400..1_036_800 then 'a week ago'
when 1_036_801..4_147_204 then ((a + 180_000) / (60 * 60 * 24 * 7)).to_i.to_s + ' weeks ago'
else date.strftime('%d %b %Y')
end
end
end
end
end
......@@ -434,7 +434,7 @@ module Pod
# for all available platforms with xcodebuild.
#
def install_pod
%i(verify_no_duplicate_framework_names
%i(verify_no_duplicate_framework_and_library_names
verify_no_static_framework_transitive_dependencies
verify_framework_usage generate_pods_project integrate_user_project
perform_post_install_actions).each { |m| @installer.send(m) }
......
Subproject commit 409958a75378ff70582af2fbabb1441c551ed1c7
Subproject commit ccba9c9c0e44b54dec59f414c24fea2634a5b757
//
// AppDelegate.swift
// Sample Extensions Project
//
// Created by Benjamin Asher on 6/10/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
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 throttle down OpenGL ES frame rates. 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 inactive 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:.
}
}
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</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>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?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>en</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>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// ViewController.swift
// Sample Extensions Project
//
// Created by Benjamin Asher on 6/10/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="M4Y-Lb-cyx">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--Today View Controller-->
<scene sceneID="cwh-vc-ff4">
<objects>
<viewController id="M4Y-Lb-cyx" customClass="TodayViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ft6-oW-KC0"/>
<viewControllerLayoutGuide type="bottom" id="FKl-LY-JtV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" simulatedAppContext="notificationCenter" id="S3S-Oj-5AN">
<rect key="frame" x="0.0" y="0.0" width="320" height="37"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="top" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hello World" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="GcN-lo-r42">
<rect key="frame" x="20" y="8" width="280" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="lightTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="FKl-LY-JtV" firstAttribute="top" secondItem="GcN-lo-r42" secondAttribute="bottom" constant="20" symbolic="YES" id="0Q0-KW-PJ6"/>
<constraint firstItem="GcN-lo-r42" firstAttribute="leading" secondItem="S3S-Oj-5AN" secondAttribute="leading" constant="20" symbolic="YES" id="6Vq-gs-PHe"/>
<constraint firstAttribute="trailing" secondItem="GcN-lo-r42" secondAttribute="trailing" constant="20" symbolic="YES" id="L8K-9R-egU"/>
<constraint firstItem="GcN-lo-r42" firstAttribute="top" secondItem="Ft6-oW-KC0" secondAttribute="bottom" constant="20" symbolic="YES" id="mYS-Cv-VNx"/>
</constraints>
</view>
<extendedEdge key="edgesForExtendedLayout"/>
<nil key="simulatedStatusBarMetrics"/>
<nil key="simulatedTopBarMetrics"/>
<nil key="simulatedBottomBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="320" height="37"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="vXp-U4-Rya" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="516" y="285"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
<?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>en</string>
<key>CFBundleDisplayName</key>
<string>Today Extension</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>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widget-extension</string>
</dict>
</dict>
</plist>
//
// TodayViewController.swift
// Today Extension
//
// Created by Benjamin Asher on 6/10/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import UIKit
import NotificationCenter
class TodayViewController: UIViewController, NCWidgetProviding {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view from its nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)) {
// Perform any setup necessary in order to update the view.
// If an error is encountered, use NCUpdateResult.Failed
// If there's no update required, use NCUpdateResult.NoData
// If there's an update, use NCUpdateResult.NewData
completionHandler(NCUpdateResult.NewData)
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,7 +3,7 @@ require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Command::Install do
it 'tells the user that no Podfile or podspec was found in the project dir' do
exception = lambda { run_command('install', '--no-repo-update') }.should.raise Informative
exception = lambda { run_command('install') }.should.raise Informative
exception.message.should.include "No `Podfile' found in the project directory."
end
......
......@@ -8,6 +8,7 @@ describe Pod::Generator::Plist do
@spec = @file_accessor.spec
@generator = Pod::Generator::Plist.new([@file_accessor])
@spec.stubs(:name).returns('POD_NAME')
@spec.stubs(:license).returns(:type => 'MIT')
@generator.stubs(:license_text).returns('LICENSE_TEXT')
end
......@@ -24,6 +25,7 @@ describe Pod::Generator::Plist do
:Type => 'PSGroupSpecifier',
:Title => 'POD_NAME',
:FooterText => 'LICENSE_TEXT',
:License => 'MIT',
}
end
......@@ -34,6 +36,7 @@ describe Pod::Generator::Plist do
:Type => 'PSGroupSpecifier',
:Title => 'POD_NAME',
:FooterText => license_text,
:License => 'MIT',
}
end
......
......@@ -250,6 +250,12 @@ module Pod
@generator.send(:pod_targets).each { |pt| pt.stubs(:uses_swift?).returns(false) }
@generator.generate.to_hash['EMBEDDED_CONTENT_CONTAINS_SWIFT'].should.be.nil
end
it 'does not set EMBEDDED_CONTENT_CONTAINS_SWIFT when there is swift, but the target is an extension' do
@target.stubs(:requires_host_target?).returns(true)
@generator.send(:pod_targets).first.stubs(:uses_swift?).returns(true)
@generator.generate.to_hash['EMBEDDED_CONTENT_CONTAINS_SWIFT'].should.be.nil
end
end
#-----------------------------------------------------------------------#
......
......@@ -100,6 +100,22 @@ module Pod
)
end
it 'hashes scopes that are longer than 50 characters' do
@bar_subspec.name = 'matryoshka/ThisIsAReallyLongSubspecName'
variants = PodVariantSet.new([
PodVariant.new([@root_spec, @default_subspec], Platform.ios),
PodVariant.new([@root_spec, @default_subspec], Platform.osx),
PodVariant.new([@root_spec, @default_subspec, @foo_subspec, @bar_subspec], Platform.ios),
PodVariant.new([@root_spec, @default_subspec, @bar_subspec], Platform.osx),
])
variants.scope_suffixes.values.should == %w(
iOS
OSX
c4ca5113
.default-matryoshka_ThisIsAReallyLongSubspecName
)
end
it 'returns scopes by versioned platform names and subspec names if they qualify' do
variants = PodVariantSet.new([
PodVariant.new([@root_spec, @default_subspec], Platform.new(:ios, '7.0')),
......
......@@ -12,6 +12,7 @@ module Pod
variant.specs.should == @specs
variant.platform.should == @platform
variant.requires_frameworks.should == false
variant.swift_version.should.nil?
end
it 'can be initialized with specs, platform and whether it requires frameworks' do
......@@ -19,6 +20,15 @@ module Pod
variant.specs.should == @specs
variant.platform.should == @platform
variant.requires_frameworks.should == true
variant.swift_version.should.nil?
end
it 'can be initialized with specs, platform, whether it requires frameworks, and a Swift version' do
variant = PodVariant.new(@specs, @platform, true, '2.3')
variant.specs.should == @specs
variant.platform.should == @platform
variant.requires_frameworks.should == true
variant.swift_version.should == '2.3'
end
it 'can return the root spec' do
......@@ -27,11 +37,12 @@ module Pod
variant.root_spec.should == spec
end
it 'can be compared for equality with another variant with the same specs, platform and value for whether it requires frameworks' do
spec = PodVariant.new(@specs, @platform, false)
spec.should == PodVariant.new(@specs, @platform, false)
it 'can be compared for equality with another variant with the same specs, platform, value for whether it requires frameworks and Swift version' do
spec = PodVariant.new(@specs, @platform, false, '2.3')
spec.should == PodVariant.new(@specs, @platform, false, '2.3')
spec.should.not == PodVariant.new(@specs, @platform, false, '3.0')
spec.should.not == PodVariant.new([@specs.first], @platform, false)
spec.should.not == PodVariant.new(@specs, Platform.osx, false)
spec.should.not == PodVariant.new(@specs, Platform.osx, false, '2.3')
spec.should.not == PodVariant.new(@specs, @platform, true)
end
......
......@@ -284,5 +284,48 @@ module Pod
message.should.include('Unable to determine the platform for the `default` target.')
end
end
#--------------------------------------#
describe '#compute_swift_version_from_targets' do
it 'returns the user defined SWIFT_VERSION if only one unique version is defined' do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('SWIFT_VERSION', '2.3')
target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target]
target_inspector = TargetInspector.new(target_definition, config.installation_root)
target_inspector.send(:compute_swift_version_from_targets, user_targets).should.equal '2.3'
end
it 'returns nil if the version is not defined' do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.set_setting('SWIFT_VERSION', nil)
target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target]
target_inspector = TargetInspector.new(target_definition, config.installation_root)
target_inspector.send(:compute_swift_version_from_targets, user_targets).should.equal nil
end
it 'raises if the user defined SWIFT_VERSION contains multiple unique versions are defined' do
user_project = Xcodeproj::Project.new('path')
target = user_project.new_target(:application, 'Target', :ios)
target.build_configuration_list.build_configurations.first.build_settings['SWIFT_VERSION'] = '2.3'
target.build_configuration_list.build_configurations.last.build_settings['SWIFT_VERSION'] = '3.0'
target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target]
target_inspector = TargetInspector.new(target_definition, config.installation_root)
should.raise(Informative) do
target_inspector.send(:compute_swift_version_from_targets, user_targets)
end.message.should.include 'There may only be up to 1 unique SWIFT_VERSION per target.'
end
end
end
end
......@@ -671,6 +671,87 @@ module Pod
#-------------------------------------------------------------------------#
describe 'extension targets' do
before do
SpecHelper.create_sample_app_copy_from_fixture('Sample Extensions Project')
@podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '6.0'
project 'Sample Extensions Project/Sample Extensions Project'
target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end
target 'Today Extension' do
pod 'monkey'
end
end
end
it 'copies extension pod targets to host target, when use_frameworks!' do
@podfile.use_frameworks!
analyzer = Pod::Installer::Analyzer.new(config.sandbox, @podfile)
result = analyzer.analyze
result.targets.flat_map { |at| at.pod_targets.map { |pt| "#{at.name}/#{pt.name}" } }.sort.should == [
'Pods-Sample Extensions Project/JSONKit',
'Pods-Sample Extensions Project/monkey',
'Pods-Today Extension/monkey',
].sort
end
it 'does not copy extension pod targets to host target, when not use_frameworks!' do
analyzer = Pod::Installer::Analyzer.new(config.sandbox, @podfile)
result = analyzer.analyze
result.targets.flat_map { |at| at.pod_targets.map { |pt| "#{at.name}/#{pt.name}" } }.sort.should == [
'Pods-Sample Extensions Project/JSONKit',
'Pods-Today Extension/monkey',
].sort
end
it "raises when unable to find an extension's host target" do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
use_frameworks!
platform :ios, '6.0'
project 'Sample Extensions Project/Sample Extensions Project'
target 'Today Extension' do
pod 'monkey'
end
end
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
should.raise Informative do
analyzer.analyze
end.message.should.match /Unable to find host target for Pods-Today Extension. Please add the host targets for the embedded targets to the Podfile/
end
it 'raises when the extension calls use_frameworks!, but the host target does not' do
podfile = Pod::Podfile.new do
source SpecHelper.test_repo_url
platform :ios, '6.0'
project 'Sample Extensions Project/Sample Extensions Project'
target 'Sample Extensions Project' do
pod 'JSONKit', '1.4'
end
target 'Today Extension' do
use_frameworks!
pod 'monkey'
end
end
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile)
should.raise Informative do
analyzer.analyze
end.message.should.match /Pods-Sample Extensions Project must call use_frameworks! because it is hosting an embedded target that calls use_frameworks!/
end
end
#-------------------------------------------------------------------------#
describe 'Private helpers' do
describe '#sources' do
describe 'when there are no explicit sources' do
......
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Installer::Migrator do
end
end
......@@ -96,10 +96,9 @@ module Pod
phase = target.shell_script_build_phases.find { |bp| bp.name == phase_name }
phase.shell_script.should == <<-EOS.strip_heredoc
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
if [ $? != 0 ] ; then
# print error to STDERR
echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
exit 1
fi
EOS
......@@ -147,22 +146,22 @@ module Pod
phase.nil?.should == true
end
it 'adds an embed frameworks build phase if the target to integrate is an app extension' do
it 'does not add an embed frameworks build phase if the target to integrate is an app extension' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:app_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
phase.nil?.should == true
end
it 'adds an embed frameworks build phase if the target to integrate is a watch extension' do
it 'does not add an embed frameworks build phase if the target to integrate is a watch extension' do
@pod_bundle.stubs(:requires_frameworks? => true)
target = @target_integrator.send(:native_targets).first
target.stubs(:symbol_type).returns(:watch_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
phase.nil?.should == true
end
it 'adds an embed frameworks build phase if the target to integrate is a watchOS 2 extension' do
......@@ -202,6 +201,42 @@ module Pod
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
end
it 'removes embed frameworks build phases from app extension targets' do
@pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate!
target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
target.stubs(:symbol_type).returns(:app_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == true
end
it 'removes embed frameworks build phases from watch extension targets' do
@pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate!
target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
target.stubs(:symbol_type).returns(:watch_extension)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == true
end
it 'removes embed frameworks build phases from framework targets' do
@pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate!
target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == false
target.stubs(:symbol_type).returns(:framework)
@target_integrator.integrate!
phase = target.shell_script_build_phases.find { |bp| bp.name == @embed_framework_phase_name }
phase.nil?.should == true
end
end
describe 'Private helpers' do
......
......@@ -226,6 +226,25 @@ module Pod
dummy = support_files_dir + 'Pods-SampleProject-dummy.m'
dummy.read.should.include?('@interface PodsDummy_Pods')
end
it 'creates an embed frameworks script, if the target does not require a host target' do
@pod_target.stubs(:requires_frameworks? => true)
@target.stubs(:requires_frameworks? => true)
@installer.install!
support_files_dir = config.sandbox.target_support_files_dir('Pods-SampleProject')
script = support_files_dir + 'Pods-SampleProject-frameworks.sh'
File.exist?(script).should == true
end
it 'does not create an embed frameworks script, if the target requires a host target' do
@pod_target.stubs(:requires_frameworks? => true)
@target.stubs(:requires_frameworks? => true)
@target.stubs(:requires_host_target? => true)
@installer.install!
support_files_dir = config.sandbox.target_support_files_dir('Pods-SampleProject')
script = support_files_dir + 'Pods-SampleProject-frameworks.sh'
File.exist?(script).should == false
end
end
end
end
......
......@@ -113,6 +113,25 @@ module Pod
#--------------------------------------#
describe 'setting the SWIFT_VERSION' do
it 'does not set the version if not included by the target definition' do
@installer.install!
@project.targets.first.build_configurations.each do |config|
config.build_settings.should.not.include?('SWIFT_VERSION')
end
end
it 'sets the version to the one specified in the target definition' do
@target_definition.swift_version = '3.0'
@installer.install!
@project.targets.first.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'].should == '3.0'
end
end
end
#--------------------------------------#
it 'adds the source files of each pod to the target of the Pod library' do
@installer.install!
names = @installer.target.native_target.source_build_phase.files.map { |bf| bf.file_ref.display_name }
......
......@@ -61,7 +61,7 @@ module Pod
before do
@installer.stubs(:resolve_dependencies)
@installer.stubs(:download_dependencies)
@installer.stubs(:verify_no_duplicate_framework_names)
@installer.stubs(:verify_no_duplicate_framework_and_library_names)
@installer.stubs(:verify_no_static_framework_transitive_dependencies)
@installer.stubs(:verify_framework_usage)
@installer.stubs(:generate_pods_project)
......@@ -157,6 +157,7 @@ module Pod
@installer.installation_options.integrate_targets = false
@installer.expects(:integrate_user_project).never
@installer.install!
UI.output.should.include 'Skipping User Project Integration'
end
it 'prints a list of deprecated pods' do
......@@ -258,7 +259,25 @@ module Pod
#-------------------------------------------------------------------------#
describe '#verify_no_duplicate_framework_names' do
describe '#verify_no_duplicate_framework_and_library_names' do
it 'detects duplicate library names' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_libraries).returns([Pathname('a/libBananalib.a')])
Pod::Specification.any_instance.stubs(:dependencies).returns([])
fixture_path = ROOT + 'spec/fixtures'
config.repos_dir = fixture_path + 'spec-repos'
podfile = Pod::Podfile.new do
platform :ios, '8.0'
project 'SampleProject/SampleProject'
pod 'BananaLib', :path => (fixture_path + 'banana-lib').to_s
target 'SampleProject'
end
lockfile = generate_lockfile
@installer = Installer.new(config.sandbox, podfile, lockfile)
@installer.installation_options.integrate_targets = false
should.raise(Informative) { @installer.install! }.message.should.match /conflict.*bananalib/
end
it 'detects duplicate framework names' do
Sandbox::FileAccessor.any_instance.stubs(:vendored_frameworks).
returns([Pathname('a/monkey.framework')]).then.
......
......@@ -193,6 +193,62 @@ module Pod
@target.requires_frameworks?.should == false
end
end
describe 'Target might require a host target' do
before do
target_definition = Podfile::TargetDefinition.new('Pods', nil)
target_definition.abstract = false
@target = AggregateTarget.new(target_definition, config.sandbox)
project_path = SpecHelper.fixture('SampleProject/SampleProject.xcodeproj')
@target.user_project = Xcodeproj::Project.open(project_path)
@target.user_target_uuids = ['A346496C14F9BE9A0080D870']
end
it 'requires a host target for app extension targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:app_extension)
@target.requires_host_target?.should == true
end
it 'requires a host target for watch extension targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:watch_extension)
@target.requires_host_target?.should == true
end
it 'requires a host target for framework targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:framework)
@target.requires_host_target?.should == true
end
it 'requires a host target for messages extension targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:messages_extension)
@target.requires_host_target?.should == true
end
it 'does not require a host target for watch 2 extension targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:watch2_extension)
@target.requires_host_target?.should == false
end
it 'does not require a host target for application targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:application)
@target.requires_host_target?.should == false
end
it 'does not require a host target, if there is no user project (manual integration)' do
@target.user_project = nil
@target.user_target_uuids = []
@target.requires_host_target?.should == false
end
it 'raises an exception if more than one kind of user_target is found' do
@target.user_target_uuids << '51075D491521D0C100E39B41'
@target.user_targets.first.stubs(:symbol_type).returns(:app_extension)
@target.user_targets.last.stubs(:symbol_type).returns(:watch_extension)
should.raise ArgumentError do
@target.requires_host_target?
end.message.should.equal 'Expected single kind of user_target for Pods. Found app_extension, watch_extension.'
end
end
end
describe 'With frameworks' do
......
......@@ -110,6 +110,36 @@ EOS
message = remove_color(message)
message.should == '[!] at -'
end
it 'handles inspector_successfully_recieved_report' do
time = Time.new(2016, 5, 13)
Time.stubs(:now).returns(time)
url = 'https://api.github.com/search/issues?q=Testing+repo:cocoapods/cocoapods'
fixture_json_text = File.read SpecHelper.fixture('github_search_response.json')
GhInspector::Sidekick.any_instance.expects(:get_api_results).with(url).returns(JSON.parse(fixture_json_text))
error = NameError.new('Testing', 'orta')
@report.search_for_exceptions error
result = <<-EOS
Looking for related issues on cocoapods/cocoapods...
- Travis CI with Ruby 1.9.x fails for recent pull requests
https://github.com/CocoaPods/CocoaPods/issues/646 [closed] [8 comments]
14 Nov 2012
- pod search --full chokes on cocos2d.podspec:14
https://github.com/CocoaPods/CocoaPods/issues/657 [closed] [1 comment]
20 Nov 2012
- about pod
https://github.com/CocoaPods/CocoaPods/issues/4345 [closed] [21 comments]
2 weeks ago
and 30 more at:
https://github.com/cocoapods/cocoapods/search?q=Testing&type=Issues&utf8=✓
EOS
UI.output.should == result
end
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
require 'gh_inspector'
# A quiet version of Evidence, so tests don't echo
class SilentEvidence
def inspector_started_query(query, inspector); end
def inspector_is_still_investigating(query, inspector); end
def inspector_successfully_recieved_report(report, inspector); end
def inspector_recieved_empty_report(report, inspector); end
def inspector_could_not_create_report(error, query, inspector); end
end
module Pod
describe UserInterface::InspectorReporter do
it 'handles inspector_started_query' do
inspector = GhInspector::Inspector.new 'cocoapods', 'cocoapods'
reporter = UserInterface::InspectorReporter.new
reporter.inspector_started_query('query', inspector)
UI.output.should.match %r{Looking for related issues on cocoapods\/cocoapods}
end
it 'handles inspector_successfully_recieved_report' do
url = 'https://api.github.com/search/issues?q=Testing+repo:cocoapods/cocoapods'
fixture_json_text = File.read SpecHelper.fixture('github_search_response.json')
GhInspector::Sidekick.any_instance.expects(:get_api_results).with(url).returns(JSON.parse(fixture_json_text))
inspector = GhInspector::Inspector.new 'cocoapods', 'cocoapods'
report = inspector.search_query 'Testing', SilentEvidence.new
reporter = UserInterface::InspectorReporter.new
reporter.inspector_successfully_recieved_report(report, inspector)
UI.output.should.match /Travis CI with Ruby 1.9.x fails for recent pull requests/
UI.output.should.match %r{https:\/\/github.com\/CocoaPods\/CocoaPods\/issues\/646 \[closed\] \[8 comments\]}
UI.output.should.match /pod search --full chokes on cocos2d.podspec/
end
end
end
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