/* * Copyright 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import com.example.compose.rally.buildsrc.Libs import com.example.compose.rally.buildsrc.Urls import com.example.compose.rally.buildsrc.Versions buildscript { repositories { google() jcenter() } dependencies { classpath Libs.androidGradlePlugin classpath Libs.Kotlin.gradlePlugin } } plugins { id 'com.diffplug.spotless' version '5.7.0' } subprojects { repositories { google() mavenCentral() jcenter() if (!Libs.AndroidX.Compose.snapshot.isEmpty()) { maven { url Urls.composeSnapshotRepo } } } apply plugin: 'com.diffplug.spotless' spotless { kotlin { target '**/*.kt' targetExclude("$buildDir/**/*.kt") targetExclude('bin/**/*.kt') ktlint(Versions.ktlint) licenseHeaderFile rootProject.file('spotless/copyright.kt') } } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { // Treat all Kotlin warnings as errors allWarningsAsErrors = true freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' // Enable experimental coroutines APIs, including Flow freeCompilerArgs += '-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi' freeCompilerArgs += '-Xopt-in=kotlinx.coroutines.FlowPreview' freeCompilerArgs += '-Xopt-in=kotlin.Experimental' freeCompilerArgs += '-Xallow-jvm-ir-dependencies' // Set JVM target to 1.8 jvmTarget = "1.8" } } }