Skip to content

Commit 63a2bc1

Browse files
Merge pull request #520 from Instabug/refactor/monorepo-add-http-package
2 parents 4bbafb0 + 9f704b5 commit 63a2bc1

File tree

76 files changed

+3041
-10
lines changed

Some content is hidden

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

76 files changed

+3041
-10
lines changed

.circleci/config.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ commands:
131131
steps:
132132
- run:
133133
name: Generate Pigeons
134-
command: melos pigeon
134+
command: melos pigeon --no-select
135135
- run:
136136
name: Build Pigeons
137-
command: melos generate
137+
command: melos generate --no-select
138138
- when:
139139
condition:
140140
equal:
@@ -188,7 +188,7 @@ jobs:
188188
- setup_flutter:
189189
version: <<parameters.version>>
190190
use_melos: true
191-
- run: melos test-coverage
191+
- run: melos test-coverage --no-select
192192
- persist_to_workspace:
193193
root: ~/project
194194
paths:
@@ -307,8 +307,16 @@ jobs:
307307
- setup_flutter
308308
- run:
309309
name: Check Package Score
310-
command: melos score
311-
- run: melos dryPublish
310+
command: melos score --no-select
311+
- run: melos dryPublish --no-select
312+
313+
release_http_adapter_plugin:
314+
executor: flutter-executor
315+
steps:
316+
- advanced-checkout/shallow-checkout
317+
- setup_flutter
318+
- run: chmod +x packages/Instabug-Dart-http-Adapter/release.sh
319+
- run: ./packages/Instabug-Dart-http-Adapter/release.sh
312320

313321
release_instabug_flutter:
314322
macos:
@@ -332,7 +340,7 @@ jobs:
332340
- run:
333341
name: Generate Pigeons
334342
working_directory: project
335-
command: melos pigeon
343+
command: melos pigeon --no-select
336344
- run:
337345
name: Clone Escape
338346
command: git clone [email protected]:Instabug/Escape.git
@@ -388,6 +396,20 @@ workflows:
388396
filters:
389397
branches:
390398
only: master
399+
- hold_release_http_adapter_plugin:
400+
type: approval
401+
requires:
402+
- test_flutter-stable
403+
filters:
404+
branches:
405+
only: master
406+
- release_http_adapter_plugin:
407+
requires:
408+
- hold_release_http_adapter_plugin
409+
- verify_pub
410+
filters:
411+
branches:
412+
only: master
391413
- release_instabug_flutter:
392414
requires:
393415
- hold_release_instabug_flutter

melos.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ scripts:
5959
flutter: true
6060
dependsOn: pana
6161
private: false
62+
pods:
63+
run: cd ios && pod install --repo-update
64+
description: running pod install
65+
exec:
66+
concurrency: 1
67+
orderDependents: true
68+
packageFilters:
69+
fileExists: 'ios/PodFile'
6270
score:
6371
run: dart run pana --no-warning --exit-code-threshold 0
6472
exec:

packages/instabug_flutter/example/pubspec.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ packages:
111111
instabug_http_client:
112112
dependency: "direct main"
113113
description:
114-
name: instabug_http_client
115-
sha256: "7d52803c0dd639f6dddbe07333418eb251ae02f3f9f4d30402517533ca692784"
116-
url: "https://pub.dev"
117-
source: hosted
114+
path: "../../instabug_http_client"
115+
relative: true
116+
source: path
118117
version: "2.4.0"
119118
leak_tracker:
120119
dependency: transitive
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
## [2.5.0] - 18/11/2024
4+
5+
### Added
6+
7+
- Add support for tracing network requests from Instabug to services like Datadog and New Relic ([#21](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/21)).
8+
9+
## [2.4.0] - 7/05/2024
10+
11+
### Added
12+
13+
- Add support for Instabug Flutter SDK v12 and v13 ([#17](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/17)).
14+
15+
## [2.3.0] - 3/11/2022
16+
17+
- Adds support for MultipartRequest.
18+
19+
## [2.2.1] - 2/8/2022
20+
21+
- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11
22+
23+
## [2.2.0] - 11/4/2022
24+
25+
- Adds support for logging network requests using `send` method.
26+
27+
## [2.1.0] - 5/1/2022
28+
29+
- Fixes network log compilation error.
30+
- Adds payload size for network log.
31+
32+
## [2.0.0] - 30/11/2021
33+
34+
- Upgrades to null safety.
35+
36+
## [1.0.0] - 29/7/2019
37+
38+
- Adds implementation for the instabug_http_client library which supports Instabug network logging for the dart library: http.

packages/instabug_http_client/LICENSE

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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# instabug_http_client
2+
3+
A dart package to support Instabug network logging for the external dart [http](https://pub.dev/packages/http) package.
4+
5+
## Getting Started
6+
7+
You can choose to attach all your network requests data to the Instabug reports being sent to the dashboard. See the details below on how to enable the feature for the `http` package.
8+
9+
### Installation
10+
11+
1. Add the dependency to your project `pubspec.yml`:
12+
13+
```yaml
14+
dependencies:
15+
instabug_http_client:
16+
```
17+
18+
2. Install the package by running the following command.
19+
20+
```bash
21+
flutter packages get
22+
```
23+
24+
### Usage
25+
26+
To enable logging, use the custom http client provided by Instabug:
27+
28+
```dart
29+
final client = InstabugHttpClient();
30+
```
31+
32+
Then proceed to use the package normally:
33+
34+
```dart
35+
final response = await client.get(Uri.parse(URL));
36+
```
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 7e9793dee1b85a243edd0e06cb1658e98b077561
8+
channel: stable
9+
10+
project_type: app
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at
17+
# https://dart-lang.github.io/linter/lints/index.html.
18+
#
19+
# Instead of disabling a lint rule for the entire project in the
20+
# section below, it can also be suppressed for a single line of code
21+
# or a specific dart file by using the `// ignore: name_of_lint` and
22+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23+
# producing the lint.
24+
rules:
25+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27+
28+
# Additional information about this file can be found at
29+
# https://dart.dev/guides/language/analysis-options
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+
<application
4+
android:label="example"
5+
android:name="${applicationName}"
6+
android:icon="@mipmap/ic_launcher"
7+
android:networkSecurityConfig="@xml/network_security_config"
8+
android:usesCleartextTraffic="true">
9+
<activity
10+
android:name=".MainActivity"
11+
android:exported="true"
12+
android:launchMode="singleTop"
13+
android:theme="@style/LaunchTheme"
14+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
15+
android:hardwareAccelerated="true"
16+
android:windowSoftInputMode="adjustResize">
17+
<!-- Specifies an Android theme to apply to this Activity as soon as
18+
the Android process has started. This theme is visible to the user
19+
while the Flutter UI initializes. After that, this theme continues
20+
to determine the Window background behind the Flutter UI. -->
21+
<meta-data
22+
android:name="io.flutter.embedding.android.NormalTheme"
23+
android:resource="@style/NormalTheme"
24+
/>
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>

0 commit comments

Comments
 (0)