diff --git a/.circleci/config.yml b/.circleci/config.yml index 2170bcfaad..7f70475033 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/Capacitor.podspec b/ios/Capacitor.podspec similarity index 63% rename from Capacitor.podspec rename to ios/Capacitor.podspec index 4382349634..b03e77d495 100644 --- a/Capacitor.podspec +++ b/ios/Capacitor.podspec @@ -1,6 +1,8 @@ +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' @@ -8,7 +10,7 @@ Pod::Spec.new do |s| s.ios.deployment_target = '11.0' s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } 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 diff --git a/CapacitorCordova.podspec b/ios/CapacitorCordova.podspec similarity index 61% rename from CapacitorCordova.podspec rename to ios/CapacitorCordova.podspec index 3ed0d4394b..2a6f691c44 100644 --- a/CapacitorCordova.podspec +++ b/ios/CapacitorCordova.podspec @@ -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' => 'hi@ionicframework.com' } 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 diff --git a/scripts/deploy/package.json.template b/ios/package.json similarity index 83% rename from scripts/deploy/package.json.template rename to ios/package.json index ca8b1d6b98..8a7ae40bbf 100644 --- a/scripts/deploy/package.json.template +++ b/ios/package.json @@ -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 (https://ionicframework.com) ", @@ -17,8 +17,5 @@ }, "peerDependencies": { "@capacitor/core": "~2.1.0" - }, - "scripts": { - "prepublishOnly": "bash ../scripts/setversion.sh" } } diff --git a/package.json b/package.json index 99252b3f77..c54ce96d21 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 5ce12b24ad..e32663f8f7 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -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 \ No newline at end of file +git push --follow-tags origin master \ No newline at end of file diff --git a/scripts/deploy/Capacitor.podspec.template b/scripts/deploy/Capacitor.podspec.template deleted file mode 100644 index 048d77d2d0..0000000000 --- a/scripts/deploy/Capacitor.podspec.template +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'Capacitor' - s.version = POD_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' => 'hi@ionicframework.com' } - 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.dependency 'CapacitorCordova', POD_VERSION - s.swift_version = '5.0' -end diff --git a/scripts/deploy/CapacitorCordova.podspec.template b/scripts/deploy/CapacitorCordova.podspec.template deleted file mode 100644 index 83567c55bf..0000000000 --- a/scripts/deploy/CapacitorCordova.podspec.template +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = "CapacitorCordova" - s.module_name = 'Cordova' - s.version = POD_VERSION - s.summary = "Capacitor Cordova Compatibility Layer" - s.homepage = "https://ionic-team.github.io/capacitor" - s.license = 'MIT' - s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } - 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.requires_arc = true - s.framework = "WebKit" -end diff --git a/scripts/generate.sh b/scripts/generate.sh deleted file mode 100644 index 6d1b76fb05..0000000000 --- a/scripts/generate.sh +++ /dev/null @@ -1,10 +0,0 @@ -set -e - -LERNA_JSON=`cat lerna.json`; -export LERNA_VERSION="$(node -pe "JSON.parse(\`$LERNA_JSON\`)['version']")" - -rm -rf capacitor-ios -mkdir capacitor-ios -cp -r ios capacitor-ios/ios/ - -sed "s/LERNA_VERSION/$LERNA_VERSION/g" scripts/deploy/package.json.template > capacitor-ios/package.json \ No newline at end of file diff --git a/scripts/prerelease.sh b/scripts/prerelease.sh index c5232af6ae..5248d9fbd1 100644 --- a/scripts/prerelease.sh +++ b/scripts/prerelease.sh @@ -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 diff --git a/scripts/setversion.sh b/scripts/setversion.sh deleted file mode 100644 index c49de278f0..0000000000 --- a/scripts/setversion.sh +++ /dev/null @@ -1,10 +0,0 @@ -LERNA_JSON=`cat ../lerna.json`; -export LERNA_VERSION="$(node -pe "JSON.parse(\`$LERNA_JSON\`)['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 -