Skip to content

Commit

Permalink
Merge pull request #434 from rudderlabs/feature/sdk-1891-convert-groo…
Browse files Browse the repository at this point in the history
…vy-buildgradle-files-to-buildgradlekts

feat: convert groovy build.gradle files to build.gradle.kts
  • Loading branch information
ChryssaAliferi authored Jun 18, 2024
2 parents cb3b826 + 54014d5 commit 828d2f9
Show file tree
Hide file tree
Showing 30 changed files with 585 additions and 796 deletions.
102 changes: 0 additions & 102 deletions android/build.gradle

This file was deleted.

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

android {

namespace = "com.rudderstack.android"

compileSdk = RudderstackBuildConfig.Android.COMPILE_SDK

buildFeatures {
buildFeatures {
buildConfig = true
}
}
defaultConfig {
minSdk = RudderstackBuildConfig.Android.MIN_SDK
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
buildConfigField(
"String",
"LIBRARY_VERSION_NAME",
RudderstackBuildConfig.Version.VERSION_NAME
)
}

buildTypes {
named("release") {
isMinifyEnabled = false
setProguardFiles(
listOf(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
)
}
}
compileOptions {
sourceCompatibility = RudderstackBuildConfig.Build.JAVA_VERSION
targetCompatibility = RudderstackBuildConfig.Build.JAVA_VERSION
}
kotlinOptions {
jvmTarget = RudderstackBuildConfig.Build.JVM_TARGET
javaParameters = true
}
testOptions {
unitTests {
this.isIncludeAndroidResources = true
}
}
}

dependencies {
implementation(libs.android.core.ktx)
api(project(":core"))
api(project(":models"))
api(project(":repository"))

compileOnly(project(":jacksonrudderadapter"))
compileOnly(project(":gsonrudderadapter"))
compileOnly(project(":moshirudderadapter"))
compileOnly(project(":rudderjsonadapter"))
compileOnly(libs.work)
compileOnly(libs.work.multiprocess)

testImplementation(project(":jacksonrudderadapter"))
testImplementation(project(":gsonrudderadapter"))
testImplementation(project(":moshirudderadapter"))
testImplementation(project(":rudderjsonadapter"))
testImplementation(project(":libs:test-common"))
testImplementation(libs.android.x.test)
testImplementation(libs.android.x.testrules)
testImplementation(libs.android.x.test.ext.junitktx)
testImplementation(libs.awaitility)
testImplementation(libs.hamcrest)
testImplementation(libs.junit)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.mockk)
testImplementation(libs.mockk.agent)
testImplementation(libs.robolectric)
testImplementation(libs.work.test)

androidTestImplementation(libs.android.x.test.ext.junitktx)
}

apply(from = "${project.projectDir.parentFile}/gradle/artifacts-aar.gradle")
apply(from = "${project.projectDir.parentFile}/gradle/mvn-publish.gradle")
apply(from = "${project.projectDir.parentFile}/gradle/codecov.gradle")
46 changes: 0 additions & 46 deletions build.gradle

This file was deleted.

28 changes: 28 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
extra["compose_version"] = RudderstackBuildConfig.Kotlin.COMPILER_EXTENSION_VERSION
repositories {
google()
mavenCentral()
}
dependencies {
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
}
}

plugins {
alias(libs.plugins.gradle.nexus.publish)
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
}

subprojects {
version = properties[RudderstackBuildConfig.ReleaseInfo.VERSION_NAME].toString()
group = properties[RudderstackBuildConfig.ReleaseInfo.GROUP_NAME].toString()
}

apply(from = rootProject.file("gradle/promote.gradle"))
apply(from = rootProject.file("gradle/codecov.gradle"))
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`
id("java-library")
}
repositories {
gradlePluginPortal()
}
28 changes: 28 additions & 0 deletions buildSrc/src/main/kotlin/RudderstackBuildConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import org.gradle.api.JavaVersion

object RudderstackBuildConfig {

object Build {
val JAVA_VERSION = JavaVersion.VERSION_17
val JVM_TARGET = "17"
}

object Android {
val COMPILE_SDK = 34
val MIN_SDK = 19
val TARGET_SDK = COMPILE_SDK
}

object Version {
val VERSION_NAME = "\"2.0\""
}

object Kotlin {
val COMPILER_EXTENSION_VERSION = "1.4.8"
}

object ReleaseInfo {
val VERSION_NAME = ""
val GROUP_NAME = ""
}
}
59 changes: 0 additions & 59 deletions core/build.gradle

This file was deleted.

26 changes: 26 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
plugins {
id("java-library")
id("kotlin")
}

dependencies {
api(project(":rudderjsonadapter"))
api(project(":models"))
api(project(":web"))

testImplementation(libs.awaitility)
testImplementation(libs.junit)
testImplementation(libs.hamcrest)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.mockk)

testImplementation(project(":moshirudderadapter"))
testImplementation(project(":libs:test-common"))
testImplementation(project(":gsonrudderadapter"))
testImplementation(project(":jacksonrudderadapter"))
}

apply(from = "${project.projectDir.parentFile}/gradle/artifacts-jar.gradle")
apply(from = "${project.projectDir.parentFile}/gradle/mvn-publish.gradle")
apply(from = "${project.projectDir.parentFile}/gradle/codecov.gradle")
Loading

0 comments on commit 828d2f9

Please sign in to comment.