Skip to content

Commit

Permalink
Migrated project build.gradle file to kts
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkranzler5 committed Dec 12, 2023
1 parent 3cf727f commit 3fdea68
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 196 deletions.
91 changes: 0 additions & 91 deletions build.gradle

This file was deleted.

55 changes: 55 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
buildscript {

repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}

dependencies {
classpath(libs.android.gradle)
classpath(libs.kotlin.gradle)
classpath(libs.jacoco.gradle)
classpath(libs.version.gradle)
classpath(libs.dokka.gradle)
classpath(libs.dokka.android.gradle)
classpath(libs.maven.publish.gradle)
}
}

apply(plugin = "com.github.ben-manes.versions")
apply(plugin = "org.jetbrains.dokka")
apply(from = "gradle/jacoco.gradle")
apply(from = "gradle/merge-reports.gradle")

allprojects {
repositories {
google()
mavenCentral()
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
dokkaSourceSets.named("main") {
jdkVersion.set(8)
skipDeprecated.set(true)
skipEmptyPackages.set(true)
reportUndocumented.set(false)
}
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}

tasks.register("install") {
val publishTasks = mutableListOf<Task>()
project.subprojects.forEach { project ->
val installTask = project.tasks.findByName("install") ?: project.tasks.findByName("publishToMavenLocal")
if (installTask != null) {
publishTasks.add(installTask)
}
}
dependsOn(publishTasks)
}

90 changes: 0 additions & 90 deletions dependencies.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions gradle/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apply plugin: "com.vanniktech.android.junit.jacoco"

junitJacoco {
// WARNING! Don"t upgrade unless https://github.com/Malinskiy/danger-jacoco/issues/10 is fixed
jacocoVersion = '0.8.2'
excludes = [
// Defaults
'**/androidx/**/*.*',
'**/*$$*',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*$Lambda$*.*', // Jacoco can not handle several "$" in class name.
'**/*$inlined$*.*', // Kotlin specific, Jacoco can not handle several "$" in class name.
'**/com/instacart/formula/test/**/*.*'
]
ignoreProjects = [
"samples/*"
]
includeNoLocationClasses = true
includeInstrumentationCoverageInMergedReport = true
}
11 changes: 11 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[versions]
android-gradle = "7.0.4"
dokka-gradle = "1.4.32"

minSdk = "21"
compileSdk = "30"
targetSdk = "30"
Expand All @@ -17,6 +20,14 @@ lint = "30.0.0"
autoService = "1.0-rc7"

[libraries]
android-gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka-gradle" }
dokka-android-gradle = { module = "org.jetbrains.dokka:android-documentation-plugin", version.ref = "dokka-gradle" }
maven-publish-gradle = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.14.2" }
version-gradle = { module = "com.github.ben-manes:gradle-versions-plugin", version = "0.38.0" }
jacoco-gradle = { module = "com.vanniktech:gradle-android-junit-jacoco-plugin", version = "0.16.0" }

kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

Expand Down
34 changes: 19 additions & 15 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
enableFeaturePreview("VERSION_CATALOGS")

include(":formula")
include(":formula-android")
include(":formula-android-compose")
include(":formula-android-tests")
include(":formula-lint")
include(":formula-rxjava3")
include(":formula-coroutines")
include(":formula-test")
include(":samples:composition")
include(":samples:counter")
include(":samples:custom-network-state-stream")
include(":samples:stopwatch")
include(":samples:stopwatch-coroutines")
include(":samples:stopwatch-compose")
include(":samples:todoapp")
include(
":formula",
":formula-android",
":formula-android-compose",
":formula-android-tests",
":formula-lint",
":formula-rxjava3",
":formula-coroutines",
":formula-test",
)
include(
":samples:composition",
":samples:counter",
":samples:custom-network-state-stream",
":samples:stopwatch",
":samples:stopwatch-coroutines",
":samples:stopwatch-compose",
":samples:todoapp"
)

0 comments on commit 3fdea68

Please sign in to comment.