Skip to content

Commit

Permalink
feat: added build-logic and refactor plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-gupta99 committed May 8, 2024
1 parent fff8516 commit c49478e
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("mifos.android.lint")
apply("com.dropbox.dependency-guard")
}

extensions.configure<ApplicationExtension> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin
import org.mifos.configureFlavors
import org.mifos.configureKotlinAndroid
import org.mifos.configurePrintApksTask
import org.mifos.disableUnnecessaryAndroidTests
Expand All @@ -24,7 +23,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = 34
testOptions.animationsDisabled = true
configureFlavors(this)
// The resource prefix is derived from the module name,
// so resources inside ":core:module1" must be prefixed with "core_module1_"
resourcePrefix =
Expand Down
3 changes: 3 additions & 0 deletions build-logic/convention/bin/main/org/mifos/AndroidCompose.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ internal fun Project.configureAndroidCompose(
add("androidTestImplementation", platform(bom))
add("implementation", libs.findLibrary("androidx-compose-ui-tooling-preview").get())
add("debugImplementation", libs.findLibrary("androidx-compose-ui-tooling").get())
add("debugImplementation", libs.findLibrary("androidx.compose.foundation").get())
add("debugImplementation", libs.findLibrary("androidx.compose.material3").get())
add("debugImplementation", libs.findLibrary("androidx.compose.material.iconsExtended").get())
}

testOptions {
Expand Down
3 changes: 1 addition & 2 deletions build-logic/convention/bin/main/org/mifos/KotlinAndroid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ internal fun Project.configureKotlinAndroid(
compileSdk = 34

defaultConfig {
minSdk = 24
minSdk = 26
}

compileOptions {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
}

Expand Down
9 changes: 0 additions & 9 deletions build-logic/convention/bin/main/org/mifos/MifosBuildType.kt

This file was deleted.

42 changes: 0 additions & 42 deletions build-logic/convention/bin/main/org/mifos/MifosFlavor.kt

This file was deleted.

4 changes: 0 additions & 4 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,5 @@ gradlePlugin {
id = "mifos.jvm.library"
implementationClass = "JvmLibraryConventionPlugin"
}
register("androidFlavors") {
id = "mifos.android.application.flavors"
implementationClass = "AndroidApplicationFlavorsConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class AndroidApplicationConventionPlugin : Plugin<Project> {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("mifos.android.lint")
apply("com.dropbox.dependency-guard")
}

extensions.configure<ApplicationExtension> {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin
import org.mifos.configureFlavors
import org.mifos.configureKotlinAndroid
import org.mifos.configurePrintApksTask
import org.mifos.disableUnnecessaryAndroidTests
Expand All @@ -24,7 +23,6 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
configureKotlinAndroid(this)
defaultConfig.targetSdk = 34
testOptions.animationsDisabled = true
configureFlavors(this)
// The resource prefix is derived from the module name,
// so resources inside ":core:module1" must be prefixed with "core_module1_"
resourcePrefix =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ internal fun Project.configureAndroidCompose(
add("androidTestImplementation", platform(bom))
add("implementation", libs.findLibrary("androidx-compose-ui-tooling-preview").get())
add("debugImplementation", libs.findLibrary("androidx-compose-ui-tooling").get())
add("debugImplementation", libs.findLibrary("androidx.compose.foundation").get())
add("debugImplementation", libs.findLibrary("androidx.compose.material3").get())
add("debugImplementation", libs.findLibrary("androidx.compose.material.iconsExtended").get())
}

testOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ internal fun Project.configureKotlinAndroid(
compileSdk = 34

defaultConfig {
minSdk = 24
minSdk = 26
}

compileOptions {
// Up to Java 11 APIs are available through desugaring
// https://developer.android.com/studio/write/java11-minimal-support-table
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
}

Expand Down

This file was deleted.

42 changes: 0 additions & 42 deletions build-logic/convention/src/main/kotlin/org/mifos/MifosFlavor.kt

This file was deleted.

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ plugins {
alias(libs.plugins.hilt) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.androidx.navigation) apply false
alias(libs.plugins.ksp) apply false
}
37 changes: 2 additions & 35 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.mifos.android.library.compose)
alias(libs.plugins.kotlin.android)
id(libs.plugins.kotlin.kapt.get().pluginId)
}

android {
Expand All @@ -15,28 +14,11 @@ android {
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.8"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}
Expand All @@ -51,21 +33,6 @@ dependencies {
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.test.espresso.core)

// Jetpack Compose
// implementation(libs.androidx.material)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compiler)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.lifecycle.viewModelCompose)
implementation(libs.androidx.material.icons.extended)

// coil
implementation(libs.coil.kt.compose)

//DBFlow dependencies
kapt(libs.dbflow.processor)
implementation(libs.dbflow)
kapt(libs.github.dbflow.processor)
}
Loading

0 comments on commit c49478e

Please sign in to comment.