feat(android): sign-in with google & magic-link & email (#9868)
- [chore(android): migrate to version catalog](16c0fb66e7) - [feat(android): integrate apollo](4dcf93b4f9) - [fix(android): fix android email sign-in](752cf34f33) - [chore(android): add stable/canary environment](72a96bfa5f) - [feat(android): set cookies for apollo client](7664cc4f19) - [feat(android): google & magic-link sign-in](c54ce3b43b) - [eat(android): change logo](8c5062adbc) - [chore(android): fix pipleline](4a68299be4) - [fix(android): rebase issues](c6858c5ecf) - [docs(android): update README for compat with java 21](6eac3ba0dc) - [fix(android): android pipeline](1103c87880)
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
plugins {
|
||||
alias libs.plugins.android.application
|
||||
alias libs.plugins.kotlin.android
|
||||
alias libs.plugins.rust.android
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
|
||||
android {
|
||||
namespace "app.affine.pro"
|
||||
namespace "app.affine.pro"
|
||||
compileSdk rootProject.ext.compileSdkVersion
|
||||
ndkVersion = new File(sdkDirectory, "ndk").listFiles().sort().last().name
|
||||
defaultConfig {
|
||||
@@ -17,20 +21,35 @@ android {
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
ndk {
|
||||
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
|
||||
}
|
||||
}
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
flavorDimensions = ['chanel']
|
||||
productFlavors {
|
||||
stable {
|
||||
buildConfigField 'String', 'BASE_URL', '"https://app.affine.pro"'
|
||||
resValue 'string', 'host', '"app.affine.pro"'
|
||||
}
|
||||
canary {
|
||||
buildConfigField 'String', 'BASE_URL', '"https://affine.fail"'
|
||||
resValue 'string', 'host', '"affine.fail"'
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_21
|
||||
targetCompatibility JavaVersion.VERSION_21
|
||||
@@ -42,20 +61,22 @@ repositories {
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
implementation "net.java.dev.jna:jna:5.16.0@aar"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1"
|
||||
implementation 'androidx.core:core-ktx:1.15.0'
|
||||
implementation project(':service')
|
||||
implementation libs.kotlinx.coroutines.core
|
||||
implementation libs.androidx.appcompat
|
||||
implementation libs.androidx.browser
|
||||
implementation libs.androidx.coordinatorlayout
|
||||
implementation libs.androidx.core.splashscreen
|
||||
implementation libs.androidx.core.ktx
|
||||
implementation libs.apollo.runtime
|
||||
implementation libs.jna
|
||||
testImplementation libs.junit
|
||||
androidTestImplementation libs.androidx.junit
|
||||
androidTestImplementation libs.androidx.espresso.core
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -63,28 +84,26 @@ try {
|
||||
if (servicesJSON.text) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
} catch(Exception ignored) {
|
||||
} catch (Exception ignored) {
|
||||
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
||||
}
|
||||
|
||||
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
|
||||
|
||||
cargo {
|
||||
module = "../../../../mobile-native"
|
||||
libname = "affine_mobile_native"
|
||||
targets = ["arm64"]
|
||||
pythonCommand = "python3.12"
|
||||
targetDirectory = "../../../../../../target"
|
||||
apiLevel = 28
|
||||
targetIncludes = ["libaffine_mobile_native.so"]
|
||||
profile = "release"
|
||||
module = "../../../../mobile-native"
|
||||
libname = "affine_mobile_native"
|
||||
targets = ["arm64"]
|
||||
pythonCommand = "python3.12"
|
||||
targetDirectory = "../../../../../../target"
|
||||
apiLevel = 28
|
||||
targetIncludes = ["libaffine_mobile_native.so"]
|
||||
profile = "release"
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
apiVersion = KotlinVersion.KOTLIN_2_0
|
||||
jvmTarget = JvmTarget.JVM_21
|
||||
}
|
||||
compilerOptions {
|
||||
apiVersion = KotlinVersion.KOTLIN_2_1
|
||||
jvmTarget = JvmTarget.JVM_21
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
@@ -103,7 +122,7 @@ android.applicationVariants.configureEach { variant ->
|
||||
def t = tasks.register("generate${variant.name.capitalize()}UniFFIBindings", Exec) {
|
||||
workingDir "${project.projectDir}"
|
||||
// Runs the bindings generation, note that you must have uniffi-bindgen installed and in your PATH environment variable
|
||||
commandLine 'cargo', 'run', '--bin', 'uniffi-bindgen', 'generate', '--library', "${buildDir}/rustJniLibs/android/arm64-v8a/libaffine_mobile_native.so", '--language', 'kotlin', '--out-dir', "${project.projectDir}/src/main/java"
|
||||
commandLine "${System.getenv("CARGO_HOME")}/bin/cargo", 'run', '--bin', 'uniffi-bindgen', 'generate', '--library', "${buildDir}/rustJniLibs/android/arm64-v8a/libaffine_mobile_native.so", '--language', 'kotlin', '--out-dir', "${project.projectDir}/src/main/java"
|
||||
dependsOn("cargoBuild")
|
||||
}
|
||||
variant.javaCompileProvider.get().dependsOn(t)
|
||||
|
||||
Reference in New Issue
Block a user