-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update tooling to latest version #54
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cecf17e
eliminated Flutter compiler warnings
2x2xplz eb0aadf
Merge branch 'master' into master
marandaneto 55906f6
Update tooling to latest versions
marandaneto 29dfccf
fix imports
marandaneto 4115e9d
Merge branch 'master' into chore/update-tooling
marandaneto a322208
set java version
marandaneto 2dbf2d7
fix changelog
marandaneto 50fe00c
add changelog
marandaneto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,39 +1,50 @@ | ||
group 'com.posthog.posthog_flutter' | ||
version '1.0-SNAPSHOT' | ||
|
||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.2.1' | ||
classpath 'com.android.tools.build:gradle:7.4.2' | ||
} | ||
} | ||
|
||
rootProject.allprojects { | ||
repositories { | ||
google() | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
mavenCentral() | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
compileSdk 33 | ||
|
||
// Conditional for compatibility with AGP <4.2. | ||
if (project.android.hasProperty("namespace")) { | ||
namespace 'com.posthog.posthog_flutter' | ||
} | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||
minSdkVersion 19 | ||
|
||
ndk { | ||
// Flutter does not currently support building for x86 Android (See Issue 9253). | ||
abiFilters("armeabi-v7a", "x86_64", "arm64-v8a") | ||
} | ||
} | ||
|
||
lintOptions { | ||
disable 'InvalidPackage' | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
dependencies { | ||
implementation 'com.posthog.android:posthog:2.0.3' | ||
api 'com.posthog.android:posthog:2.0.3' | ||
} | ||
} |
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 |
---|---|---|
@@ -1,34 +1,31 @@ | ||
package com.posthog.posthog_flutter; | ||
|
||
import androidx.annotation.NonNull; | ||
import static com.posthog.android.PostHog.LogLevel; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.content.pm.ApplicationInfo; | ||
import android.content.pm.PackageManager; | ||
import android.content.SharedPreferences; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.posthog.android.Middleware; | ||
import com.posthog.android.Options; | ||
import com.posthog.android.PostHog; | ||
import com.posthog.android.PostHogContext; | ||
import com.posthog.android.Properties; | ||
import com.posthog.android.Options; | ||
import com.posthog.android.Middleware; | ||
import com.posthog.android.payloads.BasePayload; | ||
import static com.posthog.android.PostHog.LogLevel; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import io.flutter.embedding.engine.plugins.FlutterPlugin; | ||
import io.flutter.plugin.common.BinaryMessenger; | ||
import io.flutter.plugin.common.MethodCall; | ||
import io.flutter.plugin.common.MethodChannel; | ||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler; | ||
import io.flutter.plugin.common.MethodChannel.Result; | ||
import io.flutter.plugin.common.PluginRegistry; | ||
import io.flutter.embedding.engine.plugins.FlutterPlugin; | ||
|
||
/** PosthogFlutterPlugin */ | ||
public class PosthogFlutterPlugin implements MethodCallHandler, FlutterPlugin { | ||
|
@@ -38,6 +35,7 @@ public class PosthogFlutterPlugin implements MethodCallHandler, FlutterPlugin { | |
static HashMap<String, Object> appendToContextMiddleware; | ||
|
||
/** Plugin registration. */ | ||
@SuppressWarnings("deprecation") | ||
public static void registerWith(PluginRegistry.Registrar registrar) { | ||
final PosthogFlutterPlugin instance = new PosthogFlutterPlugin(); | ||
instance.setupChannels(registrar.context(), registrar.messenger()); | ||
|
@@ -73,8 +71,7 @@ private void setupChannels(Context applicationContext, BinaryMessenger messenger | |
posthogBuilder.logLevel(LogLevel.DEBUG); | ||
} | ||
|
||
// Here we build a middleware that just appends data to the current context | ||
// using the [deepMerge] strategy. | ||
// Here we build a middleware that just appends data to the current context. | ||
posthogBuilder.middleware( | ||
new Middleware() { | ||
@Override | ||
|
@@ -308,19 +305,4 @@ private Options buildOptions(HashMap<String, Object> optionsData) { | |
Options options = new Options(); | ||
return options; | ||
} | ||
|
||
// Merges [newMap] into [original], *not* preserving [original] | ||
// keys (deep) in case of conflicts. | ||
private static Map deepMerge(Map original, Map newMap) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Method was not used |
||
for (Object key : newMap.keySet()) { | ||
if (newMap.get(key) instanceof Map && original.get(key) instanceof Map) { | ||
Map originalChild = (Map) original.get(key); | ||
Map newChild = (Map) newMap.get(key); | ||
original.put(key, deepMerge(originalChild, newChild)); | ||
} else { | ||
original.put(key, newMap.get(key)); | ||
} | ||
} | ||
return original; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.enableR8=true | ||
android.useAndroidX=true | ||
# remove after migrating to Android SDK v3 | ||
android.enableJetifier=true |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Fri Jun 23 08:50:38 CEST 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrate to the new plugin