@amplitude/analytics-react-native 1.3.6 → 1.4.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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  # @amplitude/analytics-react-native
9
9
 
10
- Official Amplitude SDK for React Native (Beta)
10
+ Official Amplitude SDK for React Native
11
11
 
12
12
  # Installation and Quick Start
13
13
 
@@ -1,59 +1,108 @@
1
1
  buildscript {
2
- ext.kotlinVersion = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : "1.5.30"
3
- repositories {
4
- google()
5
- jcenter()
6
- }
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["AmplitudeReactNative_kotlinVersion"]
7
4
 
8
- dependencies {
9
- classpath 'com.android.tools.build:gradle:3.5.3'
10
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
11
- }
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ }
9
+
10
+ dependencies {
11
+ classpath "com.android.tools.build:gradle:7.2.1"
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
+
21
+ apply plugin: "com.android.library"
22
+ apply plugin: "kotlin-android"
23
+
24
+
25
+ def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
26
+
27
+ if (isNewArchitectureEnabled()) {
28
+ apply plugin: "com.facebook.react"
12
29
  }
13
30
 
14
- apply plugin: 'com.android.library'
15
- apply plugin: 'kotlin-android'
31
+ def getExtOrDefault(name) {
32
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["AmplitudeReactNative_" + name]
33
+ }
16
34
 
17
- def safeExtGet(prop, fallback) {
18
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
35
+ def getExtOrIntegerDefault(name) {
36
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AmplitudeReactNative_" + name]).toInteger()
37
+ }
38
+
39
+ def supportsNamespace() {
40
+ def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
41
+ def major = parsed[0].toInteger()
42
+ def minor = parsed[1].toInteger()
43
+
44
+ // Namespace support was added in 7.3.0
45
+ if (major == 7 && minor >= 3) {
46
+ return true
47
+ }
48
+
49
+ return major >= 8
19
50
  }
20
51
 
21
52
  android {
22
- compileSdkVersion safeExtGet('compileSdkVersion', 29)
23
- buildToolsVersion safeExtGet('buildToolsVersion', '29.0.2')
24
- defaultConfig {
25
- minSdkVersion safeExtGet('minSdkVersion', 16)
26
- targetSdkVersion safeExtGet('targetSdkVersion', 29)
27
- versionCode 1
28
- versionName "1.0"
53
+ if (supportsNamespace()) {
54
+ namespace "com.amplitude.reactnative"
29
55
 
56
+ sourceSets {
57
+ main {
58
+ manifest.srcFile "src/main/AndroidManifestNew.xml"
59
+ }
30
60
  }
61
+ }
31
62
 
32
- buildTypes {
33
- release {
34
- minifyEnabled false
35
- }
36
- }
37
- lintOptions {
38
- disable 'GradleCompatible'
39
- }
40
- compileOptions {
41
- sourceCompatibility JavaVersion.VERSION_1_8
42
- targetCompatibility JavaVersion.VERSION_1_8
63
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
64
+
65
+ defaultConfig {
66
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
67
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
68
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
69
+ }
70
+ buildTypes {
71
+ release {
72
+ minifyEnabled false
43
73
  }
74
+ }
75
+
76
+ lintOptions {
77
+ disable "GradleCompatible"
78
+ }
79
+
80
+ compileOptions {
81
+ sourceCompatibility JavaVersion.VERSION_1_8
82
+ targetCompatibility JavaVersion.VERSION_1_8
83
+ }
84
+
44
85
  }
45
86
 
46
87
  repositories {
47
- mavenLocal()
48
- maven {
49
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
50
- url("$rootDir/../node_modules/react-native/android")
51
- }
52
- google()
53
- jcenter()
88
+ mavenCentral()
89
+ google()
54
90
  }
55
91
 
92
+ def kotlin_version = getExtOrDefault("kotlinVersion")
93
+
56
94
  dependencies {
57
- //noinspection GradleDynamicVersion
58
- implementation "com.facebook.react:react-native:+" // From node_modules
95
+ // For < 0.71, this will be from the local maven repo
96
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
97
+ //noinspection GradleDynamicVersion
98
+ implementation "com.facebook.react:react-native:+"
99
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
100
+ }
101
+
102
+ if (isNewArchitectureEnabled()) {
103
+ react {
104
+ jsRootDir = file("../src/")
105
+ libraryName = "AmplitudeReactNative"
106
+ codegenJavaPackageName = "com.amplitude.reactnative"
107
+ }
59
108
  }
@@ -1,3 +1,5 @@
1
- android.useAndroidX=true
2
- android.enableJetifier=true
3
- kotlin.code.style=official
1
+ AmplitudeReactNative_kotlinVersion=1.7.0
2
+ AmplitudeReactNative_minSdkVersion=21
3
+ AmplitudeReactNative_targetSdkVersion=31
4
+ AmplitudeReactNative_compileSdkVersion=31
5
+ AmplitudeReactNative_ndkversion=21.4.7075529
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VERSION = void 0;
7
- const VERSION = '1.3.6';
7
+ const VERSION = '1.4.0';
8
8
  exports.VERSION = VERSION;
9
9
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.3.6';
1
+ export const VERSION = '1.4.0';
2
2
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.3.6";
1
+ export declare const VERSION = "1.4.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/analytics-react-native",
3
- "version": "1.3.6",
3
+ "version": "1.4.0",
4
4
  "description": "Official React Native SDK",
5
5
  "keywords": [
6
6
  "analytics",
@@ -90,5 +90,5 @@
90
90
  ]
91
91
  ]
92
92
  },
93
- "gitHead": "83cf780dec45f8e8dfcc7310c70ffb4ffe67788e"
93
+ "gitHead": "cde2f7f24aa4b45c72dc8f243fe95178a2b032ba"
94
94
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.3.6';
1
+ export const VERSION = '1.4.0';