Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0996e39
Adding Podspec for Cordova library
bhariharan Feb 21, 2019
78c8abf
Merge branch 'master' into podspec
bhariharan Feb 27, 2019
9409ff1
Merge branch 'master' into podspec
bhariharan Mar 2, 2019
73aeac6
Addressing some feedback
bhariharan May 5, 2019
c71841c
Merge branch 'master' into podspec
bhariharan May 5, 2019
09e4ab7
Merge branch 'master' into podspec
bhariharan Sep 22, 2019
debf555
Merge branch 'master' into podspec
bhariharan Dec 1, 2019
d2db91d
Adding logic to auto-parse and set release version in Podspec
bhariharan Dec 1, 2019
6e29eef
First stab at adding auto-update script
bhariharan Dec 2, 2019
a3445b9
Updating permissions of script
bhariharan Dec 2, 2019
1a8e899
Updating comments
bhariharan Dec 2, 2019
78fbf78
Merge branch 'master' into podspec
bhariharan Dec 20, 2019
6d1917e
Merge branch 'master' into podspec
bhariharan Dec 26, 2019
6471136
Merge branch 'master' into podspec
bhariharan Jan 9, 2020
dfb1b25
Merge branch 'master' into podspec
bhariharan Feb 11, 2020
7b49ea6
Bumping up iOS version to 11.0
bhariharan Feb 11, 2020
d8cd2e4
Merge branch 'master' into podspec
bhariharan Feb 13, 2020
fc3ebe6
Updating podspec
bhariharan Feb 13, 2020
0b4d9d6
Merge branch 'master' into podspec
bhariharan Feb 17, 2020
9a7d45f
Updated podspec
bhariharan Feb 17, 2020
093ff91
Merge branch 'master' into podspec
bhariharan Feb 20, 2020
f8b3a48
Adding preserve_paths and frameworks to podspec
bhariharan Feb 20, 2020
371fcf4
Merge branch 'master' into podspec
bhariharan Mar 10, 2020
8b9399e
Latest podspec
bhariharan Mar 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions Cordova.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require "json"

packageJson = JSON.parse(File.read(File.join(__dir__, "package.json")))
relVersion = package['version']
relSource = { :git => "https://github.com/apache/cordova-ios.git",
:tag => "rel/{relVersion}",
:submodules => true }

Pod::Spec.new do |s|
s.name = "Cordova"
s.version = relVersion
s.summary = "Apache Cordova for iOS"
s.homepage = "https://github.com/apache/cordova-ios"
s.license = { :type => "Apache 2.0", :file => "LICENSE" }
s.author = { "Apache Software Foundation" }
s.platform = :ios, "11.0"
s.source = relSource
s.requires_arc = true
s.preserve_paths = 'CordovaLib/cordova.js', 'CordovaLib/VERSION'
s.frameworks = 'AssetsLibrary', 'MobileCoreServices', 'AVFoundation', 'CoreLocation'
s.default_subspec = 'Cordova'
s.subspec 'Cordova' do |cordova|
cordova.source_files = 'CordovaLib/Classes/**/*.{h,m}', 'CordovaLib/Cordova/Cordova.h'
cordova.public_header_files = 'CordovaLib/Classes/Public/CDV.h', 'CordovaLib/Classes/Public/CDVAppDelegate.h', 'CordovaLib/Classes/Public/CDVAvailability.h', 'CordovaLib/Classes/Public/CDVAvailabilityDeprecated.h', 'CordovaLib/Classes/Public/CDVCommandDelegate.h', 'CordovaLib/Classes/Public/CDVCommandDelegateImpl.h', 'CordovaLib/Classes/Public/CDVCommandQueue.h', 'CordovaLib/Classes/Public/CDVConfigParser.h', 'CordovaLib/Classes/Public/CDVInvokedUrlCommand.h', 'CordovaLib/Classes/Public/CDVPlugin+Resources.h', 'CordovaLib/Classes/Public/CDVPlugin.h', 'CordovaLib/Classes/Public/CDVPluginResult.h', 'CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h', 'CordovaLib/Classes/Public/CDVTimer.h', 'CordovaLib/Classes/Public/CDVViewController.h', 'CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h', 'CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewUIDelegate.h', 'CordovaLib/Classes/Public/CDVWhitelist.h', 'CordovaLib/Cordova/Cordova.h', 'CordovaLib/Classes/Public/NSDictionary+CordovaPreferences.h', 'CordovaLib/Classes/Public/NSMutableArray+QueueAdditions.h'
cordova.prefix_header_contents = ''
cordova.requires_arc = true
end
end

#
# ATTENTION:
#
# This file needs to be updated manually whenever a Cordova upgrade that bumps up min version of iOS is performed.
# The release version number and the list of public headers are automatically updated through scipts.
# Sections that need to be updated:
# 1. {s.platform} should be updated if the minimum version of iOS has changed.
#
21 changes: 21 additions & 0 deletions CordovaLib/CordovaLib.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@
C0C01EAD1E3911D50056E6CB /* Sources */,
C0C01EAE1E3911D50056E6CB /* Frameworks */,
C0C01EAF1E3911D50056E6CB /* Headers */,
CEDDBB5523948D4C00506451 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -478,6 +479,26 @@
};
/* End PBXProject section */

/* Begin PBXShellScriptBuildPhase section */
CEDDBB5523948D4C00506451 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PROJECT_DIR}/../update_podspec.sh\" -s cordova\n";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the shell script that updates podspec every time the library project is built. No more manual steps required to update the list of public headers in the podspec.

};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
C0C01EAD1E3911D50056E6CB /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
70 changes: 70 additions & 0 deletions update_podspec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
set -e
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic script to update podspec headers every time files are added/deleted in the library project.


SUBSPEC_NAME=""

function usage()
{
local appName=`basename $0`
echo "Usage:"
echo "$appName -s <Subspec Name>"
}

function parseOpts()
{
while getopts :s: commandLineOpt; do
case ${commandLineOpt} in
s)
SUBSPEC_NAME=${OPTARG};;
?)
echo "Unknown option '-${OPTARG}'."
usage
exit 1
esac
done

# Validate that we got the required command line arg(s).
if [ "${SUBSPEC_NAME}" == "" ]; then
echo "No option specified for Subspec Name."
usage
exit 2
fi
}

parseOpts "$@"

repoDir=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd)
publicHeaderDirectory="${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}"
podSpecFile="${repoDir}/Cordova.podspec"
projectDir=`echo "${PROJECT_DIR}" | sed "s#${repoDir}/##g"`

cd "$repoDir"

# Create the public header file list out of the public headers in the build folder.
publicHeaderFileList=""
isFirstFile=1
for headerFile in `ls -1 "${publicHeaderDirectory}"`; do
repoHeaderFile=`find ${projectDir} -name $headerFile`
if [ "$repoHeaderFile" != "" ]; then
if [ $isFirstFile -eq 1 ]; then
publicHeaderFileList="'$repoHeaderFile'"
isFirstFile=0
else
publicHeaderFileList=`echo "${publicHeaderFileList}, '$repoHeaderFile'"`
fi
fi
done

# Make sure none of the public header files are in the exclude files list
if grep -q "${SUBSPEC_NAME}.exclude_files" ${podSpecFile}
then
echo "${publicHeaderFileList}" | sed 's/ *//g' | tr , '\n' | sort > "${podSpecFile}.public_header_files_list"
cat "${podSpecFile}" | grep "${SUBSPEC_NAME}.exclude_files" | sed 's/.*=//' | sed 's/ *//g' | tr , '\n' | sort > "${podSpecFile}.exclude_files_list"
publicHeaderFileList=`comm -23 ${podSpecFile}.public_header_files_list ${podSpecFile}.exclude_files_list | tr '\n' , | sed 's/,$//'`
rm "${podSpecFile}.public_header_files_list" "${podSpecFile}.exclude_files_list"
fi

# Replace the old headers with the new ones.
searchPattern='^( *'"${SUBSPEC_NAME}"'\.public_header_files = ).*$'
replacementPattern='\1'"${publicHeaderFileList}"
sed -E "s#$searchPattern#$replacementPattern#g" "$podSpecFile" > "${podSpecFile}.new"
mv "${podSpecFile}.new" "${podSpecFile}"