fix: Reintroduce shared isolate (#3981)
* initial scripts n actions * custom cshared isolate * kitlin fixes * integrate and token fix * executable and gstreamer * disable check dupes, fix gstreamer * another linux update, removed 2 android builds * new updates * final android attempt * formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com>pull/2245/head
parent
c6816aea03
commit
57520bf512
@ -1,105 +1,101 @@
|
||||
# #Pangea
|
||||
# name: Pull Request Workflow
|
||||
name: Pull Request Workflow
|
||||
|
||||
# on:
|
||||
# pull_request:
|
||||
# merge_group:
|
||||
on:
|
||||
pull_request:
|
||||
merge_group:
|
||||
|
||||
# jobs:
|
||||
# code_tests:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - run: ./scripts/generate-locale-config.sh
|
||||
# - run: git diff --exit-code
|
||||
# - run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
# - uses: subosito/flutter-action@v2
|
||||
# with:
|
||||
# flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
# cache: true
|
||||
# - run: flutter pub get
|
||||
# - run: flutter gen-l10n
|
||||
# - name: Check formatting
|
||||
# run: dart format lib/ test/ --set-exit-if-changed
|
||||
# - name: Check import formatting
|
||||
# run: dart run import_sorter:main --no-comments --exit-if-changed
|
||||
# - name: Check license compliance
|
||||
# run: dart run license_checker check-licenses -c licenses.yaml --problematic
|
||||
# - run: flutter analyze
|
||||
# - name: Apply google services patch
|
||||
# run: git apply ./scripts/enable-android-google-services.patch
|
||||
# - run: flutter analyze
|
||||
# - run: flutter test
|
||||
jobs:
|
||||
code_tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- run: ./scripts/generate-locale-config.sh
|
||||
- run: git diff --exit-code
|
||||
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
- run: flutter pub get
|
||||
- run: flutter gen-l10n
|
||||
- name: Check formatting
|
||||
run: dart format lib/ test/ --set-exit-if-changed
|
||||
- name: Check import formatting
|
||||
run: dart run import_sorter:main --no-comments --exit-if-changed
|
||||
- name: Check license compliance
|
||||
run: dart run license_checker check-licenses -c licenses.yaml --problematic
|
||||
- run: flutter analyze
|
||||
- name: Add Firebase Messaging # Add android and analyze again
|
||||
run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter analyze
|
||||
- run: flutter test
|
||||
|
||||
# build_apk:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
# - uses: actions/setup-java@v4
|
||||
# with:
|
||||
# java-version: ${{ env.JAVA_VERSION }}
|
||||
# distribution: "zulu"
|
||||
# - uses: subosito/flutter-action@v2
|
||||
# with:
|
||||
# flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
# cache: false
|
||||
# - run: flutter pub get
|
||||
# - name: Free Disk Space (Ubuntu)
|
||||
# uses: jlumbroso/free-disk-space@main
|
||||
# with:
|
||||
# # this might remove tools that are actually needed,
|
||||
# # if set to "true" but frees about 6 GB
|
||||
# tool-cache: false
|
||||
# android: false
|
||||
# - run: flutter build apk --debug
|
||||
build_debug_apk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
distribution: "zulu"
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
- name: Add Firebase Messaging
|
||||
run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter build apk --debug --target-platform android-arm # Pangea change, only build arm to decrease size & time
|
||||
|
||||
# build_web:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
# - uses: subosito/flutter-action@v2
|
||||
# with:
|
||||
# flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
# cache: false
|
||||
# - run: flutter pub get
|
||||
# - name: Prepare web
|
||||
# run: ./scripts/prepare-web.sh
|
||||
# - run: flutter build web
|
||||
build_debug_web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
- run: flutter pub get
|
||||
- name: Prepare web
|
||||
run: ./scripts/prepare-web.sh
|
||||
- run: flutter build web
|
||||
|
||||
# commented out because we do not build Pangea Chat to linux
|
||||
# build_debug_linux:
|
||||
# strategy:
|
||||
# matrix:
|
||||
# arch: [ x64, arm64 ]
|
||||
# runs-on: ${{ matrix.arch == 'arm64' && 'self-hosted' || 'ubuntu-latest'}}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
# - name: Install dependencies
|
||||
# run: sudo apt-get update && sudo apt-get install git wget curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y
|
||||
# - name: Install Flutter
|
||||
# run: |
|
||||
# git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
|
||||
# ./flutter/bin/flutter doctor
|
||||
# - run: ./flutter/bin/flutter pub get
|
||||
# - run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }}
|
||||
build_debug_linux:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [ arm64 ] # Pangea Disabled x64
|
||||
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest'}}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install git wget curl libcurl4-openssl-dev clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev -y
|
||||
- name: Install Flutter
|
||||
run: |
|
||||
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
|
||||
./flutter/bin/flutter doctor
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
- run: ./flutter/bin/flutter pub get
|
||||
- run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }}
|
||||
|
||||
# build_debug_ios:
|
||||
# runs-on: macos-15
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
# - uses: subosito/flutter-action@v2
|
||||
# with:
|
||||
# flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
# cache: true
|
||||
# - name: Setup Xcode version
|
||||
# uses: maxim-lobanov/setup-xcode@v1.6.0
|
||||
# with:
|
||||
# xcode-version: latest
|
||||
# - run: brew install sqlcipher
|
||||
# - run: flutter pub get
|
||||
# - run: flutter build ipa --no-codesign
|
||||
# Pangea#
|
||||
build_debug_ios:
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
- name: Use Xcode 16.4
|
||||
run: sudo xcode-select --switch /Applications/Xcode_16.4.app
|
||||
- run: brew install sqlcipher
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
- name: Add Firebase Messaging
|
||||
run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter pub get
|
||||
- run: flutter build ios --no-codesign
|
||||
@ -1,2 +1,2 @@
|
||||
FLUTTER_VERSION=3.32.4
|
||||
FLUTTER_VERSION=3.35.3
|
||||
JAVA_VERSION=17
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
id "com.google.gms.google-services"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdk = 35
|
||||
namespace = "com.talktolearn.chat"
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// #Pangea
|
||||
// applicationId "chat.fluffy.fluffychat"
|
||||
applicationId "com.talktolearn.chat"
|
||||
// Pangea#
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 35
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile file(keystoreProperties['storeFile'])
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig signingConfigs.debug
|
||||
versionNameSuffix "-debug"
|
||||
}
|
||||
release {
|
||||
minifyEnabled false
|
||||
shrinkResources false
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
// https://stackoverflow.com/a/77494454/8222484
|
||||
packagingOptions {
|
||||
pickFirst 'lib/x86/libc++_shared.so'
|
||||
pickFirst 'lib/x86_64/libc++_shared.so'
|
||||
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
||||
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation platform('com.google.firebase:firebase-bom:32.8.0')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-database'
|
||||
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
}
|
||||
|
||||
// #Pangea
|
||||
// configurations.all {
|
||||
// exclude group: 'com.google.android.gms'
|
||||
// }
|
||||
// Pangea#
|
||||
@ -0,0 +1,104 @@
|
||||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
// conditionally apply google-services (keeps your original intent)
|
||||
if (file("google-services.json").exists()) {
|
||||
apply(plugin = "com.google.gms.google-services")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286
|
||||
|
||||
implementation(platform("com.google.firebase:firebase-bom:32.8.0"))
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
implementation("com.google.firebase:firebase-database")
|
||||
|
||||
implementation("androidx.multidex:multidex:2.0.1")
|
||||
}
|
||||
|
||||
// Workaround for https://pub.dev/packages/unifiedpush#the-build-fails-because-of-duplicate-classes
|
||||
configurations.all {
|
||||
// Use the latest version published: https://central.sonatype.com/artifact/com.google.crypto.tink/tink-android
|
||||
val tink = "com.google.crypto.tink:tink-android:1.17.0"
|
||||
// You can also use the library declaration catalog
|
||||
// val tink = libs.google.tink
|
||||
resolutionStrategy {
|
||||
force(tink)
|
||||
dependencySubstitution {
|
||||
substitute(module("com.google.crypto.tink:tink")).using(module(tink))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.talktolearn.chat"
|
||||
compileSdk = 35
|
||||
// compileSdk = flutter.compileSdkVersion
|
||||
// ndkVersion = "27.0.12077973"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = "dummyAlias"
|
||||
keyPassword = "dummyPassword"
|
||||
storeFile = file("dummy.keystore")
|
||||
storePassword = "dummyStorePassword"
|
||||
}
|
||||
}
|
||||
|
||||
val keystoreProperties = Properties()
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
signingConfigs.getByName("release").apply {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.talktolearn.chat"
|
||||
minSdk = 21
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
versionNameSuffix = "-debug"
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
}
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
// use the release signing config we created above (will be used only if key properties exist)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.talktolearn.chat
|
||||
|
||||
import io.flutter.embedding.engine.FlutterEngine
|
||||
import io.flutter.embedding.engine.dart.DartExecutor
|
||||
import org.unifiedpush.flutter.connector.UnifiedPushReceiver
|
||||
|
||||
import android.content.Context
|
||||
|
||||
class UnifiedPushReceiver : UnifiedPushReceiver() {
|
||||
override fun getEngine(context: Context): FlutterEngine {
|
||||
var engine = MainActivity.engine
|
||||
if (engine == null) {
|
||||
engine = MainActivity.provideEngine(context)
|
||||
engine.localizationPlugin.sendLocalesToFlutter(
|
||||
context.resources.configuration
|
||||
)
|
||||
engine.dartExecutor.executeDartEntrypoint(
|
||||
DartExecutor.DartEntrypoint.createDefault()
|
||||
)
|
||||
}
|
||||
return engine
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.google.gms:google-services:4.4.1'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
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<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.google.gms:google-services:4.4.1")
|
||||
}
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://storage.googleapis.com/r8-releases/raw")
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools:r8:8.2.24")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.7.3" apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
|
||||
id "com.google.gms.google-services" version "4.3.8" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
@ -0,0 +1,40 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://storage.googleapis.com/r8-releases/raw")
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath("com.android.tools:r8:8.2.24")
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.1.10" apply false
|
||||
if (file("app/google-services.json").exists()) {
|
||||
id("com.google.gms.google-services") version "4.3.8" apply false
|
||||
}
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@ -1,13 +0,0 @@
|
||||
image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter/stable
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
code_analyze:
|
||||
tags:
|
||||
- docker
|
||||
stage: test
|
||||
script:
|
||||
- flutter pub get
|
||||
- flutter format --set-exit-if-changed lib/ test/
|
||||
- flutter analyze
|
||||
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
flutter pub add fcm_shared_isolate
|
||||
flutter pub get
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart
|
||||
sed -i '' -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/com/talktolearn/chat/FcmPushService.kt
|
||||
else
|
||||
sed -i 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart
|
||||
sed -i -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/com/talktolearn/chat/FcmPushService.kt
|
||||
fi
|
||||
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
flutter pub get
|
||||
flutter build apk --release
|
||||
mkdir -p build/android
|
||||
cp build/app/outputs/apk/release/app-release.apk build/android/
|
||||
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
flutter build apk --debug
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/sh -ve
|
||||
flutter config --enable-linux-desktop
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build linux --release -v
|
||||
@ -1,5 +0,0 @@
|
||||
#!/bin/sh -ve
|
||||
flutter config --enable-web
|
||||
flutter clean
|
||||
flutter pub get
|
||||
flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --profile --source-maps
|
||||
@ -1,8 +0,0 @@
|
||||
#!/bin/sh -ve
|
||||
flutter pub get
|
||||
flutter pub run import_sorter:main --no-comments --exit-if-changed
|
||||
flutter format lib/ test/ --set-exit-if-changed
|
||||
git apply ./scripts/enable-android-google-services.patch
|
||||
flutter pub get
|
||||
flutter analyze
|
||||
flutter pub run dart_code_metrics:metrics lib -r gitlab > code-quality-report.json || true
|
||||
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
GITLAB_PROJECT_ID="16112282"
|
||||
|
||||
PIPELINE="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines\?scope=tags\&status=success\&order_by=updated_at | jq '.[].id' | head -n1)"
|
||||
JOB="$(curl https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/pipelines/${PIPELINE}/jobs | jq -r '.[] | select(.name == "build_web").id')"
|
||||
|
||||
wget --output-document web.zip https://gitlab.com/api/v4/projects/${GITLAB_PROJECT_ID}/jobs/${JOB}/artifacts
|
||||
|
||||
unzip web.zip
|
||||
|
||||
mv build/web stable
|
||||
@ -1,144 +0,0 @@
|
||||
diff --git a/android/app/build.gradle b/android/app/build.gradle
|
||||
index bb8e015cd..3ff4a7579 100644
|
||||
--- a/android/app/build.gradle
|
||||
+++ b/android/app/build.gradle
|
||||
@@ -2,7 +2,7 @@ plugins {
|
||||
id "com.android.application"
|
||||
id "kotlin-android"
|
||||
id "dev.flutter.flutter-gradle-plugin"
|
||||
- //id "com.google.gms.google-services"
|
||||
+ id "com.google.gms.google-services"
|
||||
}
|
||||
|
||||
def localProperties = new Properties()
|
||||
@@ -97,11 +97,12 @@ flutter {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- //implementation 'com.google.firebase:firebase-messaging:19.0.1' // Workaround for https://github.com/microg/android_packages_apps_GmsCore/issues/313#issuecomment-617651698
|
||||
+ implementation 'com.google.firebase:firebase-messaging:19.0.1'
|
||||
+ // Workaround for https://github.com/microg/android_packages_apps_GmsCore/issues/313#issuecomment-617651698
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
- exclude group: 'com.google.android.gms'
|
||||
+ //exclude group: 'com.google.android.gms'
|
||||
}
|
||||
\ No newline at end of file
|
||||
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
|
||||
index d0e0fbc9..0a546da0 100644
|
||||
--- a/android/app/proguard-rules.pro
|
||||
+++ b/android/app/proguard-rules.pro
|
||||
@@ -1 +1,42 @@
|
||||
--keep class net.sqlcipher.** { *; }
|
||||
\ No newline at end of file
|
||||
+-optimizationpasses 5
|
||||
+## Flutter wrapper
|
||||
+-keep class net.sqlcipher.** { *; }
|
||||
+-keep class io.flutter.app.** { *; }
|
||||
+-keep class io.flutter.plugin.** { *; }
|
||||
+-keep class io.flutter.util.** { *; }
|
||||
+-keep class io.flutter.view.** { *; }
|
||||
+-keep class io.flutter.** { *; }
|
||||
+-keep class io.flutter.plugins.** { *; }
|
||||
+-dontwarn io.flutter.embedding.**
|
||||
+
|
||||
+##---------------Begin: proguard configuration for Gson (Needed for flutter_local_notifications) ----------
|
||||
+# Gson uses generic type information stored in a class file when working with fields. Proguard
|
||||
+# removes such information by default, so configure it to keep all of it.
|
||||
+-keepattributes Signature
|
||||
+
|
||||
+# For using GSON @Expose annotation
|
||||
+-keepattributes *Annotation*
|
||||
+
|
||||
+# Gson specific classes
|
||||
+-dontwarn sun.misc.**
|
||||
+
|
||||
+# Application classes that will be serialized/deserialized over Gson
|
||||
+-keep class com.google.gson.examples.android.model.** { <fields>; }
|
||||
+
|
||||
+# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||
+# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||
+-keep class * extends com.google.gson.TypeAdapter
|
||||
+-keep class * implements com.google.gson.TypeAdapterFactory
|
||||
+-keep class * implements com.google.gson.JsonSerializer
|
||||
+-keep class * implements com.google.gson.JsonDeserializer
|
||||
+
|
||||
+# Prevent R8 from leaving Data object members always null
|
||||
+-keepclassmembers,allowobfuscation class * {
|
||||
+ @com.google.gson.annotations.SerializedName <fields>;
|
||||
+}
|
||||
+
|
||||
+# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||
+-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||
+-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||
+
|
||||
+##---------------End: proguard configuration for Gson (Needed for flutter_local_notifications) ----------
|
||||
\ No newline at end of file
|
||||
diff --git a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt b/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
|
||||
index d9930f55..510e9845 100644
|
||||
--- a/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
|
||||
+++ b/android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
|
||||
@@ -1,4 +1,4 @@
|
||||
-/*package chat.fluffy.fluffychat
|
||||
+package chat.fluffy.fluffychat
|
||||
|
||||
import com.famedly.fcm_shared_isolate.FcmSharedIsolateService
|
||||
|
||||
@@ -33,4 +33,3 @@ class FcmPushService : FcmSharedIsolateService() {
|
||||
}
|
||||
}
|
||||
}
|
||||
-*/
|
||||
\ No newline at end of file
|
||||
diff --git a/android/settings.gradle b/android/settings.gradle
|
||||
index b2fd960a..fdb01a4d 100644
|
||||
--- a/android/settings.gradle
|
||||
+++ b/android/settings.gradle
|
||||
@@ -20,7 +20,7 @@ plugins {
|
||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||
id "com.android.application" version "8.7.3" apply false
|
||||
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
|
||||
- // id "com.google.gms.google-services" version "4.3.8" apply false
|
||||
+ id "com.google.gms.google-services" version "4.3.8" apply false
|
||||
}
|
||||
|
||||
include ":app"
|
||||
\ No newline at end of file
|
||||
diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart
|
||||
index 1ba2659a..989f458e 100644
|
||||
--- a/lib/utils/background_push.dart
|
||||
+++ b/lib/utils/background_push.dart
|
||||
@@ -39,7 +39,7 @@ import '../config/setting_keys.dart';
|
||||
import '../widgets/matrix.dart';
|
||||
import 'platform_infos.dart';
|
||||
|
||||
-//import 'package:fcm_shared_isolate/fcm_shared_isolate.dart';
|
||||
+import 'package:fcm_shared_isolate/fcm_shared_isolate.dart';
|
||||
|
||||
class NoTokenException implements Exception {
|
||||
String get cause => 'Cannot get firebase token';
|
||||
@@ -64,7 +64,7 @@ class BackgroundPush {
|
||||
|
||||
final pendingTests = <String, Completer<void>>{};
|
||||
|
||||
- final dynamic firebase = null; //FcmSharedIsolate();
|
||||
+ final dynamic firebase = FcmSharedIsolate();
|
||||
|
||||
DateTime? lastReceivedPush;
|
||||
|
||||
diff --git a/pubspec.yaml b/pubspec.yaml
|
||||
index fb3e3ca4..039b2ccc 100644
|
||||
--- a/pubspec.yaml
|
||||
+++ b/pubspec.yaml
|
||||
@@ -25,7 +25,7 @@ dependencies:
|
||||
dynamic_color: ^1.7.0
|
||||
emoji_picker_flutter: ^3.1.0
|
||||
emojis: ^0.9.9
|
||||
- #fcm_shared_isolate: ^0.2.0
|
||||
+ fcm_shared_isolate: ^0.2.0
|
||||
file_picker: ^8.1.2
|
||||
file_selector: ^1.0.3
|
||||
flutter:
|
||||
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
apk update && apk add docker drill grep
|
||||
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
chmod 777 -R /dev/kvm
|
||||
adb start-server
|
||||
emulator -avd test -wipe-data -no-audio -no-boot-anim -no-window -accel on -gpu swiftshader_indirect
|
||||
emulator -avd test -wipe-data -no-audio -no-boot-anim -no-window -accel on -gpu swiftshader_indirect
|
||||
@ -1,37 +0,0 @@
|
||||
#!/bin/bash -ve
|
||||
|
||||
# source: https://about.gitlab.com/blog/2017/09/05/how-to-automatically-create-a-new-mr-on-gitlab-with-gitlab-ci/
|
||||
|
||||
# Extract the host where the server is running, and add the URL to the APIs
|
||||
[[ $HOST =~ ^https?://[^/]+ ]] && HOST="${BASH_REMATCH[0]}/api/v4/projects/"
|
||||
|
||||
# Look which is the default branch
|
||||
TARGET_BRANCH=`curl --silent "${HOST}${CI_PROJECT_ID}" --header "PRIVATE-TOKEN:${PRIVATE_TOKEN}" | python3 -c "import sys, json; print(json.load(sys.stdin)['default_branch'])"`;
|
||||
|
||||
# The description of our new MR, we want to remove the branch after the MR has
|
||||
# been closed
|
||||
BODY="{
|
||||
\"id\": ${CI_PROJECT_ID},
|
||||
\"source_branch\": \"${UPDATE_BRANCH}\",
|
||||
\"target_branch\": \"${TARGET_BRANCH}\",
|
||||
\"remove_source_branch\": true,
|
||||
\"title\": \"chore: automated dependency update\"
|
||||
}";
|
||||
|
||||
# Require a list of all the merge request and take a look if there is already
|
||||
# one with the same source branch
|
||||
LISTMR=`curl --silent "${HOST}${CI_PROJECT_ID}/merge_requests?state=opened" --header "PRIVATE-TOKEN:${PRIVATE_TOKEN}"`;
|
||||
COUNTBRANCHES=`echo ${LISTMR} | grep -o "\"source_branch\":\"${UPDATE_BRANCH}\"" | wc -l`;
|
||||
|
||||
# No MR found, let's create a new one
|
||||
if [ ${COUNTBRANCHES} -eq "0" ]; then
|
||||
curl -X POST "${HOST}${CI_PROJECT_ID}/merge_requests" \
|
||||
--header "PRIVATE-TOKEN:${PRIVATE_TOKEN}" \
|
||||
--header "Content-Type: application/json" \
|
||||
--data "${BODY}";
|
||||
|
||||
echo "Opened a new dependency update MR."
|
||||
exit;
|
||||
fi
|
||||
|
||||
echo "No new merge request opened.";
|
||||
Loading…
Reference in New Issue