/* * 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 * * http://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.owl.buildsrc.Libs import com.example.owl.buildsrc.Versions buildscript { repositories { google() jcenter() } dependencies { classpath Libs.androidGradlePlugin classpath Libs.Kotlin.gradlePlugin } } plugins { id 'com.diffplug.spotless' version '5.10.0' } subprojects { repositories { google() jcenter() if (!Libs.AndroidX.Compose.snapshot.isEmpty()) { maven { url "https://androidx.dev/snapshots/builds/${Libs.AndroidX.Compose.snapshot}/artifacts/repository/" } maven { url "http://androidx.dev/storage/repository/androidx/constraintlayout" } } maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { jvmTarget = '1.8' allWarningsAsErrors = true // Opt-in to experimental compose APIs freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn' } } configurations.configureEach { // androidx.test forces JUnit, 4.12, prefer 4.13 resolutionStrategy { force Libs.JUnit.junit } } apply plugin: 'com.diffplug.spotless' spotless { kotlin { target '**/*.kt' targetExclude("$buildDir/**/*.kt") targetExclude('bin/**/*.kt') ktlint(Versions.ktlint).userData([android: "true"]) licenseHeaderFile rootProject.file('spotless/copyright.kt') } } }