Skip to content

Commit

Permalink
Migrate shared and compose sample to kotlin dsl
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMartinus committed Jul 15, 2023
1 parent ebe36b4 commit b0e256c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 25 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ buildscript {
ext.konfetti_version = "2.0.3"
ext.kotlin_version = "1.8.10"
ext.compose_version = "1.4.3"
ext.coroutines_version = "1.4.2"
repositories {
maven { url "https://plugins.gradle.org/m2/" }
google()
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
}
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
object Constants {
const val composeVersion = "1.4.3"
const val konfettiVersion = "2.0.3"
const val kotlinVersion = "1.8.10"
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "com.diffplug.spotless"
id("com.android.application")
id("kotlin-android")
id("com.diffplug.spotless")
}

spotless {
kotlin {
ktlint("0.37.2")
target "src/**/*.kt"
target("src/**/*.kt")
}
java {
removeUnusedImports()
googleJavaFormat("1.5")
target "**/*.java"
target("**/*.java")
}
}

Expand All @@ -21,21 +21,18 @@ android {
buildToolsVersion = "34.0.0"

defaultConfig {
applicationId = "nl.dionsegijn.sample.demo_compose"
minSdk = 21
targetSdk = 33
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary= true
useSupportLibrary = true
}
}

buildTypes {
release {
minifyEnabled = false
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
Expand All @@ -50,14 +47,16 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = compose_version
kotlinCompilerExtensionVersion = Constants.composeVersion
}
namespace = "nl.dionsegijn.xml.compose"
}

dependencies {
implementation(project(path: ":konfetti:compose"))
implementation(project(path: ":samples:shared"))
val composeVersion: String = Constants.composeVersion

implementation(project(path = ":konfetti:compose"))
implementation(project(path = ":samples:shared"))

implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.1")
Expand All @@ -67,9 +66,9 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.4.1")

implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.compose.material:material:$compose_version")
implementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation("androidx.compose.runtime:runtime:$compose_version")
implementation("androidx.compose.runtime:runtime-livedata:$compose_version")
implementation("androidx.compose.ui:ui:$composeVersion")
implementation("androidx.compose.material:material:$composeVersion")
implementation("androidx.compose.ui:ui-tooling:$composeVersion")
implementation("androidx.compose.runtime:runtime:$composeVersion")
implementation("androidx.compose.runtime:runtime-livedata:$composeVersion")
}
2 changes: 1 addition & 1 deletion samples/compose-kotlin/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.android.library"
id "kotlin-android"
id("com.android.library")
id("kotlin-android")
}

android {
Expand All @@ -16,7 +16,7 @@ android {

buildTypes {
release {
minifyEnabled = false
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
Expand All @@ -31,7 +31,7 @@ android {
}

dependencies {
implementation(project(path: ":konfetti:core"))
implementation(project(path = ":konfetti:core"))
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.0")
implementation("com.google.android.material:material:1.4.0")
Expand Down
2 changes: 1 addition & 1 deletion samples/shared/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down

0 comments on commit b0e256c

Please sign in to comment.