hypertrack-sdk-react-native 7.19.1 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +154 -0
- package/README.md +25 -16
- package/android/build.gradle +140 -41
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +6 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/src/main/AndroidManifest.xml +2 -3
- package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackModule.kt +284 -0
- package/android/src/main/java/com/reactnativehypertracksdk/HyperTrackSdkPackage.kt +17 -0
- package/hypertrack-sdk-react-native.podspec +34 -15
- package/ios/{RNHyperTrack/RNHyperTrack.h → HyperTrack.h} +1 -2
- package/ios/HyperTrack.m +384 -0
- package/ios/{RNHyperTrack.xcodeproj → HyperTrackSdk.xcodeproj}/project.pbxproj +70 -99
- package/lib/commonjs/HyperTrack/HyperTrack.js +244 -0
- package/lib/commonjs/HyperTrack/HyperTrack.js.map +1 -0
- package/lib/commonjs/index.js +52 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/HyperTrack/HyperTrack.js +230 -0
- package/lib/module/HyperTrack/HyperTrack.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/HyperTrack/HyperTrack.d.ts +161 -0
- package/lib/typescript/index.d.ts +4 -0
- package/package.json +145 -47
- package/src/HyperTrack/HyperTrack.ts +273 -0
- package/src/index.tsx +11 -0
- package/android/src/main/java/com/hypertrack/reactnative/androidsdk/HTSDKModule.java +0 -301
- package/android/src/main/java/com/hypertrack/reactnative/androidsdk/HTSDKPackage.java +0 -29
- package/ios/RNHyperTrack/RNHyperTrack.m +0 -312
- package/ios/RNHyperTrack.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RNHyperTrack.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RNHyperTrack.xcodeproj/project.xcworkspace/xcuserdata/tulushev.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNHyperTrack.xcodeproj/xcuserdata/tulushev.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/js/CriticalErrors.js +0 -97
- package/js/EventEmitter.js +0 -11
- package/js/HyperTrack.js +0 -130
- package/js/index.js +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
## [8.0.0] - 2022-08-05
|
|
9
|
+
### Added
|
|
10
|
+
- New interface for listeners.
|
|
11
|
+
- Reference documentation.
|
|
12
|
+
- TypeScript support.
|
|
13
|
+
### Changed
|
|
14
|
+
- Updated React Native from 0.63.3 to 0.69.1
|
|
15
|
+
|
|
7
16
|
## [7.19.1] - 2022-07-27
|
|
8
17
|
### Fixed
|
|
9
18
|
- Fixed React Native C++ incompatibility issue with Android SDK 6.2.0
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
|
|
4
|
+
|
|
5
|
+
## Development workflow
|
|
6
|
+
|
|
7
|
+
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
|
|
14
|
+
|
|
15
|
+
Make sure your code passes TypeScript and ESLint. Run the following to verify:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
yarn typescript
|
|
19
|
+
yarn lint
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
To fix formatting errors, run the following:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
yarn lint --fix
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Remember to add tests for your change if possible. Run the unit tests by:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
yarn test
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Linting and tests
|
|
35
|
+
|
|
36
|
+
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
|
|
37
|
+
|
|
38
|
+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
|
|
39
|
+
|
|
40
|
+
### Publishing to npm
|
|
41
|
+
|
|
42
|
+
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
|
|
43
|
+
|
|
44
|
+
To publish new versions, run the following:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
yarn release
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Scripts
|
|
51
|
+
|
|
52
|
+
The `package.json` file contains various scripts for common tasks:
|
|
53
|
+
|
|
54
|
+
- `yarn bootstrap`: setup project by installing all dependencies.
|
|
55
|
+
- `yarn typescript`: type-check files with TypeScript.
|
|
56
|
+
- `yarn lint`: lint files with ESLint.
|
|
57
|
+
- `yarn test`: run unit tests with Jest.
|
|
58
|
+
|
|
59
|
+
### Sending a pull request
|
|
60
|
+
|
|
61
|
+
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
|
|
62
|
+
|
|
63
|
+
When you're sending a pull request:
|
|
64
|
+
|
|
65
|
+
- Prefer small pull requests focused on one change.
|
|
66
|
+
- Verify that linters and tests are passing.
|
|
67
|
+
- Review the documentation to make sure it looks good.
|
|
68
|
+
- Follow the pull request template when opening a pull request.
|
|
69
|
+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
|
|
70
|
+
|
|
71
|
+
## Code of Conduct
|
|
72
|
+
|
|
73
|
+
### Our Pledge
|
|
74
|
+
|
|
75
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
76
|
+
|
|
77
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
78
|
+
|
|
79
|
+
### Our Standards
|
|
80
|
+
|
|
81
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
82
|
+
|
|
83
|
+
- Demonstrating empathy and kindness toward other people
|
|
84
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
85
|
+
- Giving and gracefully accepting constructive feedback
|
|
86
|
+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
87
|
+
- Focusing on what is best not just for us as individuals, but for the overall community
|
|
88
|
+
|
|
89
|
+
Examples of unacceptable behavior include:
|
|
90
|
+
|
|
91
|
+
- The use of sexualized language or imagery, and sexual attention or
|
|
92
|
+
advances of any kind
|
|
93
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
94
|
+
- Public or private harassment
|
|
95
|
+
- Publishing others' private information, such as a physical or email
|
|
96
|
+
address, without their explicit permission
|
|
97
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
98
|
+
professional setting
|
|
99
|
+
|
|
100
|
+
### Enforcement Responsibilities
|
|
101
|
+
|
|
102
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
103
|
+
|
|
104
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
105
|
+
|
|
106
|
+
### Scope
|
|
107
|
+
|
|
108
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
109
|
+
|
|
110
|
+
### Enforcement
|
|
111
|
+
|
|
112
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
|
|
113
|
+
|
|
114
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
115
|
+
|
|
116
|
+
### Enforcement Guidelines
|
|
117
|
+
|
|
118
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
119
|
+
|
|
120
|
+
#### 1. Correction
|
|
121
|
+
|
|
122
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
123
|
+
|
|
124
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
125
|
+
|
|
126
|
+
#### 2. Warning
|
|
127
|
+
|
|
128
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
129
|
+
|
|
130
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
131
|
+
|
|
132
|
+
#### 3. Temporary Ban
|
|
133
|
+
|
|
134
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
135
|
+
|
|
136
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
137
|
+
|
|
138
|
+
#### 4. Permanent Ban
|
|
139
|
+
|
|
140
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
141
|
+
|
|
142
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
143
|
+
|
|
144
|
+
### Attribution
|
|
145
|
+
|
|
146
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
147
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
148
|
+
|
|
149
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
150
|
+
|
|
151
|
+
[homepage]: https://www.contributor-covenant.org
|
|
152
|
+
|
|
153
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
154
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
package/README.md
CHANGED
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
# React Native HyperTrack SDK
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-
[](https://cocoapods.org/pods/HyperTrack)
|
|
6
|
-

|
|
3
|
+
   
|
|
7
4
|
|
|
8
5
|
[HyperTrack](https://www.hypertrack.com) lets you add live location tracking to your mobile app. Live location is made available along with ongoing activity, tracking controls and tracking outage with reasons.
|
|
9
6
|
|
|
10
7
|
React Native HyperTrack SDK is a wrapper around native iOS and Android SDKs that allows to integrate them into React Native apps.
|
|
11
8
|
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
12
11
|
For information about how to get started with React Native SDK, please visit this [HyperTrack Guide](https://www.hypertrack.com/docs/install-sdk-react-native).
|
|
13
12
|
|
|
14
|
-
##
|
|
13
|
+
## Documentation
|
|
14
|
+
|
|
15
|
+
[https://hypertrack.github.io/sdk-react-native/](https://hypertrack.github.io/sdk-react-native/)
|
|
16
|
+
|
|
17
|
+
## FAQ
|
|
18
|
+
|
|
19
|
+
link to FAQ
|
|
20
|
+
|
|
21
|
+
## Support
|
|
22
|
+
|
|
23
|
+
Join our [Slack community](https://join.slack.com/t/hypertracksupport/shared_invite/enQtNDA0MDYxMzY1MDMxLTdmNDQ1ZDA1MTQxOTU2NTgwZTNiMzUyZDk0OThlMmJkNmE0ZGI2NGY2ZGRhYjY0Yzc0NTJlZWY2ZmE5ZTA2NjI) for instant responses. You can also email us at help@hypertrack.com.
|
|
15
24
|
|
|
25
|
+
#### How to update the HyperTrack SDK version?
|
|
16
26
|
|
|
17
27
|
1. Update SDK constant
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
- android
|
|
30
|
+
- android/build.gradle
|
|
31
|
+
- DEFAULT_HYPERTRACK_SDK_VERSION
|
|
32
|
+
- ios
|
|
33
|
+
- hypertrack-sdk-react-native.podspec
|
|
34
|
+
- s.dependency 'HyperTrack/Objective-C', '**version**'
|
|
25
35
|
|
|
26
36
|
2. Increment wrapper version
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
- package.json
|
|
38
|
+
- version
|
|
30
39
|
3. Update changelog
|
|
31
40
|
4. Update badge in README.md
|
|
32
41
|
5. Create a version tag
|
|
33
42
|
6. Commit and push
|
|
34
43
|
7. Create a release
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
- Release title should be the current version tag
|
|
45
|
+
8. npm publish
|
package/android/build.gradle
CHANGED
|
@@ -1,59 +1,158 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['HyperTrackSdk_kotlinVersion']
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath 'com.android.tools.build:gradle:7.1.2'
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def isNewArchitectureEnabled() {
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
1
21
|
apply plugin: 'com.android.library'
|
|
22
|
+
apply plugin: 'kotlin-android'
|
|
2
23
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
mavenCentral()
|
|
6
|
-
jcenter()
|
|
7
|
-
google()
|
|
8
|
-
}
|
|
9
|
-
dependencies {
|
|
10
|
-
classpath 'com.android.tools.build:gradle:7.1.2'
|
|
11
|
-
}
|
|
24
|
+
if (isNewArchitectureEnabled()) {
|
|
25
|
+
apply plugin: 'com.facebook.react'
|
|
12
26
|
}
|
|
13
27
|
|
|
14
|
-
def
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def DEFAULT_TARGET_SDK_VERSION = 30
|
|
18
|
-
def DEFAULT_HYPERTRACK_SDK_VERSION = "6.2.0-rn.1"
|
|
28
|
+
def getExtOrDefault(name) {
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['HyperTrackSdk_' + name]
|
|
30
|
+
}
|
|
19
31
|
|
|
20
|
-
def
|
|
32
|
+
def getExtOrIntegerDefault(name) {
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['HyperTrackSdk_' + name]).toInteger()
|
|
34
|
+
}
|
|
21
35
|
|
|
22
36
|
android {
|
|
37
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
23
38
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
release {
|
|
33
|
-
minifyEnabled false
|
|
34
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
35
|
-
}
|
|
39
|
+
defaultConfig {
|
|
40
|
+
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
41
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
42
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
43
|
+
}
|
|
44
|
+
buildTypes {
|
|
45
|
+
release {
|
|
46
|
+
minifyEnabled false
|
|
36
47
|
}
|
|
48
|
+
}
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
42
|
-
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
50
|
+
lintOptions {
|
|
51
|
+
disable 'GradleCompatible'
|
|
52
|
+
}
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
compileOptions {
|
|
55
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
56
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
packagingOptions {
|
|
60
|
+
pickFirst 'lib/x86/libc++_shared.so'
|
|
61
|
+
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
62
|
+
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
63
|
+
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
64
|
+
}
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
repositories {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
maven {
|
|
68
|
+
mavenCentral()
|
|
69
|
+
google()
|
|
70
|
+
maven {
|
|
56
71
|
name 'hypertrack'
|
|
57
72
|
url 'https://s3-us-west-2.amazonaws.com/m2.hypertrack.com/'
|
|
58
73
|
}
|
|
74
|
+
|
|
75
|
+
def found = false
|
|
76
|
+
def defaultDir = null
|
|
77
|
+
def androidSourcesName = 'React Native sources'
|
|
78
|
+
|
|
79
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
80
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
81
|
+
} else {
|
|
82
|
+
defaultDir = new File(
|
|
83
|
+
projectDir,
|
|
84
|
+
'/../../../node_modules/react-native/android'
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (defaultDir.exists()) {
|
|
89
|
+
maven {
|
|
90
|
+
url defaultDir.toString()
|
|
91
|
+
name androidSourcesName
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
95
|
+
found = true
|
|
96
|
+
} else {
|
|
97
|
+
def parentDir = rootProject.projectDir
|
|
98
|
+
|
|
99
|
+
1.upto(5, {
|
|
100
|
+
if (found) return true
|
|
101
|
+
parentDir = parentDir.parentFile
|
|
102
|
+
|
|
103
|
+
def androidSourcesDir = new File(
|
|
104
|
+
parentDir,
|
|
105
|
+
'node_modules/react-native'
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
def androidPrebuiltBinaryDir = new File(
|
|
109
|
+
parentDir,
|
|
110
|
+
'node_modules/react-native/android'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
114
|
+
maven {
|
|
115
|
+
url androidPrebuiltBinaryDir.toString()
|
|
116
|
+
name androidSourcesName
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
120
|
+
found = true
|
|
121
|
+
} else if (androidSourcesDir.exists()) {
|
|
122
|
+
maven {
|
|
123
|
+
url androidSourcesDir.toString()
|
|
124
|
+
name androidSourcesName
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
128
|
+
found = true
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (!found) {
|
|
134
|
+
throw new GradleException(
|
|
135
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
136
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
142
|
+
def hyperTrackSdk_version = getExtOrDefault('HyperTrackSDKVersion')
|
|
143
|
+
|
|
144
|
+
dependencies {
|
|
145
|
+
//noinspection GradleDynamicVersion
|
|
146
|
+
implementation "com.facebook.react:react-native:+"
|
|
147
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
148
|
+
implementation "com.hypertrack:hypertrack:$hyperTrackSdk_version"
|
|
149
|
+
// From node_modules
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (isNewArchitectureEnabled()) {
|
|
153
|
+
react {
|
|
154
|
+
jsRootDir = file("../src/")
|
|
155
|
+
libraryName = "HyperTrackSdk"
|
|
156
|
+
codegenJavaPackageName = "com.reactnativehypertracksdk"
|
|
157
|
+
}
|
|
59
158
|
}
|
|
Binary file
|
package/android/gradlew
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2015 the original author or authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
##############################################################################
|
|
20
|
+
##
|
|
21
|
+
## Gradle start up script for UN*X
|
|
22
|
+
##
|
|
23
|
+
##############################################################################
|
|
24
|
+
|
|
25
|
+
# Attempt to set APP_HOME
|
|
26
|
+
# Resolve links: $0 may be a link
|
|
27
|
+
PRG="$0"
|
|
28
|
+
# Need this for relative symlinks.
|
|
29
|
+
while [ -h "$PRG" ] ; do
|
|
30
|
+
ls=`ls -ld "$PRG"`
|
|
31
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
32
|
+
if expr "$link" : '/.*' > /dev/null; then
|
|
33
|
+
PRG="$link"
|
|
34
|
+
else
|
|
35
|
+
PRG=`dirname "$PRG"`"/$link"
|
|
36
|
+
fi
|
|
37
|
+
done
|
|
38
|
+
SAVED="`pwd`"
|
|
39
|
+
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
40
|
+
APP_HOME="`pwd -P`"
|
|
41
|
+
cd "$SAVED" >/dev/null
|
|
42
|
+
|
|
43
|
+
APP_NAME="Gradle"
|
|
44
|
+
APP_BASE_NAME=`basename "$0"`
|
|
45
|
+
|
|
46
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
47
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
48
|
+
|
|
49
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
50
|
+
MAX_FD="maximum"
|
|
51
|
+
|
|
52
|
+
warn () {
|
|
53
|
+
echo "$*"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
die () {
|
|
57
|
+
echo
|
|
58
|
+
echo "$*"
|
|
59
|
+
echo
|
|
60
|
+
exit 1
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# OS specific support (must be 'true' or 'false').
|
|
64
|
+
cygwin=false
|
|
65
|
+
msys=false
|
|
66
|
+
darwin=false
|
|
67
|
+
nonstop=false
|
|
68
|
+
case "`uname`" in
|
|
69
|
+
CYGWIN* )
|
|
70
|
+
cygwin=true
|
|
71
|
+
;;
|
|
72
|
+
Darwin* )
|
|
73
|
+
darwin=true
|
|
74
|
+
;;
|
|
75
|
+
MSYS* | MINGW* )
|
|
76
|
+
msys=true
|
|
77
|
+
;;
|
|
78
|
+
NONSTOP* )
|
|
79
|
+
nonstop=true
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
|
|
83
|
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# Determine the Java command to use to start the JVM.
|
|
87
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
88
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
89
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
90
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
91
|
+
else
|
|
92
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
|
93
|
+
fi
|
|
94
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
95
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
96
|
+
|
|
97
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
98
|
+
location of your Java installation."
|
|
99
|
+
fi
|
|
100
|
+
else
|
|
101
|
+
JAVACMD="java"
|
|
102
|
+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
103
|
+
|
|
104
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
105
|
+
location of your Java installation."
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Increase the maximum file descriptors if we can.
|
|
109
|
+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
110
|
+
MAX_FD_LIMIT=`ulimit -H -n`
|
|
111
|
+
if [ $? -eq 0 ] ; then
|
|
112
|
+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
113
|
+
MAX_FD="$MAX_FD_LIMIT"
|
|
114
|
+
fi
|
|
115
|
+
ulimit -n $MAX_FD
|
|
116
|
+
if [ $? -ne 0 ] ; then
|
|
117
|
+
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
118
|
+
fi
|
|
119
|
+
else
|
|
120
|
+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
121
|
+
fi
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# For Darwin, add options to specify how the application appears in the dock
|
|
125
|
+
if $darwin; then
|
|
126
|
+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
130
|
+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
131
|
+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
132
|
+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
133
|
+
|
|
134
|
+
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
135
|
+
|
|
136
|
+
# We build the pattern for arguments to be converted via cygpath
|
|
137
|
+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
138
|
+
SEP=""
|
|
139
|
+
for dir in $ROOTDIRSRAW ; do
|
|
140
|
+
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
141
|
+
SEP="|"
|
|
142
|
+
done
|
|
143
|
+
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
144
|
+
# Add a user-defined pattern to the cygpath arguments
|
|
145
|
+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
146
|
+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
147
|
+
fi
|
|
148
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
149
|
+
i=0
|
|
150
|
+
for arg in "$@" ; do
|
|
151
|
+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
152
|
+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
153
|
+
|
|
154
|
+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
155
|
+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
156
|
+
else
|
|
157
|
+
eval `echo args$i`="\"$arg\""
|
|
158
|
+
fi
|
|
159
|
+
i=`expr $i + 1`
|
|
160
|
+
done
|
|
161
|
+
case $i in
|
|
162
|
+
0) set -- ;;
|
|
163
|
+
1) set -- "$args0" ;;
|
|
164
|
+
2) set -- "$args0" "$args1" ;;
|
|
165
|
+
3) set -- "$args0" "$args1" "$args2" ;;
|
|
166
|
+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
167
|
+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
168
|
+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
169
|
+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
170
|
+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
171
|
+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
172
|
+
esac
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
# Escape application args
|
|
176
|
+
save () {
|
|
177
|
+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
178
|
+
echo " "
|
|
179
|
+
}
|
|
180
|
+
APP_ARGS=`save "$@"`
|
|
181
|
+
|
|
182
|
+
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
183
|
+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
184
|
+
|
|
185
|
+
exec "$JAVACMD" "$@"
|