Skip to content

Commit 98f3c3c

Browse files
authored
Rename Conflicting Enums + Formating (#73)
* Renames `Locale` to `IBGLocale` * Renames `IBGCustomTextPlaceHolderKey` to `CustomTextPlaceHolderKey` * Formating code using `flutter format` as per <https://pub.dev/packages/instabug#-analysis-tab-> * Updates Changelog & Readme * Automates Changelog Release on Github using Escape
1 parent c5ed8db commit 98f3c3c

File tree

19 files changed

+408
-392
lines changed

19 files changed

+408
-392
lines changed

.circleci/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ jobs:
8484
steps:
8585
- checkout
8686
- run: ./release.sh
87+
88+
publish:
89+
macos:
90+
xcode: "10.1.0"
91+
steps:
92+
- run: git clone https://InstabugCI:[email protected]/Instabug/Escape.git
93+
- run: cd Escape; swift build -c release -Xswiftc -static-stdlib
94+
- run: cd Escape/.build/release; cp -f Escape /usr/local/bin/escape
95+
- run: Escape flutter publish
8796

8897
workflows:
8998
version: 2
@@ -103,6 +112,12 @@ workflows:
103112
- release:
104113
requires:
105114
- hold
115+
filters:
116+
branches:
117+
only: master
118+
- publish:
119+
requires:
120+
- release
106121
filters:
107122
branches:
108123
only: master

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Version 1.0.0-beta.3 (2019-05-28)
2+
3+
* Fixes `Locale` enum name collision with `dart.ui` library. Use `IBGLocale` instead.
4+
5+
* Updates Native SDK's to version 8.4
6+
17
## Version 1.0.0-beta.2 (2019-05-22)
28

39
**⚠️ Check the README.md integration steps to add our new maven repository in android**

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Instabug for Flutter
22

3+
[![CircleCI](https://circleci.com/gh/Instabug/Instabug-Flutter/tree/master.svg?style=svg)](https://circleci.com/gh/Instabug/Instabug-Flutter/tree/master)
4+
[![pub package](https://img.shields.io/pub/v/instabug.svg)](https://pub.dev/packages/instabug)
5+
36
A Flutter plugin for [Instabug](https://instabug.com/).
47

58
⚠️ While this plugin is currently in beta, it's safe to start using it and ship apps with it to production. If you'd like to give us [feedback](https://github.com/Instabug/Instabug-Flutter/issues) or create a [pull request](https://github.com/Instabug/Instabug-Flutter/pulls), we would highly appreciate it!

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ android {
3434
}
3535

3636
dependencies {
37-
implementation 'com.instabug.library:instabug:8.3.0.2'
37+
implementation 'com.instabug.library:instabug:8.4.0.0'
3838
testImplementation 'junit:junit:4.12'
3939
}

android/src/main/java/com/instabug/instabugflutter/ArgsRegistry.java

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -132,63 +132,63 @@ static void registerInvocationOptionsArgs(Map<String, Object> args) {
132132
}
133133

134134
static void registerLocaleArgs(Map<String, Object> args) {
135-
args.put("Locale.chineseTraditional", new Locale(TRADITIONAL_CHINESE.getCode(), TRADITIONAL_CHINESE.getCountry()));
136-
args.put("Locale.portuguesePortugal", new Locale(PORTUGUESE_PORTUGAL.getCode(), PORTUGUESE_PORTUGAL.getCountry()));
137-
args.put("Locale.chineseSimplified", new Locale(SIMPLIFIED_CHINESE.getCode(), SIMPLIFIED_CHINESE.getCountry()));
138-
args.put("Locale.portugueseBrazil", new Locale(PORTUGUESE_BRAZIL.getCode(), PORTUGUESE_BRAZIL.getCountry()));
139-
args.put("Locale.indonesian", new Locale(INDONESIAN.getCode(), INDONESIAN.getCountry()));
140-
args.put("Locale.dutch", new Locale(NETHERLANDS.getCode(), NETHERLANDS.getCountry()));
141-
args.put("Locale.norwegian", new Locale(NORWEGIAN.getCode(), NORWEGIAN.getCountry()));
142-
args.put("Locale.japanese", new Locale(JAPANESE.getCode(), JAPANESE.getCountry()));
143-
args.put("Locale.english", new Locale(ENGLISH.getCode(), ENGLISH.getCountry()));
144-
args.put("Locale.italian", new Locale(ITALIAN.getCode(), ITALIAN.getCountry()));
145-
args.put("Locale.russian", new Locale(RUSSIAN.getCode(), RUSSIAN.getCountry()));
146-
args.put("Locale.spanish", new Locale(SPANISH.getCode(), SPANISH.getCountry()));
147-
args.put("Locale.swedish", new Locale(SWEDISH.getCode(), SWEDISH.getCountry()));
148-
args.put("Locale.turkish", new Locale(TURKISH.getCode(), TURKISH.getCountry()));
149-
args.put("Locale.arabic", new Locale(ARABIC.getCode(), ARABIC.getCountry()));
150-
args.put("Locale.danish", new Locale(DANISH.getCode(), DANISH.getCountry()));
151-
args.put("Locale.french", new Locale(FRENCH.getCode(), FRENCH.getCountry()));
152-
args.put("Locale.german", new Locale(GERMAN.getCode(), GERMAN.getCountry()));
153-
args.put("Locale.korean", new Locale(KOREAN.getCode(), KOREAN.getCountry()));
154-
args.put("Locale.polish", new Locale(POLISH.getCode(), POLISH.getCountry()));
155-
args.put("Locale.slovak", new Locale(SLOVAK.getCode(), SLOVAK.getCountry()));
156-
args.put("Locale.czech", new Locale(CZECH.getCode(), CZECH.getCountry()));
135+
args.put("IBGLocale.chineseTraditional", new Locale(TRADITIONAL_CHINESE.getCode(), TRADITIONAL_CHINESE.getCountry()));
136+
args.put("IBGLocale.portuguesePortugal", new Locale(PORTUGUESE_PORTUGAL.getCode(), PORTUGUESE_PORTUGAL.getCountry()));
137+
args.put("IBGLocale.chineseSimplified", new Locale(SIMPLIFIED_CHINESE.getCode(), SIMPLIFIED_CHINESE.getCountry()));
138+
args.put("IBGLocale.portugueseBrazil", new Locale(PORTUGUESE_BRAZIL.getCode(), PORTUGUESE_BRAZIL.getCountry()));
139+
args.put("IBGLocale.indonesian", new Locale(INDONESIAN.getCode(), INDONESIAN.getCountry()));
140+
args.put("IBGLocale.dutch", new Locale(NETHERLANDS.getCode(), NETHERLANDS.getCountry()));
141+
args.put("IBGLocale.norwegian", new Locale(NORWEGIAN.getCode(), NORWEGIAN.getCountry()));
142+
args.put("IBGLocale.japanese", new Locale(JAPANESE.getCode(), JAPANESE.getCountry()));
143+
args.put("IBGLocale.english", new Locale(ENGLISH.getCode(), ENGLISH.getCountry()));
144+
args.put("IBGLocale.italian", new Locale(ITALIAN.getCode(), ITALIAN.getCountry()));
145+
args.put("IBGLocale.russian", new Locale(RUSSIAN.getCode(), RUSSIAN.getCountry()));
146+
args.put("IBGLocale.spanish", new Locale(SPANISH.getCode(), SPANISH.getCountry()));
147+
args.put("IBGLocale.swedish", new Locale(SWEDISH.getCode(), SWEDISH.getCountry()));
148+
args.put("IBGLocale.turkish", new Locale(TURKISH.getCode(), TURKISH.getCountry()));
149+
args.put("IBGLocale.arabic", new Locale(ARABIC.getCode(), ARABIC.getCountry()));
150+
args.put("IBGLocale.danish", new Locale(DANISH.getCode(), DANISH.getCountry()));
151+
args.put("IBGLocale.french", new Locale(FRENCH.getCode(), FRENCH.getCountry()));
152+
args.put("IBGLocale.german", new Locale(GERMAN.getCode(), GERMAN.getCountry()));
153+
args.put("IBGLocale.korean", new Locale(KOREAN.getCode(), KOREAN.getCountry()));
154+
args.put("IBGLocale.polish", new Locale(POLISH.getCode(), POLISH.getCountry()));
155+
args.put("IBGLocale.slovak", new Locale(SLOVAK.getCode(), SLOVAK.getCountry()));
156+
args.put("IBGLocale.czech", new Locale(CZECH.getCode(), CZECH.getCountry()));
157157
}
158158

159159
static void registerCustomTextPlaceHolderKeysArgs(Map<String, Object> args) {
160-
args.put("IBGCustomTextPlaceHolderKey.shakeHint", InstabugCustomTextPlaceHolder.Key.SHAKE_HINT);
161-
args.put("IBGCustomTextPlaceHolderKey.swipeHint", InstabugCustomTextPlaceHolder.Key.SWIPE_HINT);
162-
args.put("IBGCustomTextPlaceHolderKey.invalidEmailMessage", InstabugCustomTextPlaceHolder.Key.INVALID_EMAIL_MESSAGE);
163-
args.put("IBGCustomTextPlaceHolderKey.invalidCommentMessage", InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE);
164-
args.put("IBGCustomTextPlaceHolderKey.invocationHeader", InstabugCustomTextPlaceHolder.Key.INVOCATION_HEADER);
165-
args.put("IBGCustomTextPlaceHolderKey.startChats", InstabugCustomTextPlaceHolder.Key.START_CHATS);
166-
args.put("IBGCustomTextPlaceHolderKey.reportBug", InstabugCustomTextPlaceHolder.Key.REPORT_BUG);
167-
args.put("IBGCustomTextPlaceHolderKey.reportFeedback", InstabugCustomTextPlaceHolder.Key.REPORT_FEEDBACK);
168-
args.put("IBGCustomTextPlaceHolderKey.emailFieldHint", InstabugCustomTextPlaceHolder.Key.EMAIL_FIELD_HINT);
169-
args.put("IBGCustomTextPlaceHolderKey.commentFieldHintForBugReport", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT);
170-
args.put("IBGCustomTextPlaceHolderKey.commentFieldHintForFeedback", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_FEEDBACK);
171-
args.put("IBGCustomTextPlaceHolderKey.addVoiceMessage", InstabugCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE);
172-
args.put("IBGCustomTextPlaceHolderKey.addImageFromGallery", InstabugCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY);
173-
args.put("IBGCustomTextPlaceHolderKey.addExtraScreenshot", InstabugCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT);
174-
args.put("IBGCustomTextPlaceHolderKey.conversationsListTitle", InstabugCustomTextPlaceHolder.Key.CONVERSATIONS_LIST_TITLE);
175-
args.put("IBGCustomTextPlaceHolderKey.audioRecordingPermissionDenied", InstabugCustomTextPlaceHolder.Key.AUDIO_RECORDING_PERMISSION_DENIED);
176-
args.put("IBGCustomTextPlaceHolderKey.conversationTextFieldHint", InstabugCustomTextPlaceHolder.Key.CONVERSATION_TEXT_FIELD_HINT);
177-
args.put("IBGCustomTextPlaceHolderKey.bugReportHeader", InstabugCustomTextPlaceHolder.Key.BUG_REPORT_HEADER);
178-
args.put("IBGCustomTextPlaceHolderKey.feedbackReportHeader", InstabugCustomTextPlaceHolder.Key.FEEDBACK_REPORT_HEADER);
179-
args.put("IBGCustomTextPlaceHolderKey.voiceMessagePressAndHoldToRecord", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD);
180-
args.put("IBGCustomTextPlaceHolderKey.voiceMessageReleaseToAttach", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_RELEASE_TO_ATTACH);
181-
args.put("IBGCustomTextPlaceHolderKey.reportSuccessfullySent", InstabugCustomTextPlaceHolder.Key.REPORT_SUCCESSFULLY_SENT);
182-
args.put("IBGCustomTextPlaceHolderKey.successDialogHeader", InstabugCustomTextPlaceHolder.Key.SUCCESS_DIALOG_HEADER);
183-
args.put("IBGCustomTextPlaceHolderKey.addVideo", InstabugCustomTextPlaceHolder.Key.ADD_VIDEO);
184-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE);
185-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT);
186-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE);
187-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT);
188-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageFinishStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE);
189-
args.put("IBGCustomTextPlaceHolderKey.betaWelcomeMessageFinishStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT);
190-
args.put("IBGCustomTextPlaceHolderKey.liveWelcomeMessageTitle", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE);
191-
args.put("IBGCustomTextPlaceHolderKey.liveWelcomeMessageContent", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT);
160+
args.put("CustomTextPlaceHolderKey.shakeHint", InstabugCustomTextPlaceHolder.Key.SHAKE_HINT);
161+
args.put("CustomTextPlaceHolderKey.swipeHint", InstabugCustomTextPlaceHolder.Key.SWIPE_HINT);
162+
args.put("CustomTextPlaceHolderKey.invalidEmailMessage", InstabugCustomTextPlaceHolder.Key.INVALID_EMAIL_MESSAGE);
163+
args.put("CustomTextPlaceHolderKey.invalidCommentMessage", InstabugCustomTextPlaceHolder.Key.INVALID_COMMENT_MESSAGE);
164+
args.put("CustomTextPlaceHolderKey.invocationHeader", InstabugCustomTextPlaceHolder.Key.INVOCATION_HEADER);
165+
args.put("CustomTextPlaceHolderKey.startChats", InstabugCustomTextPlaceHolder.Key.START_CHATS);
166+
args.put("CustomTextPlaceHolderKey.reportBug", InstabugCustomTextPlaceHolder.Key.REPORT_BUG);
167+
args.put("CustomTextPlaceHolderKey.reportFeedback", InstabugCustomTextPlaceHolder.Key.REPORT_FEEDBACK);
168+
args.put("CustomTextPlaceHolderKey.emailFieldHint", InstabugCustomTextPlaceHolder.Key.EMAIL_FIELD_HINT);
169+
args.put("CustomTextPlaceHolderKey.commentFieldHintForBugReport", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_BUG_REPORT);
170+
args.put("CustomTextPlaceHolderKey.commentFieldHintForFeedback", InstabugCustomTextPlaceHolder.Key.COMMENT_FIELD_HINT_FOR_FEEDBACK);
171+
args.put("CustomTextPlaceHolderKey.addVoiceMessage", InstabugCustomTextPlaceHolder.Key.ADD_VOICE_MESSAGE);
172+
args.put("CustomTextPlaceHolderKey.addImageFromGallery", InstabugCustomTextPlaceHolder.Key.ADD_IMAGE_FROM_GALLERY);
173+
args.put("CustomTextPlaceHolderKey.addExtraScreenshot", InstabugCustomTextPlaceHolder.Key.ADD_EXTRA_SCREENSHOT);
174+
args.put("CustomTextPlaceHolderKey.conversationsListTitle", InstabugCustomTextPlaceHolder.Key.CONVERSATIONS_LIST_TITLE);
175+
args.put("CustomTextPlaceHolderKey.audioRecordingPermissionDenied", InstabugCustomTextPlaceHolder.Key.AUDIO_RECORDING_PERMISSION_DENIED);
176+
args.put("CustomTextPlaceHolderKey.conversationTextFieldHint", InstabugCustomTextPlaceHolder.Key.CONVERSATION_TEXT_FIELD_HINT);
177+
args.put("CustomTextPlaceHolderKey.bugReportHeader", InstabugCustomTextPlaceHolder.Key.BUG_REPORT_HEADER);
178+
args.put("CustomTextPlaceHolderKey.feedbackReportHeader", InstabugCustomTextPlaceHolder.Key.FEEDBACK_REPORT_HEADER);
179+
args.put("CustomTextPlaceHolderKey.voiceMessagePressAndHoldToRecord", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_PRESS_AND_HOLD_TO_RECORD);
180+
args.put("CustomTextPlaceHolderKey.voiceMessageReleaseToAttach", InstabugCustomTextPlaceHolder.Key.VOICE_MESSAGE_RELEASE_TO_ATTACH);
181+
args.put("CustomTextPlaceHolderKey.reportSuccessfullySent", InstabugCustomTextPlaceHolder.Key.REPORT_SUCCESSFULLY_SENT);
182+
args.put("CustomTextPlaceHolderKey.successDialogHeader", InstabugCustomTextPlaceHolder.Key.SUCCESS_DIALOG_HEADER);
183+
args.put("CustomTextPlaceHolderKey.addVideo", InstabugCustomTextPlaceHolder.Key.ADD_VIDEO);
184+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_TITLE);
185+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageWelcomeStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_WELCOME_STEP_CONTENT);
186+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_TITLE);
187+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageHowToReportStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_HOW_TO_REPORT_STEP_CONTENT);
188+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageFinishStepTitle", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_TITLE);
189+
args.put("CustomTextPlaceHolderKey.betaWelcomeMessageFinishStepContent", InstabugCustomTextPlaceHolder.Key.BETA_WELCOME_MESSAGE_FINISH_STEP_CONTENT);
190+
args.put("CustomTextPlaceHolderKey.liveWelcomeMessageTitle", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_TITLE);
191+
args.put("CustomTextPlaceHolderKey.liveWelcomeMessageContent", InstabugCustomTextPlaceHolder.Key.LIVE_WELCOME_MESSAGE_CONTENT);
192192
}
193193

194194
static void registerInstabugReportTypesArgs(Map<String, Object> args) {

android/src/test/java/com/instabug/instabugflutter/ArgsRegistryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class ArgsRegistryTest {
8686
@Test
8787
public void givenEnglishLocaleIsPresent_when$getDeserializedValue_thenShouldReturnNonNullLocale() {
8888
// when
89-
Locale actualLocale = ArgsRegistry.getDeserializedValue("Locale.english", Locale.class);
89+
Locale actualLocale = ArgsRegistry.getDeserializedValue("IBGLocale.english", Locale.class);
9090
// then
9191
Assert.assertNotNull(actualLocale);
9292
Assert.assertEquals("en", actualLocale.getLanguage());
@@ -106,7 +106,7 @@ public class ArgsRegistryTest {
106106
public void givenShakeHintIsPresent_when$getDeserializedValue_thenShouldReturnNonNullKey() {
107107
// when
108108
InstabugCustomTextPlaceHolder.Key actualKey =
109-
ArgsRegistry.getDeserializedValue("IBGCustomTextPlaceHolderKey.shakeHint", InstabugCustomTextPlaceHolder.Key.class);
109+
ArgsRegistry.getDeserializedValue("CustomTextPlaceHolderKey.shakeHint", InstabugCustomTextPlaceHolder.Key.class);
110110
// then
111111
Assert.assertNotNull(actualKey);
112112
Assert.assertEquals(InstabugCustomTextPlaceHolder.Key.SHAKE_HINT, actualKey);

example/android/app/src/main/java/com/instabug/instabugflutterexample/CustomFlutterApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public void onCreate() {
1111
super.onCreate();
1212
ArrayList<String> invocation_events = new ArrayList<>();
1313
invocation_events.add(InstabugFlutterPlugin.INVOCATION_EVENT_FLOATING_BUTTON);
14-
new InstabugFlutterPlugin().start(CustomFlutterApplication.this, "9582e6cfe34e2b8897f48cfa3b617adb", invocation_events);
14+
new InstabugFlutterPlugin().start(CustomFlutterApplication.this, "YOUR_TOKEN", invocation_events);
1515
}
1616
}

example/lib/main.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import 'dart:async';
22
import 'dart:io' show Platform;
3-
import 'dart:typed_data';
43
import 'package:flutter/material.dart';
54
import 'package:flutter/services.dart';
65
import 'package:instabug/Instabug.dart';
76
import 'package:instabug/BugReporting.dart';
8-
import 'package:instabug/InstabugLog.dart';
97
import 'package:instabug/Surveys.dart';
108
import 'package:instabug/FeatureRequests.dart';
119
import 'package:instabug/Chats.dart';
12-
import 'package:instabug/Replies.dart';
1310

1411
void main() => runApp(MyApp());
1512

@@ -33,7 +30,7 @@ class _MyAppState extends State<MyApp> {
3330
// Platform messages may fail, so we use a try/catch PlatformException.
3431
try {
3532
if (Platform.isIOS) {
36-
Instabug.start('068ba9a8c3615035e163dc5f829c73be', <InvocationEvent>[InvocationEvent.shake]);
33+
Instabug.start('YOUR_TOKEN', <InvocationEvent>[InvocationEvent.shake]);
3734
}
3835
} on PlatformException {
3936
platformVersion = 'Failed to get platform version.';

0 commit comments

Comments
 (0)