From c6c4f016403e86b6da19093ae121e338ef8c3244 Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Tue, 11 Feb 2025 14:33:46 +0530 Subject: [PATCH 1/6] updated sdk version --- platform_device_id/pubspec.yaml | 6 +++--- platform_device_id_linux/pubspec.yaml | 4 ++-- platform_device_id_macos/pubspec.yaml | 4 ++-- platform_device_id_platform_interface/pubspec.yaml | 4 ++-- platform_device_id_web/pubspec.yaml | 4 ++-- platform_device_id_windows/pubspec.yaml | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platform_device_id/pubspec.yaml b/platform_device_id/pubspec.yaml index 3f974f6..c50d3ad 100644 --- a/platform_device_id/pubspec.yaml +++ b/platform_device_id/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.6 homepage: https://github.com/acmonetwork/platform_device_id_plus environment: - sdk: ">=2.16.1 <3.0.0" - flutter: ">=1.22.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: platform_device_id_linux: ^1.0.0 platform_device_id_web: ^1.0.0 platform_device_id_windows: ^1.0.0 - device_info_plus: ^10.1.0 + device_info_plus: ^11.3.0 android_id: ^0.4.0 dev_dependencies: diff --git a/platform_device_id_linux/pubspec.yaml b/platform_device_id_linux/pubspec.yaml index bc675e2..031e3fe 100644 --- a/platform_device_id_linux/pubspec.yaml +++ b/platform_device_id_linux/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: diff --git a/platform_device_id_macos/pubspec.yaml b/platform_device_id_macos/pubspec.yaml index e7eaa00..56e04de 100644 --- a/platform_device_id_macos/pubspec.yaml +++ b/platform_device_id_macos/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_macos environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: diff --git a/platform_device_id_platform_interface/pubspec.yaml b/platform_device_id_platform_interface/pubspec.yaml index dd1b5fe..b3a503a 100644 --- a/platform_device_id_platform_interface/pubspec.yaml +++ b/platform_device_id_platform_interface/pubspec.yaml @@ -4,8 +4,8 @@ homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform version: 1.0.0 environment: - sdk: '>=2.12.0 <3.0.0' - flutter: ">=1.22.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: diff --git a/platform_device_id_web/pubspec.yaml b/platform_device_id_web/pubspec.yaml index 6aa7be0..90ce705 100644 --- a/platform_device_id_web/pubspec.yaml +++ b/platform_device_id_web/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: diff --git a/platform_device_id_windows/pubspec.yaml b/platform_device_id_windows/pubspec.yaml index d8160c2..e7470ac 100644 --- a/platform_device_id_windows/pubspec.yaml +++ b/platform_device_id_windows/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_windows environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.20.0" + sdk: ">=2.16.0 <4.0.0" + flutter: ">=3.2.0" dependencies: flutter: From 725b9f187a3763edb24b1e428808848e4abc8608 Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Tue, 11 Feb 2025 14:58:22 +0530 Subject: [PATCH 2/6] version update --- platform_device_id_linux/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform_device_id_linux/pubspec.yaml b/platform_device_id_linux/pubspec.yaml index 031e3fe..e6e6a21 100644 --- a/platform_device_id_linux/pubspec.yaml +++ b/platform_device_id_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: platform_device_id_linux description: linux implementation of the platform_device_id plugin. -version: 1.0.0 +version: 1.0.1 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: From 468b61307392e3f6244a806e59ce177ecd637b3e Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Tue, 11 Feb 2025 15:07:29 +0530 Subject: [PATCH 3/6] reverted linux and updated main --- platform_device_id/pubspec.yaml | 2 +- platform_device_id_linux/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform_device_id/pubspec.yaml b/platform_device_id/pubspec.yaml index c50d3ad..41ecc5f 100644 --- a/platform_device_id/pubspec.yaml +++ b/platform_device_id/pubspec.yaml @@ -1,6 +1,6 @@ name: platform_device_id_plus description: This is upgraded version of platform_device_id -version: 1.0.6 +version: 1.0.7 homepage: https://github.com/acmonetwork/platform_device_id_plus environment: diff --git a/platform_device_id_linux/pubspec.yaml b/platform_device_id_linux/pubspec.yaml index e6e6a21..031e3fe 100644 --- a/platform_device_id_linux/pubspec.yaml +++ b/platform_device_id_linux/pubspec.yaml @@ -1,6 +1,6 @@ name: platform_device_id_linux description: linux implementation of the platform_device_id plugin. -version: 1.0.1 +version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: From 19513d9d3998651d3e49fa77342ddd4e6038d060 Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Thu, 20 Mar 2025 16:37:08 +0530 Subject: [PATCH 4/6] fixed namespace issue and flutter 3.29 support added --- platform_device_id/CHANGELOG.md | 5 ++ platform_device_id/android/build.gradle | 3 + .../PlatformDeviceIdPlugin.kt | 59 ++++++----------- platform_device_id/example/.metadata | 24 ++++++- .../example/analysis_options.yaml | 28 +++++++++ platform_device_id/example/android/.gitignore | 7 +++ .../example/android/app/build.gradle | 63 ------------------- .../example/android/app/build.gradle.kts | 44 +++++++++++++ .../android/app/src/debug/AndroidManifest.xml | 6 +- .../android/app/src/main/AndroidManifest.xml | 33 +++++----- .../com/di1shuai/example/MainActivity.kt | 6 -- .../MainActivity.kt | 6 -- .../MainActivity.kt | 5 ++ .../app/src/main/res/values-night/styles.xml | 4 +- .../app/src/main/res/values/styles.xml | 12 ++-- .../app/src/profile/AndroidManifest.xml | 6 +- .../example/android/build.gradle | 31 --------- .../example/android/build.gradle.kts | 21 +++++++ .../example/android/gradle.properties | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 3 +- .../example/android/settings.gradle | 15 ----- .../example/android/settings.gradle.kts | 25 ++++++++ platform_device_id/example/pubspec.yaml | 7 ++- .../macos/platform_device_id.podspec | 2 +- platform_device_id/pubspec.yaml | 4 +- 25 files changed, 217 insertions(+), 205 deletions(-) create mode 100644 platform_device_id/example/analysis_options.yaml delete mode 100644 platform_device_id/example/android/app/build.gradle create mode 100644 platform_device_id/example/android/app/build.gradle.kts delete mode 100644 platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/example/MainActivity.kt delete mode 100644 platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/platform_device_id_example/MainActivity.kt create mode 100644 platform_device_id/example/android/app/src/main/kotlin/com/example/platform_device_id_example/MainActivity.kt delete mode 100644 platform_device_id/example/android/build.gradle create mode 100644 platform_device_id/example/android/build.gradle.kts delete mode 100644 platform_device_id/example/android/settings.gradle create mode 100644 platform_device_id/example/android/settings.gradle.kts diff --git a/platform_device_id/CHANGELOG.md b/platform_device_id/CHANGELOG.md index 3f1bbd8..404292b 100644 --- a/platform_device_id/CHANGELOG.md +++ b/platform_device_id/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.7 +- Fixed - namespace missing from build.gradle for android +- Fixed - pod install issue in macos +- Flutter 3.29 support + ## 1.0.1 Fix syslink ios error diff --git a/platform_device_id/android/build.gradle b/platform_device_id/android/build.gradle index 2fddb65..dd3f563 100644 --- a/platform_device_id/android/build.gradle +++ b/platform_device_id/android/build.gradle @@ -25,6 +25,9 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + if (project.android.hasProperty("namespace")) { + namespace 'com.di1shuai.platform_device_id' + } compileSdkVersion 34 sourceSets { diff --git a/platform_device_id/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt b/platform_device_id/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt index bc0d868..dcf3894 100644 --- a/platform_device_id/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt +++ b/platform_device_id/android/src/main/kotlin/com/di1shuai/platform_device_id/PlatformDeviceIdPlugin.kt @@ -1,53 +1,34 @@ package com.di1shuai.platform_device_id -import androidx.annotation.NonNull; - +import androidx.annotation.NonNull import io.flutter.embedding.engine.plugins.FlutterPlugin 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.Registrar /** PlatformDeviceIdPlugin */ -public class PlatformDeviceIdPlugin: FlutterPlugin, MethodCallHandler { - /// The MethodChannel that will the communication between Flutter and native Android - /// - /// This local reference serves to register the plugin with the Flutter Engine and unregister it - /// when the Flutter Engine is detached from the Activity - private lateinit var channel : MethodChannel - - override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - channel = MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "platform_device_id") - channel.setMethodCallHandler(this); - } +class PlatformDeviceIdPlugin : FlutterPlugin, MethodCallHandler { + /// The MethodChannel that will the communication between Flutter and native Android + /// + /// This local reference serves to register the plugin with the Flutter Engine and unregister it + /// when the Flutter Engine is detached from the Activity + private lateinit var channel: MethodChannel - // This static function is optional and equivalent to onAttachedToEngine. It supports the old - // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting - // plugin registration via this function while apps migrate to use the new Android APIs - // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. - // - // It is encouraged to share logic between onAttachedToEngine and registerWith to keep - // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called - // depending on the user's project. onAttachedToEngine or registerWith must both be defined - // in the same class. - companion object { - @JvmStatic - fun registerWith(registrar: Registrar) { - val channel = MethodChannel(registrar.messenger(), "platform_device_id") - channel.setMethodCallHandler(PlatformDeviceIdPlugin()) + override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + channel = MethodChannel(flutterPluginBinding.flutterEngine.dartExecutor, "platform_device_id") + channel.setMethodCallHandler(this) } - } - override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { - if (call.method == "getPlatformVersion") { - result.success("Android ${android.os.Build.VERSION.RELEASE}") - } else { - result.notImplemented() + override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + if (call.method == "getPlatformVersion") { + result.success("Android ${android.os.Build.VERSION.RELEASE}") + } else { + result.notImplemented() + } } - } - override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { - channel.setMethodCallHandler(null) - } -} + override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } +} \ No newline at end of file diff --git a/platform_device_id/example/.metadata b/platform_device_id/example/.metadata index 625d6e1..01965b7 100644 --- a/platform_device_id/example/.metadata +++ b/platform_device_id/example/.metadata @@ -4,7 +4,27 @@ # This file should be version controlled and should not be manually edited. version: - revision: d3ed9ec945f8869f0e136c357d0c2a6be2b60c98 - channel: beta + revision: "c23637390482d4cf9598c3ce3f2be31aa7332daf" + channel: "stable" project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + - platform: android + create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/platform_device_id/example/analysis_options.yaml b/platform_device_id/example/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/platform_device_id/example/analysis_options.yaml @@ -0,0 +1,28 @@ +# 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.dev/lints. + # + # 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 diff --git a/platform_device_id/example/android/.gitignore b/platform_device_id/example/android/.gitignore index bc2100d..be3943c 100644 --- a/platform_device_id/example/android/.gitignore +++ b/platform_device_id/example/android/.gitignore @@ -5,3 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/platform_device_id/example/android/app/build.gradle b/platform_device_id/example/android/app/build.gradle deleted file mode 100644 index 00971e3..0000000 --- a/platform_device_id/example/android/app/build.gradle +++ /dev/null @@ -1,63 +0,0 @@ -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 34 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.di1shuai.platform_device_id_example" - minSdkVersion 21 - targetSdkVersion 33 - 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" -} diff --git a/platform_device_id/example/android/app/build.gradle.kts b/platform_device_id/example/android/app/build.gradle.kts new file mode 100644 index 0000000..0db8c2d --- /dev/null +++ b/platform_device_id/example/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.platform_device_id_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = "27.0.12077973" + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.platform_device_id_example" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + 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.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/platform_device_id/example/android/app/src/debug/AndroidManifest.xml b/platform_device_id/example/android/app/src/debug/AndroidManifest.xml index d4cbf43..399f698 100644 --- a/platform_device_id/example/android/app/src/debug/AndroidManifest.xml +++ b/platform_device_id/example/android/app/src/debug/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/platform_device_id/example/android/app/src/main/AndroidManifest.xml b/platform_device_id/example/android/app/src/main/AndroidManifest.xml index 57f10af..b6df25e 100644 --- a/platform_device_id/example/android/app/src/main/AndroidManifest.xml +++ b/platform_device_id/example/android/app/src/main/AndroidManifest.xml @@ -1,19 +1,13 @@ - - + - - @@ -47,4 +31,15 @@ android:name="flutterEmbedding" android:value="2" /> + + + + + + + diff --git a/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/example/MainActivity.kt b/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/example/MainActivity.kt deleted file mode 100644 index 33b266a..0000000 --- a/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.di1shuai.example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/platform_device_id_example/MainActivity.kt b/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/platform_device_id_example/MainActivity.kt deleted file mode 100644 index dea17f9..0000000 --- a/platform_device_id/example/android/app/src/main/kotlin/com/di1shuai/platform_device_id_example/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.di1shuai.platform_device_id_example - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/platform_device_id/example/android/app/src/main/kotlin/com/example/platform_device_id_example/MainActivity.kt b/platform_device_id/example/android/app/src/main/kotlin/com/example/platform_device_id_example/MainActivity.kt new file mode 100644 index 0000000..dc67d5f --- /dev/null +++ b/platform_device_id/example/android/app/src/main/kotlin/com/example/platform_device_id_example/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.platform_device_id_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/platform_device_id/example/android/app/src/main/res/values-night/styles.xml b/platform_device_id/example/android/app/src/main/res/values-night/styles.xml index 449a9f9..06952be 100644 --- a/platform_device_id/example/android/app/src/main/res/values-night/styles.xml +++ b/platform_device_id/example/android/app/src/main/res/values-night/styles.xml @@ -3,14 +3,14 @@ - diff --git a/platform_device_id/example/android/app/src/profile/AndroidManifest.xml b/platform_device_id/example/android/app/src/profile/AndroidManifest.xml index d4cbf43..399f698 100644 --- a/platform_device_id/example/android/app/src/profile/AndroidManifest.xml +++ b/platform_device_id/example/android/app/src/profile/AndroidManifest.xml @@ -1,6 +1,6 @@ - - diff --git a/platform_device_id/example/android/build.gradle b/platform_device_id/example/android/build.gradle deleted file mode 100644 index e0e4f0a..0000000 --- a/platform_device_id/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.7.10' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/platform_device_id/example/android/build.gradle.kts b/platform_device_id/example/android/build.gradle.kts new file mode 100644 index 0000000..89176ef --- /dev/null +++ b/platform_device_id/example/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/platform_device_id/example/android/gradle.properties b/platform_device_id/example/android/gradle.properties index 38c8d45..f018a61 100644 --- a/platform_device_id/example/android/gradle.properties +++ b/platform_device_id/example/android/gradle.properties @@ -1,4 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/platform_device_id/example/android/gradle/wrapper/gradle-wrapper.properties b/platform_device_id/example/android/gradle/wrapper/gradle-wrapper.properties index 89e56bd..afa1e8e 100644 --- a/platform_device_id/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/platform_device_id/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/platform_device_id/example/android/settings.gradle b/platform_device_id/example/android/settings.gradle deleted file mode 100644 index 5a2f14f..0000000 --- a/platform_device_id/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/platform_device_id/example/android/settings.gradle.kts b/platform_device_id/example/android/settings.gradle.kts new file mode 100644 index 0000000..a439442 --- /dev/null +++ b/platform_device_id/example/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.0" apply false + id("org.jetbrains.kotlin.android") version "1.8.22" apply false +} + +include(":app") diff --git a/platform_device_id/example/pubspec.yaml b/platform_device_id/example/pubspec.yaml index 659f723..6c69ab3 100644 --- a/platform_device_id/example/pubspec.yaml +++ b/platform_device_id/example/pubspec.yaml @@ -4,14 +4,15 @@ description: Demonstrates how to use the platform_device_id plugin. publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: flutter: sdk: flutter - platform_device_id_plus: - path: ../ + # platform_device_id_plus: + # path: ../ + platform_device_id_plus: ^1.0.7 cupertino_icons: ^1.0.2 dev_dependencies: diff --git a/platform_device_id/macos/platform_device_id.podspec b/platform_device_id/macos/platform_device_id.podspec index 23f6e47..5a699ce 100644 --- a/platform_device_id/macos/platform_device_id.podspec +++ b/platform_device_id/macos/platform_device_id.podspec @@ -3,7 +3,7 @@ # Run `pod lib lint platform_device_id.podspec' to validate before publishing. # Pod::Spec.new do |s| - s.name = 'platform_device_id' + s.name = 'platform_device_id_plus' s.version = '0.0.1' s.summary = 'macos for platform_device_id plugin.' s.description = <<-DESC diff --git a/platform_device_id/pubspec.yaml b/platform_device_id/pubspec.yaml index 41ecc5f..6577bbd 100644 --- a/platform_device_id/pubspec.yaml +++ b/platform_device_id/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.7 homepage: https://github.com/acmonetwork/platform_device_id_plus environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" dependencies: flutter: From 9f89ec47554bdac4cf4d67a87559141cabfc27be Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Thu, 20 Mar 2025 16:37:25 +0530 Subject: [PATCH 5/6] few changes --- platform_device_id_linux/pubspec.yaml | 4 ++-- .../macos/platform_device_id_macos.podspec | 2 +- platform_device_id_macos/pubspec.yaml | 4 ++-- platform_device_id_platform_interface/pubspec.yaml | 4 ++-- platform_device_id_web/pubspec.yaml | 4 ++-- platform_device_id_windows/pubspec.yaml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/platform_device_id_linux/pubspec.yaml b/platform_device_id_linux/pubspec.yaml index 031e3fe..87e318d 100644 --- a/platform_device_id_linux/pubspec.yaml +++ b/platform_device_id_linux/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: diff --git a/platform_device_id_macos/macos/platform_device_id_macos.podspec b/platform_device_id_macos/macos/platform_device_id_macos.podspec index 98d9f4b..5c2aaf9 100644 --- a/platform_device_id_macos/macos/platform_device_id_macos.podspec +++ b/platform_device_id_macos/macos/platform_device_id_macos.podspec @@ -3,7 +3,7 @@ # Run `pod lib lint platform_device_id.podspec' to validate before publishing. # Pod::Spec.new do |s| - s.name = 'platform_device_id_macos' + s.name = 'platform_device_id_plus' s.version = '0.0.1' s.summary = 'Flutter macos for platform_device_id plugin.' s.description = <<-DESC diff --git a/platform_device_id_macos/pubspec.yaml b/platform_device_id_macos/pubspec.yaml index 56e04de..a877f18 100644 --- a/platform_device_id_macos/pubspec.yaml +++ b/platform_device_id_macos/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_macos environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: diff --git a/platform_device_id_platform_interface/pubspec.yaml b/platform_device_id_platform_interface/pubspec.yaml index b3a503a..7d486d4 100644 --- a/platform_device_id_platform_interface/pubspec.yaml +++ b/platform_device_id_platform_interface/pubspec.yaml @@ -4,8 +4,8 @@ homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform version: 1.0.0 environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: diff --git a/platform_device_id_web/pubspec.yaml b/platform_device_id_web/pubspec.yaml index 90ce705..a982e3a 100644 --- a/platform_device_id_web/pubspec.yaml +++ b/platform_device_id_web/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_linux environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: diff --git a/platform_device_id_windows/pubspec.yaml b/platform_device_id_windows/pubspec.yaml index e7470ac..08b3f6d 100644 --- a/platform_device_id_windows/pubspec.yaml +++ b/platform_device_id_windows/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.0.0 homepage: https://github.com/BestBurning/platform_device_id/tree/master/platform_device_id_windows environment: - sdk: ">=2.16.0 <4.0.0" - flutter: ">=3.2.0" + sdk: ">=2.19.0 <4.0.0" + flutter: ">=3.7.0" dependencies: flutter: From a8316fa60374f09e9950053fe435fad5cc1fb924 Mon Sep 17 00:00:00 2001 From: basharatmehdi Date: Thu, 20 Mar 2025 16:38:41 +0530 Subject: [PATCH 6/6] back to local dependency --- platform_device_id/example/pubspec.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform_device_id/example/pubspec.yaml b/platform_device_id/example/pubspec.yaml index 6c69ab3..4cfcbdb 100644 --- a/platform_device_id/example/pubspec.yaml +++ b/platform_device_id/example/pubspec.yaml @@ -10,9 +10,8 @@ dependencies: flutter: sdk: flutter - # platform_device_id_plus: - # path: ../ - platform_device_id_plus: ^1.0.7 + platform_device_id_plus: + path: ../ cupertino_icons: ^1.0.2 dev_dependencies: