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

upgrade gradle version 4.1.2 -> 7.4.2 #261

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.6

* Update gradle version to 7.4.2

## 1.4.5

* Update android to use compileSdkVersion 30
Expand Down
34 changes: 17 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
group 'com.kasem.receive_sharing_intent'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.4.31'
ext.kotlin_version = '1.9.22'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:8.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id "com.android.library"
id "kotlin-android"
}

group 'com.kasem.receive_sharing_intent'
version '1.6.6'

rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
if (project.android.hasProperty("namespace")) {
namespace 'com.kasem.receive_sharing_intent'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
compileSdk 34
minSdkVersion 24
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
6 changes: 3 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {

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.")
throw new RuntimeException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand All @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -40,7 +40,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.kasem.receive_sharing_intent_example"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.4.31'
ext.kotlin_version = '1.9.22'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
cupertino_icons: ^1.0.5

dev_dependencies:
flutter_test:
Expand Down
6 changes: 3 additions & 3 deletions example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:receive_sharing_intent_example/main.dart';
import '../lib/main.dart';

void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
Expand All @@ -18,8 +18,8 @@ void main() {
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) => widget is Text &&
widget.data?.startsWith('Running on:') == true,
(Widget widget) =>
widget is Text && widget.data?.startsWith('Running on:') == true,
),
findsOneWidget,
);
Expand Down
15 changes: 5 additions & 10 deletions ios/Classes/SwiftReceiveSharingIntentPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ public class SwiftReceiveSharingIntentPlugin: NSObject, FlutterPlugin, FlutterSt
private var eventSinkMedia: FlutterEventSink? = nil;
private var eventSinkText: FlutterEventSink? = nil;

// Singleton is required for calling functions directly from AppDelegate
// - it is required if the developer is using also another library, which requires to call "application(_:open:options:)"
// -> see Example app
public static let instance = SwiftReceiveSharingIntentPlugin()

public static func register(with registrar: FlutterPluginRegistrar) {
let instance = SwiftReceiveSharingIntentPlugin()

let channel = FlutterMethodChannel(name: kMessagesChannel, binaryMessenger: registrar.messenger())
registrar.addMethodCallDelegate(instance, channel: channel)

Expand Down Expand Up @@ -54,11 +52,9 @@ public class SwiftReceiveSharingIntentPlugin: NSObject, FlutterPlugin, FlutterSt
}
}

// By Adding bundle id to prefix, we'll ensure that the correct application will be openned
// - found the issue while developing multiple applications using this library, after "application(_:open:options:)" is called, the first app using this librabry (first app by bundle id alphabetically) is opened
public func hasMatchingSchemePrefix(url: URL?) -> Bool {
if let url = url, let appDomain = Bundle.main.bundleIdentifier {
return url.absoluteString.hasPrefix("\(self.customSchemePrefix)-\(appDomain)")
if let url = url {
return url.absoluteString.hasPrefix(self.customSchemePrefix)
}
return false
}
Expand Down Expand Up @@ -121,8 +117,7 @@ public class SwiftReceiveSharingIntentPlugin: NSObject, FlutterPlugin, FlutterSt
private func handleUrl(url: URL?, setInitialData: Bool) -> Bool {
if let url = url {
let appDomain = Bundle.main.bundleIdentifier!
let appGroupId = (Bundle.main.object(forInfoDictionaryKey: "AppGroupId") as? String) ?? "group.\(Bundle.main.bundleIdentifier!)"
let userDefaults = UserDefaults(suiteName: appGroupId)
let userDefaults = UserDefaults(suiteName: "group.\(appDomain)")
if url.fragment == "media" {
if let key = url.host?.components(separatedBy: "=").last,
let json = userDefaults?.object(forKey: key) as? Data {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: receive_sharing_intent
description: A flutter plugin that enables flutter apps to receive sharing photos, text or url from other apps.
version: 1.4.5
version: 1.4.6
homepage: https://github.com/KasemJaffer/receive_sharing_intent

environment:
Expand Down