Skip to content

Commit

Permalink
chore: simplify ios publishing (#3028)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jun 2, 2020
1 parent 4aa5709 commit 38791a8
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 74 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
steps:
- checkout
- run:
command: pod lib lint --allow-warnings Capacitor.podspec
command: cd ios && pod lib lint --allow-warnings Capacitor.podspec
- run:
command: pod lib lint --allow-warnings CapacitorCordova.podspec
command: cd ios && pod lib lint --allow-warnings CapacitorCordova.podspec

build-android:
docker:
Expand Down
6 changes: 4 additions & 2 deletions Capacitor.podspec → ios/Capacitor.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = 'Capacitor'
s.version = '2.1.2'
s.version = package['version']
s.summary = 'Capacitor for iOS'
s.social_media_url = 'http://twitter.com/getcapacitor'
s.license = 'MIT'
s.homepage = 'https://capacitor.ionicframework.com/'
s.ios.deployment_target = '11.0'
s.authors = { 'Ionic Team' => '[email protected]' }
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s }
s.source_files = 'ios/Capacitor/Capacitor/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/**/*.{swift,h,m}'
s.source_files = 'Capacitor/Capacitor/*.{swift,h,m}', 'Capacitor/Capacitor/Plugins/*.{swift,h,m}', 'Capacitor/Capacitor/Plugins/**/*.{swift,h,m}'
s.dependency 'CapacitorCordova'
s.swift_version = '5.0'
end
10 changes: 6 additions & 4 deletions CapacitorCordova.podspec → ios/CapacitorCordova.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "CapacitorCordova"
s.module_name = 'Cordova'
s.version = '2.1.2'
s.module_name = 'Cordova'
s.version = package['version']
s.summary = "Capacitor Cordova Compatibility Layer"
s.homepage = "https://ionic-team.github.io/capacitor"
s.license = 'MIT'
s.authors = { 'Ionic Team' => '[email protected]' }
s.source = { :git => 'https://github.com/ionic-team/capacitor', :tag => s.version.to_s }
s.platform = :ios, 11.0
s.source_files = 'ios/CapacitorCordova/**/*.{h,m}'
s.public_header_files = 'ios/CapacitorCordova/CapacitorCordova/Classes/Public/*.h'
s.source_files = 'CapacitorCordova/**/*.{h,m}'
s.public_header_files = 'CapacitorCordova/CapacitorCordova/Classes/Public/*.h'
s.requires_arc = true
s.framework = "WebKit"
end
5 changes: 1 addition & 4 deletions scripts/deploy/package.json.template → ios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor/ios",
"version": "LERNA_VERSION",
"version": "2.1.2",
"description": "Capacitor: cross-platform mobile apps with the web",
"homepage": "https://capacitor.ionicframework.com/",
"author": "Ionic Team <[email protected]> (https://ionicframework.com) ",
Expand All @@ -17,8 +17,5 @@
},
"peerDependencies": {
"@capacitor/core": "~2.1.0"
},
"scripts": {
"prepublishOnly": "bash ../scripts/setversion.sh"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@capacitor/core",
"scripts": {
"publish": "bash scripts/prerelease.sh && bash scripts/generate.sh && lerna run build && lerna publish --force-publish --skip-git && npm run publish-push",
"publish": "bash scripts/prerelease.sh && lerna run build && lerna publish --force-publish --skip-git && npm run publish-push",
"publish-push": "bash scripts/deploy.sh"
},
"devDependencies": {
Expand Down
13 changes: 2 additions & 11 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,13 @@ export LERNA_VERSION="$(node -pe "JSON.parse(\`$LERNA_JSON\`)['version']")"

echo "Deploying Capacitor v$LERNA_VERSION"

export POD_VERSION=$LERNA_VERSION

# Update the version number in the podspec
sed "s/POD_VERSION/'$POD_VERSION'/g" scripts/deploy/Capacitor.podspec.template > Capacitor.podspec
sed "s/POD_VERSION/'$POD_VERSION'/g" scripts/deploy/CapacitorCordova.podspec.template > CapacitorCordova.podspec

# This is what we do instead of letting lerna git commit for us
git add lerna.json
git add Capacitor.podspec
git add CapacitorCordova.podspec
git add cli/package.json
git add core/package.json
git add electron/package.json
git add android/package.json
git add ios/package.json
git commit -m "Release v$LERNA_VERSION"
git tag $LERNA_VERSION -m $LERNA_VERSION
git push --follow-tags origin master

#rm -rf capacitor-ios
git push --follow-tags origin master
14 changes: 0 additions & 14 deletions scripts/deploy/Capacitor.podspec.template

This file was deleted.

15 changes: 0 additions & 15 deletions scripts/deploy/CapacitorCordova.podspec.template

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/generate.sh

This file was deleted.

4 changes: 3 additions & 1 deletion scripts/prerelease.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
set -e

# Verify pods are good
cd ios
pod lib lint --allow-warnings Capacitor.podspec
pod lib lint --allow-warnings CapacitorCordova.podspec


# Do the gradle
cd android
cd ../android
./gradlew clean build -b capacitor/build.gradle -Pandroid.useAndroidX=true -Pandroid.enableJetifier=true
10 changes: 0 additions & 10 deletions scripts/setversion.sh

This file was deleted.

0 comments on commit 38791a8

Please sign in to comment.