Skip to content

Commit

Permalink
Merge pull request #2 from GetStream/migrate/kts
Browse files Browse the repository at this point in the history
Migrate Gradle files to kts files
  • Loading branch information
skydoves authored Aug 15, 2022
2 parents 48d4ceb + d754c4c commit f95ce89
Show file tree
Hide file tree
Showing 18 changed files with 152 additions and 202 deletions.
92 changes: 0 additions & 92 deletions app/build.gradle

This file was deleted.

90 changes: 90 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-parcelize")
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
}

android {
namespace = "io.getstream.whatsappclone"
compileSdk = Configurations.compileSdk

defaultConfig {
applicationId = "io.getstream.whatsappclone"
minSdk = Configurations.minSdk
targetSdk = Configurations.targetSdk
versionCode = Configurations.versionCode
versionName = Configurations.versionName
}

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

lint {
abortOnError = false
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

packagingOptions {
resources.excludes.add("META-INF/LICENSE.txt")
resources.excludes.add("META-INF/NOTICE.txt")
resources.excludes.add("LICENSE.txt")
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}

buildTypes {
create("benchmark") {
isDebuggable = true
signingConfig = getByName("debug").signingConfig
matchingFallbacks += listOf("release")
}
}
}

dependencies {
// core modules
implementation(project(":core-designsystem"))
implementation(project(":core-navigation"))
implementation(project(":core-data"))

// feature modules
implementation(project(":feature-camera"))
implementation(project(":feature-chats"))
implementation(project(":feature-status"))
implementation(project(":feature-calls"))

// material
implementation(Dependencies.material)

// compose
implementation(Dependencies.composeActivity)
implementation(Dependencies.composeAnimation)
implementation(Dependencies.composeRuntime)
implementation(Dependencies.composeTooling)
implementation(Dependencies.composeConstraintLayout)

// jetpack
implementation(Dependencies.appStartUp)
implementation(Dependencies.hiltAndroid)
implementation(Dependencies.hiltNavigation)
kapt(Dependencies.hiltCompiler)

// image loading
implementation(Dependencies.landscapistGlide)

// pager
implementation(Dependencies.accompanistPager)
implementation(Dependencies.accompanistIndicator)

implementation(Dependencies.timber)
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import javax.inject.Inject
class MainActivity : ComponentActivity() {

@Inject
lateinit var appComposeNavigator: AppComposeNavigator
internal lateinit var appComposeNavigator: AppComposeNavigator

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
4 changes: 0 additions & 4 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

defaultConfig {
minSdk = 23
targetSdk = Configurations.targetSdk
Expand Down
36 changes: 0 additions & 36 deletions build.gradle

This file was deleted.

30 changes: 30 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
buildscript {
repositories {
google()
maven("https://plugins.gradle.org/m2/")
}
dependencies {
classpath(Dependencies.androidGradlePlugin)
classpath(Dependencies.kotlinGradlePlugin)
classpath(Dependencies.kotlinSerializationPlugin)
classpath(Dependencies.ksp)
classpath(Dependencies.spotlessGradlePlugin)
classpath(Dependencies.hiltPlugin)
}
}

subprojects {
apply(from = "$rootDir/spotless/spotless.gradle")

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions.freeCompilerArgs += listOf(
"-Xskip-prerelease-check",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xopt-in=com.google.accompanist.pager.ExperimentalPagerApi",
"-Xopt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-Xopt-in=androidx.lifecycle.compose.ExperimentalLifecycleComposeApi"
)
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
4 changes: 0 additions & 4 deletions core-data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

kotlin {
Expand Down
4 changes: 0 additions & 4 deletions core-database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
Expand Down
4 changes: 0 additions & 4 deletions core-designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

packagingOptions {
resources.excludes.add("META-INF/LICENSE.txt")
resources.excludes.add("META-INF/NOTICE.txt")
Expand Down
4 changes: 0 additions & 4 deletions core-model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
Expand Down
4 changes: 0 additions & 4 deletions core-navigation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

packagingOptions {
resources.excludes.add("META-INF/LICENSE.txt")
resources.excludes.add("META-INF/NOTICE.txt")
Expand Down
4 changes: 0 additions & 4 deletions core-network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ android {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
Expand Down
4 changes: 0 additions & 4 deletions feature-calls/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

lint {
abortOnError = false
}
Expand Down
4 changes: 0 additions & 4 deletions feature-camera/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

lint {
abortOnError = false
}
Expand Down
4 changes: 0 additions & 4 deletions feature-chats/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

lint {
abortOnError = false
}
Expand Down
4 changes: 0 additions & 4 deletions feature-status/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ android {
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER
}

kotlinOptions {
jvmTarget = "1.8"
}

lint {
abortOnError = false
}
Expand Down
Loading

0 comments on commit f95ce89

Please sign in to comment.