Skip to content

Commit

Permalink
Migrated rest of module build.gradle to kts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkranzler5 committed Dec 11, 2023
1 parent 8e2b8be commit 3cf727f
Show file tree
Hide file tree
Showing 30 changed files with 823 additions and 744 deletions.
77 changes: 0 additions & 77 deletions formula-android-compose/build.gradle

This file was deleted.

75 changes: 75 additions & 0 deletions formula-android-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
id("com.android.library")
id("kotlin-android")
}

apply {
from("$rootDir/.buildscript/configure-signing.gradle")
from("$rootDir/.buildscript/jacoco-workaround.gradle")
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
}

buildFeatures {
compose = true
}

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

composeOptions {
kotlinCompilerVersion = libs.versions.kotlin.get()
kotlinCompilerExtensionVersion = libs.versions.compose.get()
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions {
jvmTarget = "1.8"
}
}

task<Jar>("sourcesJar") {
from(android.sourceSets["main"].java.srcDirs)
archiveClassifier.set("sources")
}

task<Javadoc>("javadoc") {
isFailOnError = false
source(android.sourceSets["main"].java.getSourceFiles())
classpath += project.files(android.bootClasspath.joinToString(separator = File.pathSeparator))
classpath += configurations.api
classpath += configurations.implementation
}

task<Jar>("javadocJar") {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
from(tasks["javadoc"].path)
}

artifacts {
archives(tasks["sourcesJar"])
archives(tasks["javadocJar"])
}

dependencies {
api(project(":formula-android"))
api(libs.compose.ui)

implementation(libs.compose.rxjava3)

testImplementation(libs.androidx.test.rules)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.espresso.core)
testImplementation(libs.truth)
testImplementation(libs.kotlin.reflect)
}
58 changes: 0 additions & 58 deletions formula-android-tests/build.gradle

This file was deleted.

61 changes: 61 additions & 0 deletions formula-android-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-parcelize")
}

apply {
from("$rootDir/.buildscript/jacoco-workaround.gradle")
}

android {
compileSdk = 28
defaultConfig {
applicationId = "com.instacart.formula.samples"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = 28 // Using sdk 28 for robolectric tests.
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

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

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

testOptions {
unitTests {
isIncludeAndroidResources = true
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
implementation(project(":formula-rxjava3"))
implementation(project(":formula-android"))

implementation(libs.kotlin)
implementation(libs.androidx.appcompat)
implementation(libs.lifecycle.extensions)

testImplementation(libs.junit)
testImplementation(libs.truth)
testImplementation(libs.androidx.test.rules)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.espresso.core)
testImplementation(libs.robolectric)
}
75 changes: 0 additions & 75 deletions formula-android/build.gradle

This file was deleted.

Loading

0 comments on commit 3cf727f

Please sign in to comment.