-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #520 from Instabug/refactor/monorepo-add-http-package
- Loading branch information
Showing
76 changed files
with
3,041 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,10 +131,10 @@ commands: | |
steps: | ||
- run: | ||
name: Generate Pigeons | ||
command: melos pigeon | ||
command: melos pigeon --no-select | ||
- run: | ||
name: Build Pigeons | ||
command: melos generate | ||
command: melos generate --no-select | ||
- when: | ||
condition: | ||
equal: | ||
|
@@ -188,7 +188,7 @@ jobs: | |
- setup_flutter: | ||
version: <<parameters.version>> | ||
use_melos: true | ||
- run: melos test-coverage | ||
- run: melos test-coverage --no-select | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
|
@@ -307,8 +307,16 @@ jobs: | |
- setup_flutter | ||
- run: | ||
name: Check Package Score | ||
command: melos score | ||
- run: melos dryPublish | ||
command: melos score --no-select | ||
- run: melos dryPublish --no-select | ||
|
||
release_http_adapter_plugin: | ||
executor: flutter-executor | ||
steps: | ||
- advanced-checkout/shallow-checkout | ||
- setup_flutter | ||
- run: chmod +x packages/Instabug-Dart-http-Adapter/release.sh | ||
- run: ./packages/Instabug-Dart-http-Adapter/release.sh | ||
|
||
release_instabug_flutter: | ||
macos: | ||
|
@@ -332,7 +340,7 @@ jobs: | |
- run: | ||
name: Generate Pigeons | ||
working_directory: project | ||
command: melos pigeon | ||
command: melos pigeon --no-select | ||
- run: | ||
name: Clone Escape | ||
command: git clone [email protected]:Instabug/Escape.git | ||
|
@@ -388,6 +396,20 @@ workflows: | |
filters: | ||
branches: | ||
only: master | ||
- hold_release_http_adapter_plugin: | ||
type: approval | ||
requires: | ||
- test_flutter-stable | ||
filters: | ||
branches: | ||
only: master | ||
- release_http_adapter_plugin: | ||
requires: | ||
- hold_release_http_adapter_plugin | ||
- verify_pub | ||
filters: | ||
branches: | ||
only: master | ||
- release_instabug_flutter: | ||
requires: | ||
- hold_release_instabug_flutter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Changelog | ||
|
||
## [2.5.0] - 18/11/2024 | ||
|
||
### Added | ||
|
||
- 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)). | ||
|
||
## [2.4.0] - 7/05/2024 | ||
|
||
### Added | ||
|
||
- Add support for Instabug Flutter SDK v12 and v13 ([#17](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/17)). | ||
|
||
## [2.3.0] - 3/11/2022 | ||
|
||
- Adds support for MultipartRequest. | ||
|
||
## [2.2.1] - 2/8/2022 | ||
|
||
- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11 | ||
|
||
## [2.2.0] - 11/4/2022 | ||
|
||
- Adds support for logging network requests using `send` method. | ||
|
||
## [2.1.0] - 5/1/2022 | ||
|
||
- Fixes network log compilation error. | ||
- Adds payload size for network log. | ||
|
||
## [2.0.0] - 30/11/2021 | ||
|
||
- Upgrades to null safety. | ||
|
||
## [1.0.0] - 29/7/2019 | ||
|
||
- Adds implementation for the instabug_http_client library which supports Instabug network logging for the dart library: http. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Instabug | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# instabug_http_client | ||
|
||
A dart package to support Instabug network logging for the external dart [http](https://pub.dev/packages/http) package. | ||
|
||
## Getting Started | ||
|
||
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. | ||
|
||
### Installation | ||
|
||
1. Add the dependency to your project `pubspec.yml`: | ||
|
||
```yaml | ||
dependencies: | ||
instabug_http_client: | ||
``` | ||
2. Install the package by running the following command. | ||
```bash | ||
flutter packages get | ||
``` | ||
|
||
### Usage | ||
|
||
To enable logging, use the custom http client provided by Instabug: | ||
|
||
```dart | ||
final client = InstabugHttpClient(); | ||
``` | ||
|
||
Then proceed to use the package normally: | ||
|
||
```dart | ||
final response = await client.get(Uri.parse(URL)); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 7e9793dee1b85a243edd0e06cb1658e98b077561 | ||
channel: stable | ||
|
||
project_type: app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# example | ||
|
||
A new Flutter project. | ||
|
||
## Getting Started | ||
|
||
This project is a starting point for a Flutter application. | ||
|
||
A few resources to get you started if this is your first Flutter project: | ||
|
||
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) | ||
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) | ||
|
||
For help getting started with Flutter, view our | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. |
29 changes: 29 additions & 0 deletions
29
packages/instabug_http_client/example/analysis_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This file configures the analyzer, which statically analyzes Dart code to | ||
# check for errors, warnings, and lints. | ||
# | ||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled | ||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be | ||
# invoked from the command line by running `flutter analyze`. | ||
|
||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
linter: | ||
# The lint rules applied to this project can be customized in the | ||
# section below to disable rules from the `package:flutter_lints/flutter.yaml` | ||
# included above or to enable additional rules. A list of all available lints | ||
# and their documentation is published at | ||
# https://dart-lang.github.io/linter/lints/index.html. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
gradle-wrapper.jar | ||
/.gradle | ||
/captures/ | ||
/gradlew | ||
/gradlew.bat | ||
/local.properties | ||
GeneratedPluginRegistrant.java | ||
|
||
# Remember to never publicly share your keystore. | ||
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app | ||
key.properties | ||
**/*.keystore | ||
**/*.jks |
68 changes: 68 additions & 0 deletions
68
packages/instabug_http_client/example/android/app/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
def localProperties = new Properties() | ||
def localPropertiesFile = rootProject.file('local.properties') | ||
if (localPropertiesFile.exists()) { | ||
localPropertiesFile.withReader('UTF-8') { reader -> | ||
localProperties.load(reader) | ||
} | ||
} | ||
|
||
def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
if (flutterRoot == null) { | ||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
} | ||
|
||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | ||
if (flutterVersionCode == null) { | ||
flutterVersionCode = '1' | ||
} | ||
|
||
def flutterVersionName = localProperties.getProperty('flutter.versionName') | ||
if (flutterVersionName == null) { | ||
flutterVersionName = '1.0' | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
|
||
android { | ||
compileSdkVersion flutter.compileSdkVersion | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
} | ||
|
||
defaultConfig { | ||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
applicationId "com.example.example" | ||
minSdkVersion flutter.minSdkVersion | ||
targetSdkVersion flutter.targetSdkVersion | ||
versionCode flutterVersionCode.toInteger() | ||
versionName flutterVersionName | ||
} | ||
|
||
buildTypes { | ||
release { | ||
// TODO: Add your own signing config for the release build. | ||
// Signing with the debug keys for now, so `flutter run --release` works. | ||
signingConfig signingConfigs.debug | ||
} | ||
} | ||
} | ||
|
||
flutter { | ||
source '../..' | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/instabug_http_client/example/android/app/src/debug/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.example"> | ||
<!-- Flutter needs it to communicate with the running application | ||
to allow setting breakpoints, to provide hot reload, etc. | ||
--> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
</manifest> |
36 changes: 36 additions & 0 deletions
36
packages/instabug_http_client/example/android/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.example"> | ||
<application | ||
android:label="example" | ||
android:name="${applicationName}" | ||
android:icon="@mipmap/ic_launcher" | ||
android:networkSecurityConfig="@xml/network_security_config" | ||
android:usesCleartextTraffic="true"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true" | ||
android:launchMode="singleTop" | ||
android:theme="@style/LaunchTheme" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
<!-- Specifies an Android theme to apply to this Activity as soon as | ||
the Android process has started. This theme is visible to the user | ||
while the Flutter UI initializes. After that, this theme continues | ||
to determine the Window background behind the Flutter UI. --> | ||
<meta-data | ||
android:name="io.flutter.embedding.android.NormalTheme" | ||
android:resource="@style/NormalTheme" | ||
/> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<!-- Don't delete the meta-data below. | ||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> | ||
<meta-data | ||
android:name="flutterEmbedding" | ||
android:value="2" /> | ||
</application> | ||
</manifest> |
Oops, something went wrong.