Skip to content

Commit

Permalink
Move logger to separate module (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr3y-the-programmer authored Mar 2, 2024
1 parent 89a37a8 commit 0925137
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ dependencies {

implementation(projects.core.model)
implementation(projects.core.database)
implementation(projects.core.logger)
implementation(platform(libs.compose.bom))
implementation(libs.compose.htmlconverter)
implementation(libs.kmpalette.core)
Expand All @@ -166,8 +167,7 @@ dependencies {
implementation(libs.ktor.content.negotation)
implementation(libs.ktor.kotlinx.serialization)
implementation(libs.result)
implementation(libs.kermit)
implementation(libs.kermit.crashlytics)

implementation(libs.kotlinx.serialization)

implementation(platform(libs.firebase.bom))
Expand Down Expand Up @@ -198,6 +198,7 @@ dependencies {

kspTest(libs.hilt.compiler)
testImplementation(projects.core.databaseTestFixtures)
testImplementation(projects.core.loggerTestFixtures)
testImplementation(libs.junit)
testImplementation(libs.assertk)
testImplementation(libs.coroutines.test)
Expand Down
55 changes: 55 additions & 0 deletions core/logger-test-fixtures/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint)
}

android {
namespace = "com.mr3y.podcaster.core.logger"
compileSdk = 34

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = false
buildConfig = false
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

ktlint {
filter {
exclude("**/generated/**")
exclude("**/build/**")
}
}

dependencies {

implementation(projects.core.logger)
}
Empty file.
21 changes: 21 additions & 0 deletions core/logger-test-fixtures/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions core/logger-test-fixtures/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
60 changes: 60 additions & 0 deletions core/logger/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
plugins {
alias(libs.plugins.com.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ktlint)
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
}

android {
namespace = "com.mr3y.podcaster.core.logger"
compileSdk = 34

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = false
buildConfig = false
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

ktlint {
filter {
exclude("**/generated/**")
exclude("**/build/**")
}
}

dependencies {
ksp(libs.hilt.compiler)
implementation(libs.hilt.runtime)

implementation(libs.kermit)
implementation(libs.kermit.crashlytics)
}
Empty file added core/logger/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions core/logger/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions core/logger/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ include(":app")
include(":core:model")
include(":core:database")
include(":core:database-test-fixtures")
include(":core:logger")
include(":core:logger-test-fixtures")

0 comments on commit 0925137

Please sign in to comment.