Skip to content
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
9 changes: 5 additions & 4 deletions EmojiComponents/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.library")
alias(core.plugins.kotlin.android)
Expand Down Expand Up @@ -25,10 +27,6 @@ android {
compose = true
}

kotlinOptions {
jvmTarget = javaVersion.toString()
}

flavorDimensions += "distribution"

productFlavors {
Expand All @@ -37,6 +35,8 @@ android {
}
}

kotlin.compilerOptions.jvmTarget = JvmTarget.valueOf("JVM_${javaVersion.name.substringAfter("VERSION_")}")

dependencies {
implementation(core.infomaniak.core.avatar)
implementation(core.infomaniak.core.ui.compose.margin)
Expand All @@ -45,6 +45,7 @@ dependencies {
implementation(libs.compose.ui.android)

implementation(core.androidx.core.ktx)
api(libs.emoji.reaction.models)

implementation(platform(core.compose.bom))
implementation(core.compose.runtime)
Expand Down
8 changes: 4 additions & 4 deletions HtmlCleaner/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.library")
id("kotlin-android")
Expand All @@ -20,17 +22,15 @@ android {
targetCompatibility = javaVersion
}

kotlinOptions {
jvmTarget = javaVersion.toString()
}

flavorDimensions += "distribution"
productFlavors {
create("standard")
create("fdroid")
}
}

kotlin.compilerOptions.jvmTarget = JvmTarget.valueOf("JVM_${javaVersion.name.substringAfter("VERSION_")}")

dependencies {
api(libs.jsoup)
}
6 changes: 6 additions & 0 deletions OldKotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.realm.kotlin) apply false
}
30 changes: 30 additions & 0 deletions OldKotlin/emoji-reaction-models/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/**
* Don't change the order in this `plugins` block, it will mess things up.
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}

group = "com.infomaniak.mail"
version = "1.0.0"

val javaVersion: JavaVersion = JavaVersion.VERSION_17

android {
namespace = "com.infomaniak.mail.emoji.models"
compileSdk = 36

defaultConfig {
minSdk = 27
}

compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
}

kotlin.compilerOptions.jvmTarget = JvmTarget.valueOf("JVM_${javaVersion.name.substringAfter("VERSION_")}")
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2025 Infomaniak Network SA
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
23 changes: 23 additions & 0 deletions OldKotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
22 changes: 22 additions & 0 deletions OldKotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[versions]
#noinspection AndroidGradlePluginVersion,NewerVersionAvailable
agp = "8.13.2"
#noinspection NewerVersionAvailable
kotlin = "2.2.10" # Update only with compatible Realm-kotlin releases
#noinspection NewerVersionAvailable
kotlinxSerialization = "1.9.0" # Update only with Kotlin
realmKotlin = "3.2.9"
sentry = "8.27.1"

[libraries]
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.10.0" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
realm-kotlin-base = { module = "com.infomaniak.realm.kotlin:library-base", version.ref = "realmKotlin" }
sentry-android = { module = "io.sentry:sentry-android", version.ref = "sentry" }

[plugins]
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "kotlin-parcelize" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
realm-kotlin = { id = "com.infomaniak.realm.kotlin", version.ref = "realmKotlin" }
42 changes: 42 additions & 0 deletions OldKotlin/realm-models/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/**
* Don't change the order in this `plugins` block, it will mess things up.
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.realm.kotlin)
alias(libs.plugins.kotlin.parcelize)
}

group = "com.infomaniak.mail"
version = "1.0.0"

val javaVersion: JavaVersion = JavaVersion.VERSION_17

android {
namespace = "com.infomaniak.mail.realm"
compileSdk = 36

defaultConfig {
minSdk = 27
}

compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
}

kotlin.compilerOptions.jvmTarget = JvmTarget.valueOf("JVM_${javaVersion.name.substringAfter("VERSION_")}")

dependencies {

api(libs.realm.kotlin.base)
api(libs.kotlinx.serialization.json)
api(libs.androidx.annotation)
implementation(libs.sentry.android)
api(project(":emoji-reaction-models"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.core.common.utils

import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KMutableProperty0
import kotlin.reflect.KProperty

inline fun <reified T> mailApiEnumValueOfOrNull(value: String?): T? where T : Enum<T>, T : MailApiEnum {
return value?.let { runCatching { enumValues<T>().firstOrNull { it.apiValue == value } }.getOrNull() }
}

inline fun <reified T> mailApiEnum(backingFieldProperty: KMutableProperty0<String?>): ReadWriteProperty<Any?, T?> where T : Enum<T>, T : MailApiEnum {
return object : ReadWriteProperty<Any?, T?> {
override fun getValue(thisRef: Any?, property: KProperty<*>): T? = mailApiEnumValueOfOrNull<T>(backingFieldProperty.get())
override fun setValue(thisRef: Any?, property: KProperty<*>, value: T?) = backingFieldProperty.set(value?.apiValue)
}
}

interface MailApiEnum {
val apiValue: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.infomaniak.mail.data.api

import com.infomaniak.core.common.utils.FORMAT_DATE_WITH_TIMEZONE
import com.infomaniak.mail.utils.extensions.toDate
import com.infomaniak.mail.utils.extensions.toRealmInstant
import io.realm.kotlin.types.RealmInstant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.infomaniak.mail.data.api

import com.infomaniak.core.common.utils.FORMAT_DATE_WITH_TIMEZONE
import kotlinx.serialization.KSerializer
import kotlinx.serialization.descriptors.PrimitiveKind
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.mail.data.api

internal const val FORMAT_DATE_WITH_TIMEZONE = "yyyy-MM-dd'T'HH:mm:ssZ" // Example: 2025-12-31T23:59:59+0100
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package com.infomaniak.mail.data.api

import com.infomaniak.core.common.utils.FORMAT_DATE_WITH_TIMEZONE
import com.infomaniak.mail.utils.extensions.toDate
import com.infomaniak.mail.utils.extensions.toRealmInstant
import io.realm.kotlin.types.RealmInstant
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2022-2024 Infomaniak Network SA
* Copyright (C) 2022-2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Infomaniak Mail - Android
* Copyright (C) 2026 Infomaniak Network SA
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.mail.data.models

sealed interface Attachable {

var size: Long
var name: String
var mimeType: String
var resource: String?
var localUuid: String
}
Loading
Loading