Browse Source

Merge pull request #460 from vector-im/feature/bma/logCleanup

Log cleanup
feature/jme/open-room-member-details-when-clicking-on-user-data
Benoit Marty 1 year ago committed by GitHub
parent
commit
11db753904
  1. 2
      .github/workflows/quality.yml
  2. 2
      .github/workflows/tests.yml
  3. 5
      app/build.gradle.kts
  4. 2
      appnav/build.gradle.kts
  5. 2
      gradle/libs.versions.toml
  6. 23
      plugins/src/main/kotlin/extension/DependencyHandleScope.kt
  7. 2
      samples/minimal/build.gradle.kts
  8. 4
      settings.gradle.kts
  9. 2
      tests/uitests/build.gradle.kts

2
.github/workflows/quality.yml

@ -9,7 +9,7 @@ on:
# Enrich gradle.properties for CI/CD # Enrich gradle.properties for CI/CD
env: env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options="-Xmx2g" -Dkotlin.incremental=false GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options="-Xmx2g" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon --warn
jobs: jobs:
check: check:

2
.github/workflows/tests.yml

@ -9,7 +9,7 @@ on:
# Enrich gradle.properties for CI/CD # Enrich gradle.properties for CI/CD
env: env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --warn
jobs: jobs:
tests: tests:

5
app/build.gradle.kts

@ -206,15 +206,14 @@ knit {
dependencies { dependencies {
allLibrariesImpl() allLibrariesImpl()
allServicesImpl() allServicesImpl()
allFeaturesImpl(rootDir) allFeaturesImpl(rootDir, logger)
implementation(projects.libraries.deeplink) implementation(projects.libraries.deeplink)
implementation(projects.tests.uitests) implementation(projects.tests.uitests)
implementation(projects.anvilannotations) implementation(projects.anvilannotations)
implementation(projects.appnav) implementation(projects.appnav)
anvil(projects.anvilcodegen) anvil(projects.anvilcodegen)
// https://developer.android.com/studio/write/java8-support#library-desugaring-versions coreLibraryDesugaring(libs.android.desugar)
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
implementation(libs.appyx.core) implementation(libs.appyx.core)
implementation(libs.androidx.splash) implementation(libs.androidx.splash)
implementation(libs.androidx.core) implementation(libs.androidx.core)

2
appnav/build.gradle.kts

@ -36,7 +36,7 @@ dependencies {
implementation(libs.dagger) implementation(libs.dagger)
kapt(libs.dagger.compiler) kapt(libs.dagger.compiler)
allFeaturesApi(rootDir) allFeaturesApi(rootDir, logger)
implementation(projects.libraries.core) implementation(projects.libraries.core)
implementation(projects.libraries.androidutils) implementation(projects.libraries.androidutils)

2
gradle/libs.versions.toml

@ -53,6 +53,8 @@ dependencygraph = "0.10"
[libraries] [libraries]
# Project # Project
android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref = "android_gradle_plugin" } android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref = "android_gradle_plugin" }
# https://developer.android.com/studio/write/java8-support#library-desugaring-versions
android_desugar = "com.android.tools:desugar_jdk_libs:2.0.3"
kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
# https://firebase.google.com/docs/android/setup#available-libraries # https://firebase.google.com/docs/android/setup#available-libraries
google_firebase_bom = "com.google.firebase:firebase-bom:32.0.0" google_firebase_bom = "com.google.firebase:firebase-bom:32.0.0"

23
plugins/src/main/kotlin/extension/DependencyHandleScope.kt

@ -19,6 +19,7 @@ package extension
import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.project import org.gradle.kotlin.dsl.project
import org.gradle.api.logging.Logger
import java.io.File import java.io.File
private fun DependencyHandlerScope.implementation(dependency: Any) = dependencies.add("implementation", dependency) private fun DependencyHandlerScope.implementation(dependency: Any) = dependencies.add("implementation", dependency)
@ -53,16 +54,21 @@ fun DependencyHandlerScope.composeDependencies(libs: LibrariesForLibs) {
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5") implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5")
} }
private fun DependencyHandlerScope.addImplementationProjects(directory: File, path: String, nameFilter: String) { private fun DependencyHandlerScope.addImplementationProjects(
directory.listFiles().orEmpty().forEach { file -> directory: File,
path: String,
nameFilter: String,
logger: Logger,
) {
directory.listFiles().orEmpty().also { it.sort() }.forEach { file ->
if (file.isDirectory) { if (file.isDirectory) {
val newPath = "$path:${file.name}" val newPath = "$path:${file.name}"
val buildFile = File(file, "build.gradle.kts") val buildFile = File(file, "build.gradle.kts")
if (buildFile.exists() && file.name == nameFilter) { if (buildFile.exists() && file.name == nameFilter) {
implementation(project(newPath)) implementation(project(newPath))
println("Added implementation(project($newPath))") logger.lifecycle("Added implementation(project($newPath))")
} else { } else {
addImplementationProjects(file, newPath, nameFilter) addImplementationProjects(file, newPath, nameFilter, logger)
} }
} }
} }
@ -100,11 +106,12 @@ fun DependencyHandlerScope.allServicesImpl() {
implementation(project(":services:toolbox:impl")) implementation(project(":services:toolbox:impl"))
} }
fun DependencyHandlerScope.allFeaturesApi(rootDir: File) { fun DependencyHandlerScope.allFeaturesApi(rootDir: File, logger: Logger) {
val featuresDir = File(rootDir, "features") val featuresDir = File(rootDir, "features")
addImplementationProjects(featuresDir, ":features", "api") addImplementationProjects(featuresDir, ":features", "api", logger)
} }
fun DependencyHandlerScope.allFeaturesImpl(rootDir: File) {
fun DependencyHandlerScope.allFeaturesImpl(rootDir: File, logger: Logger) {
val featuresDir = File(rootDir, "features") val featuresDir = File(rootDir, "features")
addImplementationProjects(featuresDir, ":features", "impl") addImplementationProjects(featuresDir, ":features", "impl", logger)
} }

2
samples/minimal/build.gradle.kts

@ -61,5 +61,5 @@ dependencies {
implementation(projects.features.login.impl) implementation(projects.features.login.impl)
implementation(projects.features.networkmonitor.impl) implementation(projects.features.networkmonitor.impl)
implementation(libs.coroutines.core) implementation(libs.coroutines.core)
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") coreLibraryDesugaring(libs.android.desugar)
} }

4
settings.gradle.kts

@ -56,13 +56,13 @@ include(":anvilcodegen")
include(":samples:minimal") include(":samples:minimal")
fun includeProjects(directory: File, path: String, maxDepth: Int = 1) { fun includeProjects(directory: File, path: String, maxDepth: Int = 1) {
directory.listFiles().orEmpty().forEach { file -> directory.listFiles().orEmpty().also { it.sort() }.forEach { file ->
if (file.isDirectory) { if (file.isDirectory) {
val newPath = "$path:${file.name}" val newPath = "$path:${file.name}"
val buildFile = File(file, "build.gradle.kts") val buildFile = File(file, "build.gradle.kts")
if (buildFile.exists()) { if (buildFile.exists()) {
include(newPath) include(newPath)
println("Included project: $newPath") logger.lifecycle("Included project: $newPath")
} else if (maxDepth > 0) { } else if (maxDepth > 0) {
includeProjects(file, newPath, maxDepth - 1) includeProjects(file, newPath, maxDepth - 1)
} }

2
tests/uitests/build.gradle.kts

@ -37,5 +37,5 @@ dependencies {
implementation(libs.showkase) implementation(libs.showkase)
allLibrariesImpl() allLibrariesImpl()
allFeaturesImpl(rootDir) allFeaturesImpl(rootDir, logger)
} }

Loading…
Cancel
Save