Skip to content

Commit

Permalink
Added buildSrc
Browse files Browse the repository at this point in the history
  • Loading branch information
07jasjeet committed Jan 26, 2024
1 parent 8cfa43a commit 213ba37
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 37 deletions.
16 changes: 8 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ plugins {
}

android {
namespace = "com.jasjeet.type_safedatastore"
namespace = "com.jasjeet.typesafe_datastore_app"
compileSdk = 34

defaultConfig {
applicationId = "com.jasjeet.typesafe-datastore-app"
applicationId = "com.jasjeet.typesafe_datastore_app"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"
versionName = "1.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -30,11 +30,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = BuildVersions.Java.javaVersion
targetCompatibility = BuildVersions.Java.javaVersion
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = BuildVersions.Java.javaVersionNumber
}
buildFeatures {
compose = true
Expand Down Expand Up @@ -62,15 +62,15 @@ dependencies {
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation(platform("androidx.compose:compose-bom:2024.01.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation(platform("androidx.compose:compose-bom:2024.01.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
Expand Down
25 changes: 21 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.1" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.android.library") version "8.2.1" apply false
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:8.2.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${BuildVersions.kotlinVersion}")
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
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()
}
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/BuildVersions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.gradle.api.JavaVersion

object BuildVersions {
object Java {
val javaVersion = JavaVersion.VERSION_17
const val javaVersionNumber = "17"
}

const val kotlinVersion = "1.9.22"
}
15 changes: 0 additions & 15 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

rootProject.name = "typesafe-datastore"
include(":app")
include(":typesafe-datastore")
Expand Down
6 changes: 3 additions & 3 deletions typesafe-datastore-gson/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = BuildVersions.Java.javaVersion
targetCompatibility = BuildVersions.Java.javaVersion
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = BuildVersions.Java.javaVersionNumber
}
publishing {
singleVariant("release") {
Expand Down
8 changes: 4 additions & 4 deletions typesafe-datastore-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = BuildVersions.Java.javaVersion
targetCompatibility = BuildVersions.Java.javaVersion
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = BuildVersions.Java.javaVersionNumber
}
publishing {
singleVariant("release") {
Expand All @@ -41,7 +41,7 @@ android {

dependencies {
implementation(project(":typesafe-datastore"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
}

publishing {
Expand Down
6 changes: 3 additions & 3 deletions typesafe-datastore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = BuildVersions.Java.javaVersion
targetCompatibility = BuildVersions.Java.javaVersion
}
kotlinOptions {
jvmTarget = "17"
jvmTarget = BuildVersions.Java.javaVersionNumber
}
publishing {
singleVariant("release") {
Expand Down

0 comments on commit 213ba37

Please sign in to comment.