Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Avoid compiling xcassets in some cases #1521

Merged
merged 2 commits into from

3 participants

nmccann Coveralls Eloy Durán
nmccann

Added a condition to avoid compiling xcassets when WRAPPER_EXTENSION
is undefined, as it would be in the case of static libraries. This prevents
trying to copy the compiled files to a directory that does not exist.

See #1427 (comment)
for additional details. Essentially, xcassets were always being compiled regardless of if
they were needed or not.

Quick question: I notice that some scripts use [[ as opposed to [, should we use one over the other?

nmccann nmccann Avoid compiling xcassets in some cases
Added a condition to avoid compiling xcassets when WRAPPER_EXTENSION
is undefined, as it would be in the case of static libraries. This prevents
trying to copy the compiled files to a directory that does not exist.
4565f01
Coveralls

Coverage Status

Coverage remained the same when pulling 4565f01 on nmccann:feature/fix_resources_script into 92aa8a2 on CocoaPods:master.

Eloy Durán
Owner

The specs fail because the integration spec fixtures need to be updated, so this is actually passing. Thanks!

Eloy Durán
Owner

Oh btw, can you add an entry to the CHANGELOG?

nmccann

Sure will do, by the way, what is your preference for square brackets in an if statement, do you prefer [[ or [?

Coveralls

Coverage Status

Coverage remained the same when pulling 0ba86b3 on nmccann:feature/fix_resources_script into 92aa8a2 on CocoaPods:master.

Eloy Durán
Owner

what is your preference for square brackets in an if statement, do you prefer [[ or [?

I have no personal preference, mainly because I have no real knowledge on the subject. I assume one is chosen over the other for a reason?

Eloy Durán
Owner

Thanks for the work btw!

Eloy Durán alloy merged commit 8cbdcdb into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 28, 2013
  1. nmccann

    Avoid compiling xcassets in some cases

    nmccann authored
    Added a condition to avoid compiling xcassets when WRAPPER_EXTENSION
    is undefined, as it would be in the case of static libraries. This prevents
    trying to copy the compiled files to a directory that does not exist.
  2. nmccann

    [CHANGELOG]

    nmccann authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 1 deletion.
  1. +11 −0 CHANGELOG.md
  2. +1 −1  lib/cocoapods/generator/copy_resources_script.rb
11 CHANGELOG.md
View
@@ -2,6 +2,17 @@
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
+## Master
+
+###### Bug Fixes
+
+* Added a condition to avoid compiling xcassets when WRAPPER_EXTENSION
+ is undefined, as it would be in the case of static libraries. This prevents
+ trying to copy the compiled files to a directory that does not exist.
+ [Noah McCann](https://github.com/nmccann)
+ [#1521](https://github.com/CocoaPods/CocoaPods/pull/1521)
+
+
## 0.27.1
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.26.2...0.27.1)
• [cocoapods-core](https://github.com/CocoaPods/Core/compare/0.26.2...0.27.1)
2  lib/cocoapods/generator/copy_resources_script.rb
View
@@ -137,7 +137,7 @@ def script
XCASSETS_COMPILE = <<EOS
-if [ `find . -name '*.xcassets' | wc -l` -ne 0 ]
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ]
then
DEVICE=`if [ "${TARGETED_DEVICE_FAMILY}" -eq 1 ]; then echo "iphone"; else echo "ipad"; fi`
find "${PWD}" -name "*.xcassets" -print0 | xargs -0 actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" --target-device "${DEVICE}" --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}"
Something went wrong with that request. Please try again.