Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: merge modular package into mono-repo #522

Open
wants to merge 8 commits into
base: refactor/monorepo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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_modular_plugin:
executor: flutter-executor
steps:
- advanced-checkout/shallow-checkout
- setup_flutter
- run: chmod +x packages/instabug_flutter_modular/release.sh
- run: ./packages/instabug_flutter_modular/release.sh

release_instabug_flutter:
macos:
Expand All @@ -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
Expand Down Expand Up @@ -388,6 +396,20 @@ workflows:
filters:
branches:
only: master
- hold_release_modular_plugin:
type: approval
requires:
- test_flutter-stable
filters:
branches:
only: master
- release_modular_plugin:
requires:
- hold_release_modular_plugin
- verify_pub
filters:
branches:
only: master
- release_instabug_flutter:
requires:
- hold_release_instabug_flutter
Expand Down
10 changes: 10 additions & 0 deletions packages/instabug_flutter_modular/.metadata
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: "367f9ea16bfae1ca451b9cc27c1366870b187ae2"
channel: "stable"

project_type: package
7 changes: 7 additions & 0 deletions packages/instabug_flutter_modular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## [v1.0.0](https://github.com/Instabug/instabug_flutter_modular/commits/v1.0.0/) (July 7, 2024)

### Added

- Add support for capturing screen loading time in Flutter Modular v5 ([#477](https://github.com/Instabug/Instabug-Flutter/pull/477)).
21 changes: 21 additions & 0 deletions packages/instabug_flutter_modular/LICENSE
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.
55 changes: 55 additions & 0 deletions packages/instabug_flutter_modular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Instabug Flutter Modular

[![Pub](https://img.shields.io/pub/v/instabug_flutter_modular.svg)](https://pub.dev/packages/instabug_flutter_modular)
[![Twitter](https://img.shields.io/badge/[email protected])](https://twitter.com/Instabug)

An add-on for the [Instabug Flutter SDK](https://github.com/Instabug/Instabug-Flutter) that provides screen loading support for [Flutter Modular](https://pub.dev/packages/flutter_modular) v5.

## Installation

1. Add `instabug_flutter_modular` to your `pubspec.yaml` file.

```yaml
dependencies:
instabug_flutter_modular:
```

2. Install the package by running the following command.

```sh
flutter pub get
```

## Usage

1. Wrap your `AppParentModule` inside `InstabugModule`:


```dart

void main() {
//...

runApp(
ModularApp(
module: InstabugModule(AppModule()),
child: const MyApp(),
),
);
}
```

2. Add `InstabugNavigatorObserver` to your navigation observers list:

```dart
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routeInformationParser: Modular.routeInformationParser,
routerDelegate: Modular.routerDelegate
..setObservers([InstabugNavigatorObserver()]),

// ...
);
}
```
44 changes: 44 additions & 0 deletions packages/instabug_flutter_modular/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.metadata
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
13 changes: 13 additions & 0 deletions packages/instabug_flutter_modular/example/android/.gitignore
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
67 changes: 67 additions & 0 deletions packages/instabug_flutter_modular/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
namespace "com.example.flutter_modular_demo_app"
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

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.flutter_modular_demo_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
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 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool 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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="flutter_modular_demo_app"
android:name="${applicationName}"
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
android:icon="@mipmap/ic_launcher">
<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>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Generated file.
//
// If you wish to remove Flutter's multidex support, delete this entire file.
//
// Modifications to this file should be done in a copy under a different name
// as this file may be regenerated.

package io.flutter.app;

import android.app.Application;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.multidex.MultiDex;

/**
* Extension of {@link android.app.Application}, adding multidex support.
*/
public class FlutterMultiDexApplication extends Application {
@Override
@CallSuper
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.flutter_modular_demo_app

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
Loading