blob: 402db5295a700fc7ebcb0bfcb53e58fbe6d1ea3d [file] [log] [blame]
/*
* Copyright (C) 2021 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 androidx.build.LibraryGroups
import androidx.build.LibraryType
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import static androidx.build.dependencies.DependenciesKt.*
plugins {
id("AndroidXPlugin")
id("AndroidXUiPlugin")
id("com.android.library")
id("kotlin-android")
id("androidx.inspection")
}
dependencies {
kotlinPlugin project(":compose:compiler:compiler")
implementation("androidx.annotation:annotation:1.1.0")
implementation(KOTLIN_STDLIB)
compileOnly(projectOrArtifact(":inspection:inspection"))
compileOnly(project(":compose:runtime:runtime"))
compileOnly(project(":compose:ui:ui"))
compileOnly(project(":compose:ui:ui-tooling"))
androidTestImplementation(KOTLIN_COROUTINES_ANDROID)
androidTestImplementation(project(":compose:ui:ui-tooling"))
androidTestImplementation(project(":compose:material:material"))
androidTestImplementation(project(":inspection:inspection-testing"))
androidTestImplementation(project(":activity:activity-compose"))
androidTestImplementation(ANDROIDX_TEST_RUNNER)
androidTestImplementation(ANDROIDX_TEST_EXT_JUNIT)
androidTestImplementation(TRUTH)
}
androidx {
name = "Android Compose Layout Inspector"
type = LibraryType.IDE_PLUGIN
mavenGroup = LibraryGroups.Compose.UI
inceptionYear = "2021"
description = "Compose layout inspector. Exposes information to our tools for better IDE support."
}
android {
defaultConfig {
// layout inspection supported starting on Android Q
minSdkVersion 29
}
sourceSets {
main.resources.srcDirs += "src/main/proto"
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"
}
}
lintOptions {
// Restriction not important for inspectors, which only runs at dev-time
disable("SyntheticAccessor")
}
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
useIR = true
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-P", "plugin:androidx.compose.compiler.plugins.kotlin:sourceInformation=true"
]
}
}
inspection {
name = "compose-ui-inspection.jar"
}