Merge branch 'develop' into feature/fga/presenter_tests
This commit is contained in:
commit
df723bfc44
300 changed files with 772 additions and 209 deletions
29
plugins/src/main/kotlin/Versions.kt
Normal file
29
plugins/src/main/kotlin/Versions.kt
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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 org.gradle.api.JavaVersion
|
||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||
|
||||
object Versions {
|
||||
const val versionCode = 100100
|
||||
const val versionName = "0.1.0"
|
||||
|
||||
const val compileSdk = 33
|
||||
const val targetSdk = 33
|
||||
const val minSdk = 21
|
||||
val javaCompileVersion = JavaVersion.VERSION_11
|
||||
val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(11)
|
||||
}
|
||||
69
plugins/src/main/kotlin/extension/CommonExtension.kt
Normal file
69
plugins/src/main/kotlin/extension/CommonExtension.kt
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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 extension
|
||||
|
||||
import Versions
|
||||
import com.android.build.api.dsl.CommonExtension
|
||||
import org.gradle.api.Project
|
||||
import java.io.File
|
||||
|
||||
fun CommonExtension<*, *, *, *>.androidConfig(project: Project) {
|
||||
defaultConfig {
|
||||
compileSdk = Versions.compileSdk
|
||||
minSdk = Versions.minSdk
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
isCoreLibraryDesugaringEnabled = true
|
||||
}
|
||||
|
||||
testOptions {
|
||||
unitTests.isReturnDefaultValues = true
|
||||
}
|
||||
|
||||
lint {
|
||||
lintConfig = File("${project.rootDir}/tools/lint/lint.xml")
|
||||
checkDependencies = true
|
||||
abortOnError = true
|
||||
}
|
||||
}
|
||||
|
||||
fun CommonExtension<*, *, *, *>.composeConfig() {
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = "1.4.0"
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
resources.excludes.apply {
|
||||
add("META-INF/AL2.0")
|
||||
add("META-INF/LGPL2.1")
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
// Extra rules for compose
|
||||
// Disabled until lint stops inspecting generated ksp files...
|
||||
// error.add("ComposableLambdaParameterNaming")
|
||||
error.add("ComposableLambdaParameterPosition")
|
||||
}
|
||||
}
|
||||
|
||||
49
plugins/src/main/kotlin/extension/DependencyHandleScope.kt
Normal file
49
plugins/src/main/kotlin/extension/DependencyHandleScope.kt
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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 extension
|
||||
|
||||
import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.androidTestImplementation
|
||||
import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.debugImplementation
|
||||
import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.implementation
|
||||
import org.gradle.kotlin.dsl.DependencyHandlerScope
|
||||
|
||||
/**
|
||||
* Dependencies used by all the modules
|
||||
*/
|
||||
fun DependencyHandlerScope.commonDependencies() {
|
||||
implementation("com.jakewharton.timber:timber:5.0.1")
|
||||
}
|
||||
|
||||
/**
|
||||
* Dependencies used by all the modules with composable items
|
||||
*/
|
||||
fun DependencyHandlerScope.composeDependencies() {
|
||||
val composeBom = platform("androidx.compose:compose-bom:2023.01.00")
|
||||
implementation(composeBom)
|
||||
androidTestImplementation(composeBom)
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation("androidx.compose.material:material")
|
||||
implementation("androidx.compose.material3:material3")
|
||||
implementation("androidx.compose.material:material-icons-extended")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
implementation("androidx.activity:activity-compose:1.6.1")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
||||
implementation("com.airbnb.android:showkase:1.0.0-beta14")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5")
|
||||
}
|
||||
|
||||
27
plugins/src/main/kotlin/extension/VersionCatalog.kt
Normal file
27
plugins/src/main/kotlin/extension/VersionCatalog.kt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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 extension
|
||||
|
||||
import org.gradle.api.artifacts.VersionCatalog
|
||||
|
||||
private fun VersionCatalog.getVersion(alias: String) = findVersion(alias).get()
|
||||
|
||||
private fun VersionCatalog.getLibrary(library: String) = findLibrary(library).get()
|
||||
|
||||
private fun VersionCatalog.getBundle(bundle: String) = findBundle(bundle).get()
|
||||
|
||||
private fun VersionCatalog.getPlugin(plugin: String) = findPlugin(plugin).get()
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This will generate the plugin "io.element.android-compose-application", used only in the module `app`.
|
||||
*/
|
||||
import extension.androidConfig
|
||||
import extension.commonDependencies
|
||||
import extension.composeConfig
|
||||
import extension.composeDependencies
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
}
|
||||
|
||||
android {
|
||||
androidConfig(project)
|
||||
composeConfig()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
commonDependencies()
|
||||
composeDependencies()
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This will generate the plugin "io.element.android-compose-library", used in android library with compose modules.
|
||||
*/
|
||||
import extension.androidConfig
|
||||
import extension.commonDependencies
|
||||
import extension.composeConfig
|
||||
import extension.composeDependencies
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
}
|
||||
|
||||
android {
|
||||
androidConfig(project)
|
||||
composeConfig()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
commonDependencies()
|
||||
composeDependencies()
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2022 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This will generate the plugin "io.element.android-library", used in android library without compose modules.
|
||||
*/
|
||||
import extension.androidConfig
|
||||
import extension.commonDependencies
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
}
|
||||
|
||||
android {
|
||||
androidConfig(project)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
commonDependencies()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue