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 @@
plugins { plugins {
id("com.android.application") id("io.element.android-compose-application")
id("org.jetbrains.kotlin.android") 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" id("com.google.firebase.appdistribution") version "3.0.2"
} }
@ -125,23 +125,14 @@ dependencies {
implementation("io.github.raamcosta.compose-destinations:animations-core:1.7.23-beta") implementation("io.github.raamcosta.compose-destinations:animations-core:1.7.23-beta")
ksp("io.github.raamcosta.compose-destinations:ksp: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.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.lifecycle:lifecycle-runtime-ktx:2.5.1")
implementation("androidx.activity:activity-compose:1.6.1") implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1") implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
implementation("io.coil-kt:coil:2.2.1") implementation("io.coil-kt:coil:2.2.1")
implementation("com.jakewharton.timber:timber:5.0.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:mavericks-compose:3.0.1")
implementation("com.airbnb.android:showkase:1.0.0-beta14") 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 @@
// 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 @@
// 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 @@
plugins { plugins {
id("io.element.android-compose") id("io.element.android-compose-library")
// TODO Move to common config alias(libs.plugins.ksp)
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
} }
android { android {
@ -14,11 +13,9 @@ dependencies {
implementation(project(":libraries:designsystem")) implementation(project(":libraries:designsystem"))
implementation(project(":libraries:elementresources")) implementation(project(":libraries:elementresources"))
implementation(libs.mavericks.compose) implementation(libs.mavericks.compose)
ksp(libs.showkase.processor)
implementation(libs.timber) implementation(libs.timber)
testImplementation("junit:junit:4.13.2") testImplementation(libs.test.junit)
androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation(libs.test.junitext)
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
// 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 @@
plugins { plugins {
id("io.element.android-compose") id("io.element.android-compose-library")
// TODO Move to common config alias(libs.plugins.ksp)
id("com.google.devtools.ksp") version "1.7.20-1.0.7"
} }
android { android {
@ -19,11 +18,8 @@ dependencies {
implementation(libs.datetime) implementation(libs.datetime)
implementation(libs.accompanist.flowlayout) implementation(libs.accompanist.flowlayout)
implementation(libs.androidx.recyclerview) implementation(libs.androidx.recyclerview)
implementation("org.jsoup:jsoup:1.15.3") implementation(libs.jsoup)
testImplementation("junit:junit:4.13.2") testImplementation(libs.test.junit)
androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation(libs.test.junitext)
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") ksp(libs.showkase.processor)
// TODO Move to common config
ksp("com.airbnb.android:showkase-processor:1.0.0-beta14")
} }

13
features/onboarding/build.gradle.kts

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

13
features/roomlist/build.gradle.kts

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

16
gradle/libs.versions.toml

@ -39,7 +39,10 @@ timber = "5.0.1"
coil = "2.2.1" coil = "2.2.1"
datetime = "0.4.0" datetime = "0.4.0"
wysiwyg = "0.7.0.1" 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] [libraries]
# Project # Project
@ -88,7 +91,11 @@ mavericks_compose = { module = "com.airbnb.android:mavericks-compose", version.r
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } 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 # Composer
wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" } wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
@ -96,4 +103,7 @@ wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
[bundles] [bundles]
[plugins] [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 @@
plugins { plugins {
id("io.element.android-compose") id("io.element.android-compose-library")
} }
android { android {

10
libraries/designsystem/build.gradle.kts

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

2
libraries/matrix/build.gradle.kts

@ -11,7 +11,7 @@ dependencies {
api(project(":libraries:rustSdk")) api(project(":libraries:rustSdk"))
implementation(project(":libraries:core")) implementation(project(":libraries:core"))
implementation(libs.timber) 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.coil.compose)
implementation(libs.androidx.datastore.preferences) implementation(libs.androidx.datastore.preferences)
implementation(libs.serialization.json) implementation(libs.serialization.json)

8
libraries/textcomposer/build.gradle.kts

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

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

@ -2,9 +2,7 @@ package extension
import Versions import Versions
import com.android.build.api.dsl.CommonExtension 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() { fun CommonExtension<*, *, *, *>.androidConfig() {
defaultConfig { defaultConfig {
@ -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 @@
import extension.androidConfig package extension
import extension.composeConfig
import extension.proguardConfig
plugins { import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.androidTestImplementation
id("com.android.library") import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.debugImplementation
id("kotlin-android") import gradle.kotlin.dsl.accessors._4b7ad2363fc1fce7c774e054dc9a9300.implementation
// alias(libs.plugins.ksp) import org.gradle.kotlin.dsl.DependencyHandlerScope
// id("com.google.devtools.ksp") // version "1.7.20-1.0.7"
}
android {
androidConfig()
proguardConfig()
composeConfig()
}
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.ui:ui")
implementation("androidx.compose.material:material") implementation("androidx.compose.material:material")
implementation("androidx.compose.material3:material3") implementation("androidx.compose.material3:material3")
@ -29,7 +21,6 @@ dependencies {
implementation("com.airbnb.android:mavericks-compose:3.0.1") implementation("com.airbnb.android:mavericks-compose:3.0.1")
debugImplementation("androidx.compose.ui:ui-tooling") debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest") debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation("com.airbnb.android:showkase:1.0.0-beta14") 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 @@
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 @@
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 @@
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 @@
import extension.androidConfig import extension.androidConfig
import extension.proguardConfig
plugins { plugins {
id("com.android.library") id("com.android.library")
@ -8,5 +7,4 @@ plugins {
android { android {
androidConfig() androidConfig()
proguardConfig()
} }

Loading…
Cancel
Save