Skip to content

Commit 64f42aa

Browse files
Merge pull request #521 from Instabug/refactor/monorepo-dio-package
Refactor: merge dio interceptor into mono-repo
2 parents 63a2bc1 + b357fae commit 64f42aa

File tree

78 files changed

+2871
-3
lines changed

Some content is hidden

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

78 files changed

+2871
-3
lines changed

.circleci/config.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ jobs:
310310
command: melos score --no-select
311311
- run: melos dryPublish --no-select
312312

313+
release_dio_plugin:
314+
executor: flutter-executor
315+
steps:
316+
- advanced-checkout/shallow-checkout
317+
- setup_flutter
318+
- run: chmod +x packages/Instabug-Dio-Interceptor/release.sh
319+
- run: ./packages/Instabug-Dio-Interceptor/release.sh
320+
313321
release_http_adapter_plugin:
314322
executor: flutter-executor
315323
steps:
@@ -396,6 +404,20 @@ workflows:
396404
filters:
397405
branches:
398406
only: master
407+
- hold_release_dio_plugin:
408+
type: approval
409+
requires:
410+
- test_flutter-stable
411+
filters:
412+
branches:
413+
only: master
414+
- release_dio_plugin:
415+
requires:
416+
- hold_release_dio_plugin
417+
- verify_pub
418+
filters:
419+
branches:
420+
only: master
399421
- hold_release_http_adapter_plugin:
400422
type: approval
401423
requires:

melos.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ scripts:
1010
run: dart analyze .
1111
format:
1212
run: dart format . --set-exit-if-changed
13+
exec:
14+
concurrency: 1
15+
failFast: true
16+
orderDependents: true
1317
pigeon:
1418
run: sh scripts/pigeon.sh
1519
exec:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Changelog
2+
3+
## [2.4.0] (2024-11-18)
4+
5+
### Added
6+
7+
- Add support for tracing network requests from Instabug to services like Datadog and New Relic ([#30](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/30)).
8+
9+
## [2.3.0] - (2024-05-07)
10+
11+
### Added
12+
13+
- Add support for Instabug Flutter SDK v13 ([#28](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/28)).
14+
- Add support for Instabug Flutter SDK v12 ([#26](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/26)), closes [#25](https://github.com/Instabug/Instabug-Dio-Interceptor/issues/25).
15+
16+
## v2.2.0 (2022-03-14)
17+
18+
- Adds support for Dio v5
19+
- Relaxes dependencies version constraints
20+
21+
## v2.1.1 (2022-08-01)
22+
23+
- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11
24+
25+
## v2.1.0 (2022-01-06)
26+
27+
- Fixes network log compilation error.
28+
- Adds payload size for network log.
29+
30+
## v2.0.1 (2021-09-29)
31+
32+
- Fixes an issue with APM network logger not reporting to the dashboard
33+
34+
## v2.0.0 (2021-09-20)
35+
36+
- Adds support for Dio v4.0
37+
- Upgrades to null safety
38+
39+
## v1.0.0 (2019-07-29)
40+
41+
- Updates instabug_flutter dependency name
42+
43+
## v0.0.1 (2019-07-22)
44+
45+
- Initial release
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Instabug
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Instabug Dio Interceptor
2+
3+
[![CircleCI](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor.svg?style=svg)](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor)
4+
[![pub package](https://img.shields.io/pub/v/instabug_dio_interceptor.svg)](https://pub.dev/packages/instabug_dio_interceptor)
5+
6+
This package is an add on to [Instabug-Flutter](https://github.com/Instabug/Instabug-Flutter).
7+
8+
It intercepts any requests performed with `Dio` Package and sends them to the report that will be sent to the dashboard.
9+
10+
## Integration
11+
12+
To enable network logging, simply add the `InstabugDioInterceptor` to the dio object interceptors as follows:
13+
14+
```dart
15+
var dio = new Dio();
16+
dio.interceptors.add(InstabugDioInterceptor());
17+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# example
2+
3+
A new Flutter project.
4+
5+
## Getting Started
6+
7+
This project is a starting point for a Flutter application.
8+
9+
A few resources to get you started if this is your first Flutter project:
10+
11+
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12+
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13+
14+
For help getting started with Flutter, view our
15+
[online documentation](https://flutter.dev/docs), which offers tutorials,
16+
samples, guidance on mobile development, and a full API reference.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
12+
**/*.keystore
13+
**/*.jks
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply plugin: 'kotlin-android'
26+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
28+
android {
29+
compileSdkVersion flutter.compileSdkVersion
30+
31+
compileOptions {
32+
sourceCompatibility JavaVersion.VERSION_1_8
33+
targetCompatibility JavaVersion.VERSION_1_8
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = '1.8'
38+
}
39+
40+
sourceSets {
41+
main.java.srcDirs += 'src/main/kotlin'
42+
}
43+
44+
defaultConfig {
45+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46+
applicationId "com.example.example"
47+
minSdkVersion flutter.minSdkVersion
48+
targetSdkVersion flutter.targetSdkVersion
49+
versionCode flutterVersionCode.toInteger()
50+
versionName flutterVersionName
51+
}
52+
53+
buildTypes {
54+
release {
55+
// TODO: Add your own signing config for the release build.
56+
// Signing with the debug keys for now, so `flutter run --release` works.
57+
signingConfig signingConfigs.debug
58+
}
59+
}
60+
}
61+
62+
flutter {
63+
source '../..'
64+
}
65+
66+
dependencies {
67+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
4+
<application
5+
android:name="${applicationName}"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="example"
8+
android:networkSecurityConfig="@xml/network_security_config"
9+
android:usesCleartextTraffic="true">
10+
<activity
11+
android:name=".MainActivity"
12+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13+
android:exported="true"
14+
android:hardwareAccelerated="true"
15+
android:launchMode="singleTop"
16+
android:theme="@style/LaunchTheme"
17+
android:windowSoftInputMode="adjustResize">
18+
<!-- Specifies an Android theme to apply to this Activity as soon as
19+
the Android process has started. This theme is visible to the user
20+
while the Flutter UI initializes. After that, this theme continues
21+
to determine the Window background behind the Flutter UI. -->
22+
<meta-data
23+
android:name="io.flutter.embedding.android.NormalTheme"
24+
android:resource="@style/NormalTheme" />
25+
<intent-filter>
26+
<action android:name="android.intent.action.MAIN" />
27+
<category android:name="android.intent.category.LAUNCHER" />
28+
</intent-filter>
29+
</activity>
30+
<!-- Don't delete the meta-data below.
31+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
32+
<meta-data
33+
android:name="flutterEmbedding"
34+
android:value="2" />
35+
</application>
36+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Generated file.
2+
//
3+
// If you wish to remove Flutter's multidex support, delete this entire file.
4+
//
5+
// Modifications to this file should be done in a copy under a different name
6+
// as this file may be regenerated.
7+
8+
package io.flutter.app;
9+
10+
import android.app.Application;
11+
import android.content.Context;
12+
import androidx.annotation.CallSuper;
13+
import androidx.multidex.MultiDex;
14+
15+
/**
16+
* Extension of {@link android.app.Application}, adding multidex support.
17+
*/
18+
public class FlutterMultiDexApplication extends Application {
19+
@Override
20+
@CallSuper
21+
protected void attachBaseContext(Context base) {
22+
super.attachBaseContext(base);
23+
MultiDex.install(this);
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.example.example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="@android:color/white" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Loading
Loading
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
Flutter draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
Flutter draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>

0 commit comments

Comments
 (0)