gradle: reformat all build files with 2SI

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-10-29 16:38:01 +05:30
parent 7c4e4aea26
commit cec0e1bbcb
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
5 changed files with 168 additions and 168 deletions

View file

@ -1,95 +1,95 @@
plugins { plugins {
id "kotlin-kapt" id "kotlin-kapt"
id "dagger.hilt.android.plugin" id "dagger.hilt.android.plugin"
} }
final def keystorePropertiesFile = rootProject.file("keystore.properties") final def keystorePropertiesFile = rootProject.file("keystore.properties")
android { android {
adbOptions { adbOptions {
installOptions = ["--user 0"] installOptions = ["--user 0"]
} }
defaultConfig { defaultConfig {
applicationId "dev.msfjarvis.lobsters" applicationId "dev.msfjarvis.lobsters"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
proguardFiles "proguard-android-optimize.txt", "proguard-rules.pro" proguardFiles "proguard-android-optimize.txt", "proguard-rules.pro"
}
} }
}
compileOptions.coreLibraryDesugaringEnabled = true compileOptions.coreLibraryDesugaringEnabled = true
buildFeatures.compose = true buildFeatures.compose = true
composeOptions { composeOptions {
kotlinCompilerVersion "${kotlin_version}" kotlinCompilerVersion "${kotlin_version}"
kotlinCompilerExtensionVersion "${compose_version}" kotlinCompilerExtensionVersion "${compose_version}"
} }
if (keystorePropertiesFile.exists()) { if (keystorePropertiesFile.exists()) {
final def keystoreProperties = new Properties() final def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs { signingConfigs {
release { release {
keyAlias keystoreProperties["keyAlias"] keyAlias keystoreProperties["keyAlias"]
keyPassword keystoreProperties["keyPassword"] keyPassword keystoreProperties["keyPassword"]
storeFile rootProject.file(keystoreProperties["storeFile"]) storeFile rootProject.file(keystoreProperties["storeFile"])
storePassword keystoreProperties["storePassword"] storePassword keystoreProperties["storePassword"]
} }
}
buildTypes.debug.signingConfig = signingConfigs.release
buildTypes.release.signingConfig = signingConfigs.release
} }
buildTypes.debug.signingConfig = signingConfigs.release
buildTypes.release.signingConfig = signingConfigs.release
}
} }
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions { kotlinOptions {
freeCompilerArgs += [ freeCompilerArgs += [
"-Xallow-jvm-ir-dependencies", "-Xallow-jvm-ir-dependencies",
"-Xskip-prerelease-check", "-Xskip-prerelease-check",
"-Xopt-in=kotlin.RequiresOptIn", "-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
] ]
} }
} }
dependencies { dependencies {
kapt "com.google.dagger:hilt-compiler:$hilt_dagger_version" kapt "com.google.dagger:hilt-compiler:$hilt_dagger_version"
kapt "androidx.hilt:hilt-compiler:$hilt_androidx_version" kapt "androidx.hilt:hilt-compiler:$hilt_androidx_version"
implementation(project(":data")) implementation(project(":data"))
implementation(project(":lobsters-api")) implementation(project(":lobsters-api"))
implementation(project(":model")) implementation(project(":model"))
implementation "androidx.core:core-ktx:$core_version" implementation "androidx.core:core-ktx:$core_version"
implementation "androidx.activity:activity-ktx:$activity_version" implementation "androidx.activity:activity-ktx:$activity_version"
implementation "androidx.appcompat:appcompat:$appcompat_version" implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.browser:browser:$browser_version" implementation "androidx.browser:browser:$browser_version"
implementation "androidx.compose.foundation:foundation:$compose_version" implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.foundation:foundation-layout:$compose_version" implementation "androidx.compose.foundation:foundation-layout:$compose_version"
implementation "androidx.compose.foundation:foundation-text:$compose_version" implementation "androidx.compose.foundation:foundation-text:$compose_version"
implementation "androidx.compose.runtime:runtime:$compose_version" implementation "androidx.compose.runtime:runtime:$compose_version"
implementation "androidx.compose.material:material:$compose_version" implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.compiler:compiler:$compose_version" implementation "androidx.compose.compiler:compiler:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version" implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-text:$compose_version" implementation "androidx.compose.ui:ui-text:$compose_version"
implementation "androidx.compose.ui:ui-text-android:$compose_version" implementation "androidx.compose.ui:ui-text-android:$compose_version"
implementation "androidx.compose.ui:ui-unit:$compose_version" implementation "androidx.compose.ui:ui-unit:$compose_version"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_androidx_version" implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_androidx_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.navigation:navigation-compose:$nav_compose_version" implementation "androidx.navigation:navigation-compose:$nav_compose_version"
implementation "androidx.ui:ui-tooling:$compose_version" implementation "androidx.ui:ui-tooling:$compose_version"
implementation "com.google.android.material:material:$material_version" implementation "com.google.android.material:material:$material_version"
implementation "com.google.dagger:hilt-android:$hilt_dagger_version" implementation "com.google.dagger:hilt-android:$hilt_dagger_version"
implementation "dev.chrisbanes.accompanist:accompanist-coil:$accompanist_version" implementation "dev.chrisbanes.accompanist:accompanist-coil:$accompanist_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "saschpe.android:customtabs:$customtabs_version" implementation "saschpe.android:customtabs:$customtabs_version"
androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_dagger_version" androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_dagger_version"
testImplementation "junit:junit:$junit_version" testImplementation "junit:junit:$junit_version"
androidTestImplementation "androidx.ui:ui-test:$compose_version" androidTestImplementation "androidx.ui:ui-test:$compose_version"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_version" coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_version"
} }

View file

@ -1,97 +1,97 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext { ext {
accompanist_version = "0.3.2" accompanist_version = "0.3.2"
activity_version = "1.2.0-beta01" activity_version = "1.2.0-beta01"
agp_version = "4.2.0-alpha15" agp_version = "4.2.0-alpha15"
appcompat_version = "1.3.0-alpha02" appcompat_version = "1.3.0-alpha02"
browser_version = "1.3.0-beta01" browser_version = "1.3.0-beta01"
compose_version = "1.0.0-alpha06" compose_version = "1.0.0-alpha06"
core_version = "1.5.0-alpha04" core_version = "1.5.0-alpha04"
coroutines_version = "1.4.0" coroutines_version = "1.4.0"
customtabs_version = "3.0.2" customtabs_version = "3.0.2"
dagger_version = "2.29.1" dagger_version = "2.29.1"
desugar_version = "1.0.10" desugar_version = "1.0.10"
hilt_androidx_version = "1.0.0-alpha02" hilt_androidx_version = "1.0.0-alpha02"
hilt_dagger_version = "2.29.1-alpha" hilt_dagger_version = "2.29.1-alpha"
junit_version = "4.13.1" junit_version = "4.13.1"
kotlin_version = "1.4.10" kotlin_version = "1.4.10"
lifecycle_version = "2.3.0-beta01" lifecycle_version = "2.3.0-beta01"
material_version = "1.3.0-alpha03" material_version = "1.3.0-alpha03"
moshi_version = "1.11.0" moshi_version = "1.11.0"
nav_compose_version = "1.0.0-alpha01" nav_compose_version = "1.0.0-alpha01"
okhttp_version = "4.10.0-RC1" okhttp_version = "4.10.0-RC1"
retrofit_version = "2.9.0" retrofit_version = "2.9.0"
room_version = "2.3.0-alpha03" room_version = "2.3.0-alpha03"
} }
repositories { repositories {
google() google()
jcenter() jcenter()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$agp_version" classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_dagger_version" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_dagger_version"
} }
} }
plugins { plugins {
id("com.github.ben-manes.versions") version "0.33.0" id("com.github.ben-manes.versions") version "0.33.0"
} }
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
} }
} }
subprojects { subprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
} }
if (name == "app") { if (name == "app") {
apply plugin: "com.android.application" apply plugin: "com.android.application"
} else { } else {
apply plugin: "com.android.library" apply plugin: "com.android.library"
} }
apply plugin: "kotlin-android" apply plugin: "kotlin-android"
android { android {
compileSdkVersion 30 compileSdkVersion 30
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
} }
configurations.all { compileOptions {
resolutionStrategy { sourceCompatibility JavaVersion.VERSION_1_8
force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" targetCompatibility JavaVersion.VERSION_1_8
force "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
force "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
}
} }
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { }
kotlinOptions { configurations.all {
jvmTarget = JavaVersion.VERSION_1_8 resolutionStrategy {
} force "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
force "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
force "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
} }
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
}
} }
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
tasks { tasks {
wrapper { wrapper {
gradleVersion = "6.7" gradleVersion = "6.7"
distributionType = Wrapper.DistributionType.ALL distributionType = Wrapper.DistributionType.ALL
} }
} }

View file

@ -1,12 +1,12 @@
plugins { plugins {
id 'kotlin-kapt' id 'kotlin-kapt'
} }
dependencies { dependencies {
implementation project(":model") implementation project(":model")
kapt "androidx.room:room-compiler:$room_version" kapt "androidx.room:room-compiler:$room_version"
api "androidx.room:room-runtime:$room_version" api "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version" implementation "androidx.room:room-ktx:$room_version"
implementation "com.squareup.moshi:moshi:$moshi_version" implementation "com.squareup.moshi:moshi:$moshi_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
} }

View file

@ -1,14 +1,14 @@
plugins { plugins {
id 'kotlin-kapt' id 'kotlin-kapt'
} }
dependencies { dependencies {
implementation project(":model") implementation project(":model")
implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version" implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
kaptTest "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" kaptTest "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
testImplementation "junit:junit:$junit_version" testImplementation "junit:junit:$junit_version"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
//noinspection GradleDependency //noinspection GradleDependency
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version" testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version"
} }

View file

@ -1,8 +1,8 @@
plugins { plugins {
id 'kotlin-kapt' id 'kotlin-kapt'
} }
dependencies { dependencies {
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
implementation "com.squareup.moshi:moshi:$moshi_version" implementation "com.squareup.moshi:moshi:$moshi_version"
} }