@dashx/react-native 1.0.3 → 1.0.5

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.
@@ -0,0 +1,24 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "DashXReactNative"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.description = <<-DESC
10
+ @dashx/react-native
11
+ DESC
12
+ s.homepage = "https://github.com/github_account/@dashx/react-native"
13
+ # brief license entry:
14
+ s.license = "MIT"
15
+ s.authors = { "DashXDev" => "dev@dashx.com" }
16
+ s.platforms = { :ios => "10.0" }
17
+ s.source = { :git => "https://github.com/dashxhq/dashx-react-native.git", :tag => "#{s.version}" }
18
+
19
+ s.source_files = "ios/**/*.{h,c,m,swift}"
20
+ s.requires_arc = true
21
+
22
+ s.dependency "DashX", "1.0.5"
23
+ s.dependency "React"
24
+ end
package/README.md CHANGED
@@ -127,3 +127,12 @@ For the next steps, please follow the guide for the respective platform:
127
127
 
128
128
  - [Android](android/README.md)
129
129
  - [iOS](ios/README.md)
130
+
131
+ ## Publishing
132
+
133
+ Simply use `yarn publish` to bump the version & release. Once done, push the commit that yarn adds to GitHub:
134
+
135
+ ```sh
136
+ $ yarn publish
137
+ $ git push origin main
138
+ ```
@@ -1,7 +1,8 @@
1
+ import groovy.json.JsonSlurper
1
2
 
2
3
  buildscript {
3
4
  ext {
4
- kotlinVersion = '1.5.31'
5
+ kotlinVersion = '1.6.0'
5
6
  androidToolsVersion = '7.0.4'
6
7
  }
7
8
 
@@ -19,6 +20,14 @@ buildscript {
19
20
  apply plugin: 'com.android.library'
20
21
  apply plugin: 'kotlin-android'
21
22
 
23
+ def getVersionFromNpm() {
24
+ // Read and parse package.json file from project root
25
+ def inputFile = new File("../node_modules/@dashx/react-native/package.json")
26
+ def packageJson = new JsonSlurper().parseText(inputFile.text)
27
+
28
+ return packageJson["version"]
29
+ }
30
+
22
31
  android {
23
32
  compileSdkVersion 30
24
33
  buildToolsVersion '28.0.3'
@@ -28,7 +37,9 @@ android {
28
37
  targetSdkVersion 30
29
38
  compileSdkVersion 30
30
39
  versionCode 1
31
- versionName "1.0"
40
+ versionName getVersionFromNpm()
41
+
42
+ buildConfigField 'String', 'VERSION_NAME', "\"$versionName\""
32
43
  }
33
44
  lintOptions {
34
45
  abortOnError false
@@ -45,5 +56,5 @@ dependencies {
45
56
  implementation 'com.facebook.react:react-native:+'
46
57
  implementation 'com.google.code.gson:gson:2.9.0'
47
58
 
48
- implementation "com.dashx:dashx-android:1.0.4"
49
- }
59
+ implementation "com.dashx:dashx-android:1.0.7"
60
+ }
@@ -0,0 +1 @@
1
+ android.useAndroidX=true
@@ -1,15 +1,12 @@
1
1
  package com.dashx.rn.sdk
2
2
 
3
- import android.annotation.TargetApi
4
- import android.content.Context
5
- import android.database.Cursor
3
+ import android.content.pm.PackageInfo
4
+ import android.content.pm.PackageManager.NameNotFoundException
6
5
  import android.net.Uri
7
- import android.os.Build
8
- import android.provider.DocumentsContract
9
- import android.provider.MediaStore
10
6
  import com.dashx.rn.sdk.util.*
11
7
  import com.dashx.sdk.DashXLog
12
8
  import com.dashx.sdk.data.ExternalAsset
9
+ import com.dashx.sdk.data.LibraryInfo
13
10
  import com.facebook.react.bridge.*
14
11
  import com.google.gson.Gson
15
12
  import java.io.File
@@ -35,7 +32,8 @@ class DashXReactNativeModule(private val reactContext: ReactApplicationContext)
35
32
  reactContext,
36
33
  options.getString("publicKey")!!,
37
34
  options.getStringIfPresent("baseURI"),
38
- options.getStringIfPresent("targetEnvironment")
35
+ options.getStringIfPresent("targetEnvironment"),
36
+ LibraryInfo("dashx-react-native", BuildConfig.VERSION_NAME)
39
37
  )
40
38
  }
41
39
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dashx/react-native",
3
3
  "title": "DashX React Native",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "description": "DashX SDK for React Native",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -11,7 +11,7 @@
11
11
  "ContentOptionsBuilder.js",
12
12
  "utils.js",
13
13
  "ios",
14
- "DashX.podspec"
14
+ "DashXReactNative.podspec"
15
15
  ],
16
16
  "scripts": {
17
17
  "test": "echo \"Error: no test specified\" && exit 1"