diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 8e274b0d..d32344ef 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -306,6 +306,8 @@ jobs: sed -i "s/flutter_datetime_picker/flutter_datetime_picker_plus/g" lib/screens/RegisterScreen.dart sed -i "s/file_picker: ^5.2.1/file_picker: ^8.1.2/g" pubspec.yaml sed -i "s/photo_view: ^0.13.0/photo_view: ^0.15.0/g" pubspec.yaml + sed -i "s/dividerColor: Colors.grey.shade200/DividerThemeData(color: Colors.grey.shade200)/g" lib/basic/config/Themes.dart + sed -i "s/AppBarTheme(/AppBarTheme(titleTextStyle: const TextStyle(color: Colors.white),/g" lib/basic/config/Themes.dart find lib -type f -name "*.dart" -exec sed -i "s/.headline4/.headlineMedium/g" {} \; find lib -type f -name "*.dart" -exec sed -i "s/.bodyText1/.bodyMedium/g" {} \; find lib -type f -name "*.dart" -exec sed -i "s/ImageStreamCompleter load(/ImageStreamCompleter loadImage(/g" {} \; @@ -314,6 +316,7 @@ jobs: find lib -type f -name "*.dart" -exec sed -i "s/as ui show Codec/as ui/g" {} \; flutter pub upgrade flutter pub get + cp -rf compatible/* ./ - name: Upgrade deps version (flutter3 mac) if: steps.check_asset.outputs.skip_build != 'true' && startsWith(matrix.config.host, 'macos-') && startsWith(matrix.config.flutter_version, '3.22.3') @@ -327,6 +330,8 @@ jobs: gsed -i "s/flutter_datetime_picker/flutter_datetime_picker_plus/g" lib/screens/RegisterScreen.dart gsed -i "s/file_picker: ^5.2.1/file_picker: ^8.1.2/g" pubspec.yaml gsed -i "s/photo_view: ^0.13.0/photo_view: ^0.15.0/g" pubspec.yaml + gsed -i "s/dividerColor: Colors.grey.shade200/DividerThemeData(color: Colors.grey.shade200)/g" lib/basic/config/Themes.dart + gsed -i "s/AppBarTheme(/AppBarTheme(titleTextStyle: const TextStyle(color: Colors.white),/g" lib/basic/config/Themes.dart find lib -type f -name "*.dart" -exec gsed -i "s/.headline4/.headlineMedium/g" {} \; find lib -type f -name "*.dart" -exec gsed -i "s/.bodyText1/.bodyMedium/g" {} \; find lib -type f -name "*.dart" -exec gsed -i "s/ImageStreamCompleter load(/ImageStreamCompleter loadImage(/g" {} \; diff --git a/compatible/android/app/build.gradle b/compatible/android/app/build.gradle new file mode 100644 index 00000000..c06821ab --- /dev/null +++ b/compatible/android/app/build.gradle @@ -0,0 +1,50 @@ +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 = "opensource.pikapika" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "opensource.pikapika" + // 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.debug + } + } +} + +flutter { + source = "../.." +} + +dependencies { + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1' + implementation fileTree(dir: "../../go/mobile/lib", include: ["*.jar", "*.aar"]) +} + diff --git a/compatible/android/build.gradle b/compatible/android/build.gradle new file mode 100644 index 00000000..d2ffbffa --- /dev/null +++ b/compatible/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = "../build" +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/compatible/android/gradle.properties b/compatible/android/gradle.properties new file mode 100644 index 00000000..25971708 --- /dev/null +++ b/compatible/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/compatible/android/gradle/wrapper/gradle-wrapper.properties b/compatible/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..7bb2df6b --- /dev/null +++ b/compatible/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip diff --git a/compatible/android/settings.gradle b/compatible/android/settings.gradle new file mode 100644 index 00000000..b9e43bd3 --- /dev/null +++ b/compatible/android/settings.gradle @@ -0,0 +1,25 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return 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.1.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false +} + +include ":app"