Skip to content

Commit e66c67a

Browse files
Merge remote-tracking branch 'origin/refactor/upgrade-example-app' into feat/network-spans-feature-flags
# Conflicts: # android/native.gradle # examples/default/android/app/build.gradle # examples/default/ios/InstabugExample.xcodeproj/project.pbxproj # examples/default/ios/Podfile.lock # examples/default/package.json # examples/default/yarn.lock
2 parents b8ab1c4 + fea72cb commit e66c67a

29 files changed

+4889
-4188
lines changed

.circleci/config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ commands:
4646
type: boolean
4747
default: false
4848
steps:
49+
- run:
50+
name: Uninstall Existing CocoaPods
51+
command: gem uninstall -x cocoapods
52+
- run:
53+
name: Install CocoaPods
54+
command: gem install cocoapods:1.14.0
4955
- restore_cache:
5056
name: Restore Pods Cache
5157
keys:
@@ -252,7 +258,7 @@ jobs:
252258
# ios/upload_sourcemap.sh files respectively.
253259
sync_generated_files:
254260
macos:
255-
xcode: 13.4.1
261+
xcode: 15.4.0
256262
resource_class: macos.m1.medium.gen1
257263
steps:
258264
- advanced-checkout/shallow-checkout
@@ -275,7 +281,7 @@ jobs:
275281
type: boolean
276282
default: false
277283
macos:
278-
xcode: 13.4.1
284+
xcode: 15.4.0
279285
resource_class: macos.m1.medium.gen1
280286
working_directory: ~/project/examples/default
281287
environment:
@@ -295,7 +301,7 @@ jobs:
295301
-scheme InstabugExample \
296302
-resultBundlePath coverage/result.xcresult \
297303
-sdk iphonesimulator \
298-
-destination 'platform=iOS Simulator,name=iPhone 13 Pro Max,OS=15.5' \
304+
-destination 'platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.5' \
299305
test | xcpretty
300306
- when:
301307
condition: << parameters.collect_coverage >>
@@ -315,7 +321,7 @@ jobs:
315321
type: steps
316322
default: []
317323
macos:
318-
xcode: 13.4.1
324+
xcode: 15.4.0
319325
resource_class: macos.m1.medium.gen1
320326
environment:
321327
INSTABUG_SOURCEMAPS_UPLOAD_DISABLE: true
@@ -414,7 +420,7 @@ jobs:
414420

415421
publish:
416422
macos:
417-
xcode: 13.4.1
423+
xcode: 15.4.0
418424
resource_class: macos.m1.medium.gen1
419425
working_directory: '~'
420426
steps:

android/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,17 @@ dependencies {
7979
testImplementation "org.mockito:mockito-android:3.4.0"
8080
testImplementation 'junit:junit:4.13.2'
8181
}
82+
83+
rootProject.allprojects {
84+
repositories {
85+
google()
86+
jcenter()
87+
maven {
88+
url "https://mvn.instabug.com/nexus/repository/instabug-internal/"
89+
credentials {
90+
username "instabug"
91+
password System.getenv('INSTABUG_REPOSITORY_PASSWORD')
92+
}
93+
}
94+
}
95+
}

android/native.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext.instabug = [
2-
version: '13.4.1.6273165-SNAPSHOT'
2+
version: '14.0.0.6273213-SNAPSHOT'
33
]
44

55
dependencies {

examples/default/android/app/build.gradle

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
4-
apply plugin: 'instabug-apm'
5-
6-
import com.android.build.OutputFile
75

86
/**
97
* This is the configuration block to customize your React Native Android app.
108
* By default you don't need to apply any configuration, just uncomment the lines you need.
119
*/
1210
react {
1311
/* Folders */
14-
// The root of your project, i.e. where "package.json" lives. Default is '..'
15-
// root = file("../")
16-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
17-
// reactNativeDir = file("../node_modules/react-native")
18-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
19-
// codegenDir = file("../node_modules/react-native-codegen")
20-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
21-
// cliFile = file("../node_modules/react-native/cli.js")
12+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
13+
// root = file("../../")
14+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
15+
// reactNativeDir = file("../../node_modules/react-native")
16+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
17+
// codegenDir = file("../../node_modules/@react-native/codegen")
18+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
19+
// cliFile = file("../../node_modules/react-native/cli.js")
2220

2321
/* Variants */
2422
// The list of variants to that are debuggable. For those we're going to
@@ -52,6 +50,9 @@ react {
5250
//
5351
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5452
// hermesFlags = ["-O", "-output-source-map"]
53+
54+
/* Autolinking */
55+
autolinkLibrariesWithApp()
5556
}
5657

5758
project.ext.vectoricons = [
@@ -60,14 +61,6 @@ project.ext.vectoricons = [
6061

6162
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
6263

63-
/**
64-
* Set this to true to create four separate APKs instead of one,
65-
* one for each native architecture. This is useful if you don't
66-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
67-
* and want to have separate APKs to upload to the Play Store.
68-
*/
69-
def enableSeparateBuildPerCPUArchitecture = false
70-
7164
/**
7265
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
7366
*/
@@ -86,25 +79,10 @@ def enableProguardInReleaseBuilds = false
8679
*/
8780
def jscFlavor = 'org.webkit:android-jsc:+'
8881

89-
/**
90-
* Private function to get the list of Native Architectures you want to build.
91-
* This reads the value from reactNativeArchitectures in your gradle.properties
92-
* file and works together with the --active-arch-only flag of react-native run-android.
93-
*/
94-
def reactNativeArchitectures() {
95-
def value = project.getProperties().get("reactNativeArchitectures")
96-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
97-
}
98-
99-
instabug {
100-
apm {
101-
networkEnabled = true
102-
}
103-
}
10482
android {
10583
ndkVersion rootProject.ext.ndkVersion
106-
107-
compileSdkVersion rootProject.ext.compileSdkVersion
84+
buildToolsVersion rootProject.ext.buildToolsVersion
85+
compileSdk rootProject.ext.compileSdkVersion
10886

10987
namespace "com.instabug.react.example"
11088
defaultConfig {
@@ -117,15 +95,6 @@ android {
11795
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
11896
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
11997
}
120-
121-
splits {
122-
abi {
123-
reset()
124-
enable enableSeparateBuildPerCPUArchitecture
125-
universalApk false // If true, also generate a universal APK
126-
include (*reactNativeArchitectures())
127-
}
128-
}
12998
signingConfigs {
13099
debug {
131100
storeFile file('debug.keystore')
@@ -147,22 +116,6 @@ android {
147116
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
148117
}
149118
}
150-
151-
// applicationVariants are e.g. debug, release
152-
applicationVariants.all { variant ->
153-
variant.outputs.each { output ->
154-
// For each separate APK per architecture, set a unique version code as described here:
155-
// https://developer.android.com/studio/build/configure-apk-splits.html
156-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
157-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
158-
def abi = output.getFilter(OutputFile.ABI)
159-
if (abi != null) { // null for the universal-debug, universal-release variants
160-
output.versionCodeOverride =
161-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
162-
}
163-
164-
}
165-
}
166119
externalNativeBuild {
167120
cmake {
168121
path file('src/main/cpp/CMakeLists.txt')
@@ -187,5 +140,3 @@ dependencies {
187140
androidTestImplementation('com.wix:detox:+') { transitive = true }
188141
androidTestImplementation 'junit:junit:4.12'
189142
}
190-
191-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

examples/default/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
<application
88
android:usesCleartextTraffic="true"
99
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
10+
tools:ignore="GoogleAppIndexingWarning"/>
1311
</manifest>

examples/default/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
1111
android:theme="@style/AppTheme"
12+
android:supportsRtl="true"
1213
android:networkSecurityConfig="@xml/network_security_config">
1314
<activity
1415
android:name=".MainActivity"

examples/default/android/app/src/main/java/com/instabug/react/example/MainActivity.java

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.instabug.react.example
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
class MainActivity : ReactActivity() {
9+
10+
/**
11+
* Returns the name of the main component registered from JavaScript. This is used to schedule
12+
* rendering of the component.
13+
*/
14+
override fun getMainComponentName(): String = "InstabugExample"
15+
16+
/**
17+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19+
*/
20+
override fun createReactActivityDelegate(): ReactActivityDelegate =
21+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22+
}

examples/default/android/app/src/main/java/com/instabug/react/example/MainApplication.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)