mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add first EnterpriseService.
This commit is contained in:
committed by
Benoit Marty
parent
f2669c8658
commit
1b72221df7
+21
-1
@@ -17,6 +17,7 @@
|
|||||||
@file:Suppress("UnstableApiUsage")
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
import com.android.build.api.variant.FilterConfiguration.FilterType.ABI
|
import com.android.build.api.variant.FilterConfiguration.FilterType.ABI
|
||||||
|
import extension.allEnterpriseImpl
|
||||||
import extension.allFeaturesImpl
|
import extension.allFeaturesImpl
|
||||||
import extension.allLibrariesImpl
|
import extension.allLibrariesImpl
|
||||||
import extension.allServicesImpl
|
import extension.allServicesImpl
|
||||||
@@ -46,7 +47,11 @@ android {
|
|||||||
namespace = "io.element.android.x"
|
namespace = "io.element.android.x"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "io.element.android.x"
|
if (isEnterpriseBuild) {
|
||||||
|
applicationId = "io.element.enterprise"
|
||||||
|
} else {
|
||||||
|
applicationId = "io.element.android.x"
|
||||||
|
}
|
||||||
targetSdk = Versions.targetSdk
|
targetSdk = Versions.targetSdk
|
||||||
versionCode = Versions.versionCode
|
versionCode = Versions.versionCode
|
||||||
versionName = Versions.versionName
|
versionName = Versions.versionName
|
||||||
@@ -170,6 +175,20 @@ android {
|
|||||||
buildConfigField("String", "FLAVOR_DESCRIPTION", "\"FDroid\"")
|
buildConfigField("String", "FLAVOR_DESCRIPTION", "\"FDroid\"")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packaging {
|
||||||
|
resources.pickFirsts.addAll(
|
||||||
|
listOf(
|
||||||
|
"kotlin/annotation/annotation.kotlin_builtins",
|
||||||
|
"kotlin/collections/collections.kotlin_builtins",
|
||||||
|
"kotlin/coroutines/coroutines.kotlin_builtins",
|
||||||
|
"kotlin/internal/internal.kotlin_builtins",
|
||||||
|
"kotlin/kotlin.kotlin_builtins",
|
||||||
|
"kotlin/ranges/ranges.kotlin_builtins",
|
||||||
|
"kotlin/reflect/reflect.kotlin_builtins",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
androidComponents {
|
androidComponents {
|
||||||
@@ -222,6 +241,7 @@ knit {
|
|||||||
dependencies {
|
dependencies {
|
||||||
allLibrariesImpl()
|
allLibrariesImpl()
|
||||||
allServicesImpl()
|
allServicesImpl()
|
||||||
|
allEnterpriseImpl(rootDir, logger)
|
||||||
allFeaturesImpl(rootDir, logger)
|
allFeaturesImpl(rootDir, logger)
|
||||||
implementation(projects.features.migration.api)
|
implementation(projects.features.migration.api)
|
||||||
implementation(projects.anvilannotations)
|
implementation(projects.anvilannotations)
|
||||||
|
|||||||
+1
-1
Submodule enterprise updated: 1ae9686f0e...2e9be17450
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id("io.element.android-library")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "io.element.android.features.enterprise.api"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(projects.libraries.architecture)
|
||||||
|
implementation(projects.libraries.matrix.api)
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.features.enterprise.api
|
||||||
|
|
||||||
|
interface EnterpriseService {
|
||||||
|
suspend fun isEnterpriseUser(): Boolean
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
plugins {
|
||||||
|
id("io.element.android-library")
|
||||||
|
alias(libs.plugins.anvil)
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace = "io.element.android.features.enterprise.impl"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(projects.anvilannotations)
|
||||||
|
api(libs.anvil.compiler.api)
|
||||||
|
api(projects.features.enterprise.api)
|
||||||
|
implementation(projects.libraries.architecture)
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package io.element.android.features.enterprise.impl
|
||||||
|
|
||||||
|
import com.squareup.anvil.annotations.ContributesBinding
|
||||||
|
import io.element.android.features.enterprise.api.EnterpriseService
|
||||||
|
import io.element.android.libraries.di.SessionScope
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ContributesBinding(SessionScope::class)
|
||||||
|
class DefaultEnterpriseService @Inject constructor(
|
||||||
|
) : EnterpriseService {
|
||||||
|
override suspend fun isEnterpriseUser(): Boolean = false
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 New Vector Ltd
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Are we building with the enterprise sources?
|
||||||
|
*/
|
||||||
|
val isEnterpriseBuild = File("enterprise/README.md").exists()
|
||||||
@@ -64,7 +64,7 @@ object Versions {
|
|||||||
const val compileSdk = 34
|
const val compileSdk = 34
|
||||||
const val targetSdk = 33
|
const val targetSdk = 33
|
||||||
// When updating the `minSdk`, make sure to update the value of `minSdkVersion` in the file `tools/release/release.sh`
|
// When updating the `minSdk`, make sure to update the value of `minSdkVersion` in the file `tools/release/release.sh`
|
||||||
const val minSdk = 24
|
val minSdk = if (isEnterpriseBuild) 26 else 24
|
||||||
val javaCompileVersion = JavaVersion.VERSION_17
|
val javaCompileVersion = JavaVersion.VERSION_17
|
||||||
val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(11)
|
val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(11)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,11 @@ fun DependencyHandlerScope.allServicesImpl() {
|
|||||||
implementation(project(":services:toolbox:impl"))
|
implementation(project(":services:toolbox:impl"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun DependencyHandlerScope.allEnterpriseImpl(rootDir: File, logger: Logger) {
|
||||||
|
val enterpriseDir = File(rootDir, "enterprise")
|
||||||
|
addImplementationProjects(enterpriseDir, ":enterprise", "impl", logger)
|
||||||
|
}
|
||||||
|
|
||||||
fun DependencyHandlerScope.allFeaturesApi(rootDir: File, logger: Logger) {
|
fun DependencyHandlerScope.allFeaturesApi(rootDir: File, logger: Logger) {
|
||||||
val featuresDir = File(rootDir, "features")
|
val featuresDir = File(rootDir, "features")
|
||||||
addImplementationProjects(featuresDir, ":features", "api", logger)
|
addImplementationProjects(featuresDir, ":features", "api", logger)
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ fun includeProjects(directory: File, path: String, maxDepth: Int = 1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
includeProjects(File(rootDir, "enterprise"), ":enterprise", maxDepth = 2)
|
||||||
includeProjects(File(rootDir, "features"), ":features")
|
includeProjects(File(rootDir, "features"), ":features")
|
||||||
includeProjects(File(rootDir, "libraries"), ":libraries")
|
includeProjects(File(rootDir, "libraries"), ":libraries")
|
||||||
includeProjects(File(rootDir, "services"), ":services")
|
includeProjects(File(rootDir, "services"), ":services")
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ class KonsistClassNameTest {
|
|||||||
"DBov",
|
"DBov",
|
||||||
"Default",
|
"Default",
|
||||||
"DataStore",
|
"DataStore",
|
||||||
|
"Enterprise",
|
||||||
"FileExtensionExtractor",
|
"FileExtensionExtractor",
|
||||||
"KeyStore",
|
"KeyStore",
|
||||||
"Matrix",
|
"Matrix",
|
||||||
|
|||||||
Reference in New Issue
Block a user