Browse Source

Continue cleaning gradle files

feature/bma/flipper
ganfra 2 years ago
parent
commit
5034daed6c
  1. 15
      app/build.gradle.kts
  2. 12
      build.gradle
  3. 11
      build.gradle.kts
  4. 13
      features/login/build.gradle.kts
  5. 16
      features/messages/build.gradle.kts
  6. 13
      features/onboarding/build.gradle.kts
  7. 13
      features/roomlist/build.gradle.kts
  8. 16
      gradle/libs.versions.toml
  9. 2
      libraries/core/build.gradle.kts
  10. 10
      libraries/designsystem/build.gradle.kts
  11. 2
      libraries/matrix/build.gradle.kts
  12. 8
      libraries/textcomposer/build.gradle.kts
  13. 14
      plugins/src/main/java/extension/CommonExtension.kt
  14. 29
      plugins/src/main/java/extension/DependencyHandleScope.kt
  15. 9
      plugins/src/main/java/extension/VersionCatalog.kt
  16. 17
      plugins/src/main/java/io.element.android-compose-application.gradle.kts
  17. 18
      plugins/src/main/java/io.element.android-compose-library.gradle.kts
  18. 2
      plugins/src/main/java/io.element.android-library.gradle.kts

15
app/build.gradle.kts

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
plugins {
id("com.android.application")
id("io.element.android-compose-application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
alias(libs.plugins.ksp) version "1.7.20-1.0.7"
id("com.google.firebase.appdistribution") version "3.0.2"
}
@ -125,23 +125,14 @@ dependencies { @@ -125,23 +125,14 @@ dependencies {
implementation("io.github.raamcosta.compose-destinations:animations-core:1.7.23-beta")
ksp("io.github.raamcosta.compose-destinations:ksp:1.7.23-beta")
val composeBom = platform("androidx.compose:compose-bom:2022.11.00")
implementation(composeBom)
androidTestImplementation(composeBom)
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
implementation("io.coil-kt:coil:2.2.1")
implementation("com.jakewharton.timber:timber:5.0.1")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation("com.airbnb.android:mavericks-compose:3.0.1")
implementation("com.airbnb.android:showkase:1.0.0-beta14")
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
ksp(libs.showkase.processor)
}

12
build.gradle

@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// TODO Convert to .kts
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'com.google.devtools.ksp' version '1.7.20-1.0.7' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}

11
build.gradle.kts

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.ksp) apply false
}
tasks.register<Delete>("clean").configure {
delete(rootProject.buildDir)
}

13
features/login/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -14,11 +13,9 @@ dependencies { @@ -14,11 +13,9 @@ dependencies {
implementation(project(":libraries:designsystem"))
implementation(project(":libraries:elementresources"))
implementation(libs.mavericks.compose)
ksp(libs.showkase.processor)
implementation(libs.timber)
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
testImplementation(libs.test.junit)
androidTestImplementation(libs.test.junitext)
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
}

16
features/messages/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -19,11 +18,8 @@ dependencies { @@ -19,11 +18,8 @@ dependencies {
implementation(libs.datetime)
implementation(libs.accompanist.flowlayout)
implementation(libs.androidx.recyclerview)
implementation("org.jsoup:jsoup:1.15.3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
implementation(libs.jsoup)
testImplementation(libs.test.junit)
androidTestImplementation(libs.test.junitext)
ksp(libs.showkase.processor)
}

13
features/onboarding/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -16,9 +15,7 @@ dependencies { @@ -16,9 +15,7 @@ dependencies {
implementation(libs.timber)
implementation(libs.accompanist.pager)
implementation(libs.accompanist.pagerindicator)
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
testImplementation(libs.test.junit)
androidTestImplementation(libs.test.junitext)
ksp(libs.showkase.processor)
}

13
features/roomlist/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -16,9 +15,7 @@ dependencies { @@ -16,9 +15,7 @@ dependencies {
implementation(libs.timber)
implementation(libs.datetime)
implementation(libs.accompanist.placeholder)
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
testImplementation(libs.test.junit)
androidTestImplementation(libs.test.junitext)
ksp(libs.showkase.processor)
}

16
gradle/libs.versions.toml

@ -39,7 +39,10 @@ timber = "5.0.1" @@ -39,7 +39,10 @@ timber = "5.0.1"
coil = "2.2.1"
datetime = "0.4.0"
wysiwyg = "0.7.0.1"
serialization-json = "1.4.1"
serialization_json = "1.4.1"
showkase = "1.0.0-beta14"
compose_destinations = "1.7.23-beta"
jsoup = "1.15.3"
[libraries]
# Project
@ -88,7 +91,11 @@ mavericks_compose = { module = "com.airbnb.android:mavericks-compose", version.r @@ -88,7 +91,11 @@ mavericks_compose = { module = "com.airbnb.android:mavericks-compose", version.r
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" }
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization-json" }
serialization_json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_json" }
compose_destinations = { module = "io.github.raamcosta.compose-destinations:animations-core", version.ref = "compose_destinations" }
showkase = { module = "com.airbnb.android:showkase", version.ref = "showkase" }
showkase_processor = { module = "com.airbnb.android:showkase-processor", version.ref = "showkase" }
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
# Composer
wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
@ -96,4 +103,7 @@ wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" } @@ -96,4 +103,7 @@ wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
[bundles]
[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
android_application = { id = "com.android.application", version.ref = "android_gradle_plugin" }
android_library = { id = "com.android.library", version.ref = "android_gradle_plugin" }
kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

2
libraries/core/build.gradle.kts

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
plugins {
id("io.element.android-compose")
id("io.element.android-compose-library")
}
android {

10
libraries/designsystem/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -9,9 +8,8 @@ android { @@ -9,9 +8,8 @@ android {
dependencies {
// Should not be there, but this is a POC
implementation("io.coil-kt:coil-compose:2.2.1")
implementation(libs.coil.compose)
implementation(libs.accompanist.systemui)
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
ksp(libs.showkase.processor)
}
}

2
libraries/matrix/build.gradle.kts

@ -11,7 +11,7 @@ dependencies { @@ -11,7 +11,7 @@ dependencies {
api(project(":libraries:rustSdk"))
implementation(project(":libraries:core"))
implementation(libs.timber)
implementation("net.java.dev.jna:jna:5.10.0@aar")
implementation("net.java.dev.jna:jna:5.12.1@aar")
implementation(libs.coil.compose)
implementation(libs.androidx.datastore.preferences)
implementation(libs.serialization.json)

8
libraries/textcomposer/build.gradle.kts

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
plugins {
id("io.element.android-compose")
// TODO Move to common config
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
id("io.element.android-compose-library")
alias(libs.plugins.ksp)
}
android {
@ -17,6 +16,5 @@ dependencies { @@ -17,6 +16,5 @@ dependencies {
implementation(libs.wysiwyg)
implementation(libs.androidx.constraintlayout)
implementation("com.google.android.material:material:1.7.0")
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
ksp(libs.showkase.processor)
}

14
plugins/src/main/java/extension/CommonExtension.kt

@ -2,9 +2,7 @@ package extension @@ -2,9 +2,7 @@ package extension
import Versions
import com.android.build.api.dsl.CommonExtension
import com.android.build.api.dsl.LibraryExtension
import composeVersion
import org.gradle.api.artifacts.VersionCatalog
fun CommonExtension<*, *, *, *>.androidConfig() {
defaultConfig {
@ -39,13 +37,3 @@ fun CommonExtension<*, *, *, *>.composeConfig() { @@ -39,13 +37,3 @@ fun CommonExtension<*, *, *, *>.composeConfig() {
}
}
fun LibraryExtension.proguardConfig() {
buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles("proguard-android.txt", "proguard-rules.pro")
consumerProguardFiles("proguard-rules.pro")
}
}
}

29
plugins/src/main/java/io.element.android-compose.gradle.kts → plugins/src/main/java/extension/DependencyHandleScope.kt

@ -1,23 +1,15 @@ @@ -1,23 +1,15 @@
import extension.androidConfig
import extension.composeConfig
import extension.proguardConfig
package extension
plugins {
id("com.android.library")
id("kotlin-android")
// alias(libs.plugins.ksp)
// id("com.google.devtools.ksp") // version "1.7.20-1.0.7"
}
android {
androidConfig()
proguardConfig()
composeConfig()
}
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 {
implementation(platform("androidx.compose:compose-bom:2022.11.00"))
fun DependencyHandlerScope.composeDependencies(){
val composeBom = platform("androidx.compose:compose-bom:2022.11.00")
implementation(composeBom)
androidTestImplementation(composeBom)
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material:material")
implementation("androidx.compose.material3:material3")
@ -29,7 +21,6 @@ dependencies { @@ -29,7 +21,6 @@ dependencies {
implementation("com.airbnb.android:mavericks-compose:3.0.1")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation("com.airbnb.android:showkase:1.0.0-beta14")
// ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
}

9
plugins/src/main/java/extension/VersionCatalog.kt

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
package extension
import org.gradle.api.artifacts.VersionCatalog
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()

17
plugins/src/main/java/io.element.android-compose-application.gradle.kts

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
import extension.androidConfig
import extension.composeConfig
import extension.composeDependencies
plugins {
id("com.android.application")
id("kotlin-android")
}
android {
androidConfig()
composeConfig()
}
dependencies {
composeDependencies()
}

18
plugins/src/main/java/io.element.android-compose-library.gradle.kts

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
import extension.androidConfig
import extension.composeConfig
import extension.composeDependencies
plugins {
id("com.android.library")
id("kotlin-android")
}
android {
androidConfig()
composeConfig()
}
dependencies {
composeDependencies()
}

2
plugins/src/main/java/io.element.android-library.gradle.kts

@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
import extension.androidConfig
import extension.proguardConfig
plugins {
id("com.android.library")
@ -8,5 +7,4 @@ plugins { @@ -8,5 +7,4 @@ plugins {
android {
androidConfig()
proguardConfig()
}

Loading…
Cancel
Save