Skip to content

Commit

Permalink
Migrate from gradle to kts (#320)
Browse files Browse the repository at this point in the history
* Migrated settings.gradle & :formula build.gradle to kts

* Migrated rest of module build.gradle to kts

* Migrated project build.gradle file to kts

* Fixes

* Fixes
  • Loading branch information
mattkranzler5 authored Dec 12, 2023
1 parent 85664df commit 33b0f68
Show file tree
Hide file tree
Showing 40 changed files with 1,133 additions and 1,074 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.

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)
}
Loading

0 comments on commit 33b0f68

Please sign in to comment.