Skip to content

Commit

Permalink
Merge branch 'sc-9148-idiomatic-plugin-dot-swift' into sc-9155-autoge…
Browse files Browse the repository at this point in the history
…nerate-plugin.m

* sc-9148-idiomatic-plugin-dot-swift: (46 commits)
  [sc-9148] [project] Reverted the changed in the top-level package.json; the fix was needed only in the Example's package.json.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Tried a workaround for the lib/mappings.wasm error (gatsbyjs/gatsby#35607 (comment)), but no dice.
  [sc-9148] [project] Re-synced modules.
  bump package version to 3.4.2
  bump iOS version
  bump versions
  update package-lock.json
  var name
  fix function name
  fix options class
  bump versions
  expose setForegroundServiceOptions
  add --commit-hooks false and --git-tag-version false to the npm version command
  move npm version bump up earlier
  Update circleci to convenience images.
  swap out strings with single quotes for consistency
  Github actions conditionals fail with double quotes
  add template files and workflow to automate native SDK version bumps
  fix permission prompts
  ...
  • Loading branch information
jrtibbetts committed Aug 31, 2022
2 parents ac2372a + 0338bd9 commit 821ca31
Show file tree
Hide file tree
Showing 41 changed files with 12,413 additions and 11,115 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
android:
working_directory: ~/capacitor-radar
docker:
- image: circleci/android:api-28-node
- image: cimg/android:2022.04.1-node
steps:
- checkout:
path: ~/capacitor-radar
Expand All @@ -17,15 +17,15 @@ jobs:
- run: cd example/android && ./gradlew assembleDebug
ios:
macos:
xcode: "12.3.0"
xcode: 13.1.0
working_directory: ~/capacitor-radar
steps:
- checkout:
path: ~/capacitor-radar
- run: npm install
- run: npm run build
- run: sudo npm install -g @ionic/cli
- run: sudo chown -R 501:20 "/Users/distiller/.npm"
- run: sudo chown -R 502:20 "/Users/distiller/.npm"
- run: cd example && npm install
- run: cd example && ionic build
- run: cd example && npx cap sync
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/bump-native-sdks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Bump Native SDK version numbers whenever a repository dispatch of a release
# is received
name: Bump Native SDKs
on:
repository_dispatch:
types: ['ios-sdk-release', 'android-sdk-release']
jobs:
update_android_sdk_version:
runs-on: ubuntu-latest
if: github.event.client_payload.platform == 'android'
steps:
- name: Event Information
run: echo ${{ github.event.client_payload.release }}

# checkout the repo
- uses: actions/checkout@v2

# copy the build.gradle template file to its final destination
- name: Copy android/build.gradle template file
uses: canastro/copy-action@master
with:
source: 'android/build.gradle.template'
target: 'android/build.gradle'

# render the build.gradle template using the input sdk version
- name: Render radar-sdk-android release version onto android/build.gradle
uses: jayamanikharyono/[email protected]
with:
data: version=${{ github.event.client_payload.release }}
path: 'android/build.gradle'

# copy the template file to its final destination
- name: Copy example/android/app/build.gradle template file
uses: canastro/copy-action@master
with:
source: 'example/android/app/build.gradle.template'
target: 'example/android/app/build.gradle'

# render the template using the input sdk version
- name: Render radar-sdk-android release version onto example/android/app/build.gradle
uses: jayamanikharyono/[email protected]
with:
data: version=${{ github.event.client_payload.release }}
path: 'example/android/app/build.gradle'

# Update package.json to latest version
- name: Update package.json to latest
run: npm version ${{ github.event.client_payload.release }} --commit-hooks false --git-tag-version false

# open a pull request with the new sdk version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: Automated radar-sdk-android version bump to ${{ github.event.client_payload.release }}
reviewers: radarlabs/eng
token: ${{ secrets.GITHUB_TOKEN }}
update_ios_sdk_version:
runs-on: ubuntu-latest
if: github.event.client_payload.platform == 'ios'
steps:
- name: Event Information
run: echo ${{ github.event.client_payload.release }}

# checkout the repo
- uses: actions/checkout@v2

# copy the podfile template to its final destination
- name: Copy ios/Cartfile.resolved template
uses: canastro/copy-action@master
with:
source: 'ios/Podfile.template'
target: 'ios/Podfile'

# render the podfile template with the sdk version
- name: Render radar-sdk-ios release version onto Cartfile template
uses: jayamanikharyono/[email protected]
with:
data: version=${{ github.event.client_payload.release }}
path: 'ios/Podfile'

# copy the podspec template to its final destination
- name: Copy the podspec template
uses: canastro/copy-action@master
with:
source: 'CapacitorRadar.podspec.template'
target: 'CapacitorRadar.podspec'

# render the podspec template with the sdk version
- name: Render radar-sdk-ios release version onto podspec template
uses: jayamanikharyono/[email protected]
with:
data: version=${{ github.event.client_payload.release }}
path: 'CapacitorRadar.podspec'

# Update package.json to latest version
- name: Update package.json to latest
run: npm version ${{ github.event.client_payload.release }} --commit-hooks false --git-tag-version false

# open a pull request with the new sdk version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: Automated radar-sdk-ios version bump to ${{ github.event.client_payload.release }}
reviewers: radarlabs/eng
token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 2 additions & 3 deletions .github/workflows/radar-release-actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package to npmjs
name: Publish to npm
on:
release:
types: [ published ]
Expand All @@ -7,12 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion CapacitorRadar.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
s.dependency 'RadarSDK', '~> 3.3.1'
s.dependency 'RadarSDK', '~> 3.4.4'
s.static_framework = true
end
16 changes: 16 additions & 0 deletions CapacitorRadar.podspec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Pod::Spec.new do |s|
package = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'package.json')))
s.name = 'CapacitorRadar'
s.version = package['version']
s.summary = package['description']
s.license = package['license']
s.homepage = 'radarlabs/capacitor-radar'
s.author = 'Radar Labs, Inc.'
s.source = { :git => 'radarlabs/capacitor-radar', :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '12.0'
s.dependency 'Capacitor'
s.dependency 'RadarSDK', '~> {{ version }}'
s.static_framework = true
end
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

[![npm](https://img.shields.io/npm/v/capacitor-radar.svg)](https://www.npmjs.com/package/capacitor-radar)

[Radar](https://radar.io) is the leading geofencing and location tracking platform.
[Radar](https://radar.com) is the leading geofencing and location tracking platform.

The Radar SDK abstracts away cross-platform differences between location services, allowing you to add geofencing, location tracking, trip tracking, geocoding, and search to your apps with just a few lines of code.

## Documentation

See the Radar overview documentation [here](https://radar.io/documentation).
See the Radar overview documentation [here](https://radar.com/documentation).

Then, see the Radar Capacitor plugin documentation [here](https://radar.io/documentation/sdk/capacitor).
Then, see the Radar Capacitor plugin documentation [here](https://radar.com/documentation/sdk/capacitor).

## Examples

See an example app in `example/`.

## Support

Have questions? We're here to help! Email us at [support@radar.io](mailto:support@radar.io).
Have questions? We're here to help! Email us at [support@radar.com](mailto:support@radar.com).
23 changes: 6 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
repositories {
mavenCentral()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
Expand All @@ -27,29 +27,18 @@ android {
lintOptions {
abortOnError false
}
testOptions {
unitTests.includeAndroidResources = true
}
}

repositories {
google()
mavenCentral()
jcenter() //needed for cordova framework
}


dependencies {
implementation 'io.radar:sdk:3.3.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
//Version is defined in capacitor-android's build.gradle
implementation 'org.apache.cordova:framework:'

testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:core:1.4.0'
testImplementation "androidx.test.ext:junit:1.1.3"
testImplementation 'org.mockito:mockito-core:3.6.28'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.json:json:20210307'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'io.radar:sdk:3.4.7'
}

44 changes: 44 additions & 0 deletions android/build.gradle.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName '1.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

repositories {
google()
mavenCentral()
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'io.radar:sdk:{{ version }}'
}
3 changes: 1 addition & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

android.useAndroidX=true
android.useAndroidX=true
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="io.radar.capacitor"/>
<manifest package="io.radar.capacitor" />
Loading

0 comments on commit 821ca31

Please sign in to comment.