Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
f4c64317
Commit
f4c64317
authored
Mar 19, 2015
by
Olivier Halligon
Committed by
AliSoftware
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup `Pods-resources.sh` script
parent
709b349f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
72 deletions
+2
-72
copy_resources_script.rb
lib/cocoapods/generator/copy_resources_script.rb
+2
-72
No files found.
lib/cocoapods/generator/copy_resources_script.rb
View file @
f4c64317
...
@@ -17,7 +17,7 @@ module Pod
...
@@ -17,7 +17,7 @@ module Pod
#
#
def
initialize
(
resources_by_config
,
platform
)
def
initialize
(
resources_by_config
,
platform
)
@resources_by_config
=
resources_by_config
@resources_by_config
=
resources_by_config
@platform
=
platform
@platform
=
platform
# TODO: Remove this?
end
end
# Saves the resource script to the given pathname.
# Saves the resource script to the given pathname.
...
@@ -38,38 +38,11 @@ module Pod
...
@@ -38,38 +38,11 @@ module Pod
# @!group Private Helpers
# @!group Private Helpers
# @return [Hash{Symbol=>Version}] The minimum deployment target which
# supports the `--reference-external-strings-file` option for
# the `ibtool` command.
#
EXTERNAL_STRINGS_FILE_MIMINUM_DEPLOYMENT_TARGET
=
{
:ios
=>
Version
.
new
(
'6.0'
),
:osx
=>
Version
.
new
(
'10.8'
),
}
# @return [Bool] Whether the external strings file is supported by the
# `ibtool` according to the deployment target of the platform.
#
def
use_external_strings_file?
minimum_deployment_target
=
EXTERNAL_STRINGS_FILE_MIMINUM_DEPLOYMENT_TARGET
[
platform
.
name
]
platform
.
deployment_target
>=
minimum_deployment_target
end
# @return [String] The install resources shell function.
#
def
install_resources_function
if
use_external_strings_file?
INSTALL_RESOURCES_FUNCTION
else
INSTALL_RESOURCES_FUNCTION
.
gsub
(
' --reference-external-strings-file'
,
''
)
end
end
# @return [String] The contents of the copy resources script.
# @return [String] The contents of the copy resources script.
#
#
def
script
def
script
# Define install function
# Define install function
script
=
install_resources_function
script
=
INSTALL_RESOURCES_FUNCTION
# Call function for each configuration-dependent resource
# Call function for each configuration-dependent resource
resources_by_config
.
each
do
|
config
,
resources
|
resources_by_config
.
each
do
|
config
,
resources
|
...
@@ -82,7 +55,6 @@ module Pod
...
@@ -82,7 +55,6 @@ module Pod
end
end
end
end
script
+=
RSYNC_CALL
script
script
end
end
...
@@ -92,59 +64,17 @@ set -e
...
@@ -92,59 +64,17 @@ set -e
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=""
install_resource()
install_resource()
{
{
case $1 in
case $1 in
*
\.
storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename
\\
"$1
\\
" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename
\\
"$1
\\
" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*
\.
xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename
\\
"$1
\\
" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename
\\
"$1
\\
" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
;;
*.framework)
*.framework)
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
;;
*.xcdatamodel)
echo "xcrun momc
\\
"${PODS_ROOT}/$1
\\
"
\\
"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom
\\
""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc
\\
"${PODS_ROOT}/$1
\\
"
\\
"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd
\\
""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc
\\
"${PODS_ROOT}/$1
\\
"
\\
"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm
\\
""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
;;
*)
echo "${PODS_ROOT}/$1"
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
;;
esac
esac
}
}
EOS
RSYNC_CALL
=
<<
EOS
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]]; then
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
EOS
EOS
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment