Skip to content

Commit 6223394

Browse files
authored
Merge pull request #379 from qonversion/release/10.0.0
2 parents 64398b8 + 298fe8e commit 6223394

File tree

165 files changed

+27175
-19589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+27175
-19589
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

.gitignore

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
#
33
.DS_Store
44

5-
# node.js
6-
#
7-
node_modules/
8-
npm-debug.log
9-
yarn-error.log
5+
# VSCode
6+
.vscode/
7+
jsconfig.json
108

119
# Xcode
1210
#
@@ -27,23 +25,60 @@ DerivedData
2725
*.ipa
2826
*.xcuserstate
2927
project.xcworkspace
28+
**/.xcode.env.local
3029

31-
# Android/IntelliJ
30+
# Android/IJ
3231
#
33-
build/
34-
.idea
32+
.classpath
33+
.cxx
3534
.gradle
35+
.idea
36+
.project
37+
.settings
3638
local.properties
37-
*.iml
39+
android.iml
40+
41+
# Cocoapods
42+
#
43+
example/ios/Pods
44+
45+
# Ruby
46+
example/vendor/
47+
48+
# node.js
49+
#
50+
node_modules/
51+
npm-debug.log
52+
yarn-debug.log
53+
yarn-error.log
3854

3955
# BUCK
4056
buck-out/
4157
\.buckd/
42-
*.keystore
58+
android/app/libs
59+
android/keystores/debug.keystore
60+
61+
# Yarn
62+
.yarn/*
63+
example/.yarn/*
64+
!.yarn/patches
65+
!.yarn/plugins
66+
!.yarn/releases
67+
!.yarn/sdks
68+
!.yarn/versions
69+
70+
# Expo
71+
.expo/
72+
73+
# Turborepo
74+
.turbo/
75+
76+
# generated by bob
77+
lib/
4378

44-
# vscode
45-
.vscode
79+
# React Native Codegen
80+
ios/generated
81+
android/generated
4682

47-
# CocoaPods
48-
Pods/
49-
Podfile.lock
83+
# React Native Nitro Modules
84+
nitrogen/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.19.0

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
3+
4+
plugins:
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

android/build.gradle

Lines changed: 75 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,92 @@
1-
// android/build.gradle
2-
3-
// based on:
4-
//
5-
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
6-
// original location:
7-
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
8-
//
9-
// * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
10-
// original location:
11-
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
12-
13-
def DEFAULT_COMPILE_SDK_VERSION = 33
14-
def DEFAULT_MIN_SDK_VERSION = 16
15-
def DEFAULT_TARGET_SDK_VERSION = 33
16-
17-
def safeExtGet(prop, fallback) {
18-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
1+
buildscript {
2+
ext.getExtOrDefault = {name ->
3+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeSdk_' + name]
4+
}
5+
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath "com.android.tools.build:gradle:8.7.2"
13+
// noinspection DifferentKotlinGradleVersion
14+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
15+
}
1916
}
2017

21-
apply plugin: 'com.android.library'
18+
def isNewArchitectureEnabled() {
19+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
20+
}
2221

23-
buildscript {
24-
// The Android Gradle plugin is only required when opening the android folder stand-alone.
25-
// This avoids unnecessary downloads and potential conflicts when the library is included as a
26-
// module dependency in an application project.
27-
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
28-
repositories {
29-
google()
30-
}
31-
if (project == rootProject) {
32-
dependencies {
33-
classpath 'com.android.tools.build:gradle:3.4.3'
34-
}
35-
}
22+
apply plugin: "com.android.library"
23+
apply plugin: "kotlin-android"
24+
25+
if (isNewArchitectureEnabled()) {
26+
apply plugin: "com.facebook.react"
27+
}
28+
29+
def getExtOrIntegerDefault(name) {
30+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["ReactNativeSdk_" + name]).toInteger()
3631
}
3732

3833
android {
39-
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
40-
defaultConfig {
41-
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
42-
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
43-
versionCode 1
44-
versionName "1.0"
34+
namespace "com.qonversion.reactnativesdk"
35+
36+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
37+
38+
defaultConfig {
39+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
40+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
41+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
42+
}
43+
44+
buildFeatures {
45+
buildConfig true
46+
}
47+
48+
buildTypes {
49+
release {
50+
minifyEnabled false
4551
}
46-
lintOptions {
47-
abortOnError false
52+
}
53+
54+
lintOptions {
55+
disable "GradleCompatible"
56+
}
57+
58+
compileOptions {
59+
sourceCompatibility JavaVersion.VERSION_1_8
60+
targetCompatibility JavaVersion.VERSION_1_8
61+
}
62+
63+
sourceSets {
64+
main {
65+
java.srcDirs += [
66+
"generated/java",
67+
"generated/jni"
68+
]
4869
}
70+
}
4971
}
5072

5173
repositories {
52-
// ref: https://www.baeldung.com/maven-local-repository
53-
mavenLocal()
54-
maven {
55-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
56-
url "$rootDir/../node_modules/react-native/android"
57-
}
58-
maven {
59-
// Android JSC is installed from npm
60-
url "$rootDir/../node_modules/jsc-android/dist"
61-
}
62-
google()
74+
mavenCentral()
75+
google()
6376
}
6477

78+
def kotlin_version = getExtOrDefault("kotlinVersion")
79+
6580
dependencies {
66-
//noinspection GradleDynamicVersion
67-
implementation 'com.facebook.react:react-native:+' // From node_modules
68-
implementation "io.qonversion:sandwich:6.0.6"
81+
implementation "com.facebook.react:react-android"
82+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
83+
implementation "io.qonversion:sandwich:6.0.10"
6984
}
7085

71-
afterEvaluate { project ->
72-
android.libraryVariants.all { variant ->
73-
def name = variant.name.capitalize()
74-
def javaCompileTask = variant.javaCompileProvider.get()
75-
76-
task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
77-
from javaCompileTask.destinationDir
78-
}
79-
}
86+
if (isNewArchitectureEnabled()) {
87+
react {
88+
jsRootDir = file("../src/")
89+
libraryName = "ReactNativeSdk"
90+
codegenJavaPackageName = "com.qonversion.reactnativesdk"
91+
}
8092
}

0 commit comments

Comments
 (0)