Skip to content

Commit

Permalink
[RELEASE] 3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
christocracy committed Oct 2, 2020
1 parent 98604b9 commit 9757899
Show file tree
Hide file tree
Showing 16 changed files with 240 additions and 48 deletions.
6 changes: 5 additions & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"ignore_dirs": [
"./node_modules/react-native-background-geolocation-android/ios/RNBackgroundGeolocation"
]
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ android {
applicationId "com.transistorsoft.backgroundgeolocation.react"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 343
versionName "3.8.2"
versionCode 344
versionName "3.9.1"
multiDexEnabled true
}
splits {
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
removeBackgroundGeolocationDebugSoundsInRelease = false
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "1.0.2"
appCompatVersion = "1.0.2"
supportV4Version = "1.0.0"
Expand Down
98 changes: 98 additions & 0 deletions bin/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
'use strict';

const fs = require("fs");
const path = require('path');

const {CLIError, UnknownCommandError} = require('./lib');

const COMMAND_LINK = 'link';
const COMMAND_REINSTALL = 'reinstall';

const MENU = {};

function registerCommand(name, description, handler) {
MENU[name] = {
description: description,
handler: handler
};
}

/// ACTION: link
///
registerCommand(COMMAND_LINK, 'Symlink TSLocationManager.framework, tslocationmanager.aar', function() {
link();
});

/// ACTION: reinstall
///
registerCommand(COMMAND_REINSTALL, 'Re-install the currently installed background-geolocation plugin', function() {
reinstall();
});

/// Symlink the [iOS] TSLocationManager.framework [Android] tslocationmanager.aar
///
function link() {
const fs = require('fs');
const path = require('path');
const rimraf = require("rimraf");

const SRC_ROOT = path.join('/Volumes/Glyph2TB/Users/chris/workspace/react/background-geolocation');
const MODULE_NAME = "react-native-background-geolocation";
const SRC_MODULE = path.join(SRC_ROOT, MODULE_NAME + "-android");
const NODE_MODULES = path.join('.', 'node_modules');
const PUBLIC_MODULE_PATH = path.join(NODE_MODULES, MODULE_NAME);
const PRIVATE_MODULE_PATH = PUBLIC_MODULE_PATH + '-android';

const ANDROID_LIBS_DIR = "android/libs";
const IOS_LIBS_DIR = "ios/RNBackgroundGeolocation/TSLocationManager.framework";

var modulePath = null;

// Determine which plugin is installed: public or private version.
if (fs.existsSync(PUBLIC_MODULE_PATH)) {
modulePath = PUBLIC_MODULE_PATH;
} else if (fs.existsSync(PRIVATE_MODULE_PATH)) {
modulePath = PRIVATE_MODULE_PATH;
} else {
console.error('ERROR: Failed to find ', MODULE_NAME);
return -1;
}
console.log('- modulePath:', modulePath);

var androidLibsPath = path.join(modulePath, ANDROID_LIBS_DIR);
var iosLibsPath = path.join(modulePath, IOS_LIBS_DIR);

// Destroy / unlink existing libs.
[androidLibsPath, iosLibsPath].forEach(function(libs) {
if (fs.existsSync(libs)) {
var stats = fs.lstatSync(libs);
console.log('[dir]', libs);
console.log('- symlink?', stats.isSymbolicLink(), ', dir?', stats.isDirectory());
if (stats.isSymbolicLink()) {
fs.unlinkSync(libs);
} else if (stats.isDirectory()) {
rimraf.sync(libs);
}
}
});

// Symlink tslocationmanager.aar -> src project.
var src = path.join(SRC_MODULE, ANDROID_LIBS_DIR);
var dest = path.join(modulePath, ANDROID_LIBS_DIR);
fs.symlinkSync(src, dest);

// Symlink TSLocationManager.framework -> src project.
src = path.join(SRC_MODULE, IOS_LIBS_DIR);
dest = path.join(modulePath, IOS_LIBS_DIR);
fs.symlinkSync(src, dest);
}

/// Re-install the currently installed plugin
///
function reinstall() {
console.log('- No implementation');
}

module.exports = {
actions: MENU
};
64 changes: 64 additions & 0 deletions bin/cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env node

'use strict';

const {CLIError} = require('./lib');

const {actions} = require('./actions');
const chalk = require('chalk');

const COMMAND_HELP = 'help';

var args = process.argv.slice(2);
var cmd = args.shift();

console.log(chalk.green("+-----------------------------------------"));
console.log(chalk.green(`| [Transitorsoft Demo CLI] cmd: ${cmd}`));
console.log(chalk.green("+-----------------------------------------"));

// Launch Command interpretor
const CLI = (function() {
return {
init: function() {
try {
if (cmd === undefined) {
cmd = COMMAND_HELP;
}
if (cmd === COMMAND_HELP) {
printMenu(actions);
return;
} else if (actions[cmd] === undefined) {
console.log(chalk.red("Unknown command:", cmd));
printMenu(actions);
return;
}

actions[cmd].handler(args);

} catch(error) {
if (error instanceof CLIError) {
console.log(chalk.red(`[error]: ${cmd}:`), error.message, '\n');
} else {
throw error;
}
}
}
}
})().init();

function printMenu(menu) {
console.log('Available commands:');
var table = [{
command: COMMAND_HELP,
description: 'Print this menu'
}];
for (var action in menu) {
//table[action] = ACTIONS[action].description;
table.push({
command: action,
description: menu[action].description
});
}
console.table(table, ['command', 'description']);
}

46 changes: 46 additions & 0 deletions bin/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const { exec, spawn} = require('child_process');
const chalk = require('chalk');

class CLIError extends Error {};

/**
* Custom exec implemention with Promise
* @return Promise
*/
function _exec(cmd, args) {

}

/**
* Custom spawn implementation with Promise
* @return Promise
*/
function _spawn(cmd, args=[]) {
var message = cmd;
args.forEach(function(arg) { message += ` ${arg}` });

console.log(chalk.yellow(`$ ${message}`));

return new Promise(function(resolve, reject) {

const child = spawn(cmd, args, {shell: true, stdio: 'inherit'});
child.on('error', (chunk) => {
console.log('error: ', chunk);
});

child.on('close', (code) => {
console.log(chalk.yellow(`child process exited with code ${code}`));
if (code == 0) {
resolve(code);
} else {
reject(code);
}
});
});
}

module.exports = {
CLIError,
exec: _exec,
spawn: _spawn
};
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ PODS:
- React-jsi (= 0.63.2)
- RNBackgroundFetch (3.0.6):
- React
- RNBackgroundGeolocation (3.9.0):
- RNBackgroundGeolocation (3.9.1):
- CocoaLumberjack (~> 3.6.1)
- React
- React-Core
- RNCAsyncStorage (1.9.0):
- React
- RNGestureHandler (1.6.1):
Expand Down Expand Up @@ -504,7 +504,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
RNBackgroundFetch: 9adf01bb51658fc205a3dc8802cf38dd7cd9be09
RNBackgroundGeolocation: 66b7cd2859fb4659ff2a1c09fd7739f9ba179e05
RNBackgroundGeolocation: 807366bac2fc9f64cadad355695a9c19a9760d66
RNCAsyncStorage: 453cd7c335ec9ba3b877e27d02238956b76f3268
RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38
RNReanimated: 4e102df74a9674fa943e05f97f3362b6e44d0b48
Expand All @@ -514,4 +514,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 90faf6eb6d2bb63be5f77d02e6415c49b4e77645

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BGGeolocation",
"version": "0.0.1",
"version": "3.9.1",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand All @@ -20,7 +20,7 @@
"react-native": "0.63.2",
"react-native-action-button": "^2.8.5",
"react-native-background-fetch": "^3.0.6",
"react-native-background-geolocation": "^3.9.0",
"react-native-background-geolocation": "^3.9.1",
"react-native-easy-grid": "^0.2.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-maps": "^0.26.1",
Expand All @@ -45,11 +45,13 @@
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^25.1.0",
"chalk": "^4.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"prettier": "^2.0.4",
"react-test-renderer": "16.13.1",
"rimraf": "^3.0.2",
"typescript": "^3.8.3"
},
"jest": {
Expand Down
5 changes: 0 additions & 5 deletions scripts/debugAndroid

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/link-frameworks

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/ln.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/openConsole.js

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/run-ios.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
open -a Xcode ios/RNBackgroundGeolocationSample.xcodeproj
open -a Xcode ios/RNBackgroundGeolocationSample.xcworkspace
5 changes: 0 additions & 5 deletions src/advanced/HomeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,6 @@ export default class HomeView extends Component<IProps, IState> {
autoSync: true,
stopOnTerminate: false,
startOnBoot: true,
notification: {
title: 'react-native-background-geolocation',
text: 'Tracking engaged'
},
heartbeatInterval: 60,
enableHeadless: true,
maxDaysToPersist: 14
}, (state:State) => {
Expand Down
1 change: 1 addition & 0 deletions src/advanced/lib/SettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ export default class SettingsService {
fastestLocationUpdateInterval: -1,
stopTimeout: 1,
motionTriggerDelay: 30000,
backgroundPermissionRationale: {},
schedule: [
//'2-6 09:00-17:00'
],
Expand Down
18 changes: 13 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,14 @@ chalk@^3.0.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chalk@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chardet@^0.4.0:
version "0.4.2"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2"
Expand Down Expand Up @@ -6136,10 +6144,10 @@ react-native-background-fetch@~3.1.0:
plist "^3.0.1"
xcode "^2.0.0"

react-native-background-geolocation@^3.9.0:
version "3.9.0"
resolved "https://registry.yarnpkg.com/react-native-background-geolocation/-/react-native-background-geolocation-3.9.0.tgz#7fc1c438b6568fe2aadae5d88500b029fdafb238"
integrity sha512-yUBNrQteDSrujUwX/qwQyML2s6RuVnvwF+iCxH7SgdMuBRvYTOi3zRYqITvZ56dJgrk9PcNRjj1nwapZ3Ldavg==
react-native-background-geolocation@^3.9.1:
version "3.9.1"
resolved "https://registry.yarnpkg.com/react-native-background-geolocation/-/react-native-background-geolocation-3.9.1.tgz#50810c2f95e5f4c24c804e97da0ceeffca7c4c3a"
integrity sha512-ig+RtFO58fNTjQYIfMasXJJt0ytfaEcXcvT0wgeDUyIPhdYI0OBAGBBmFXc43MGolC4FWb9kc4I9JgIqcSnbow==
dependencies:
fast-plist "^0.1.2"
plist "^2.0.1"
Expand Down Expand Up @@ -6652,7 +6660,7 @@ rimraf@^2.5.4:
dependencies:
glob "^7.1.3"

rimraf@^3.0.0:
rimraf@^3.0.0, rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
Expand Down

0 comments on commit 9757899

Please sign in to comment.