blob: eb02a70d5ccdd43fcb947682bcacdab91a699ca1 [file] [log] [blame]
/*
* Copyright 2019 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import androidx.build.Publish
plugins {
id("AndroidXPlugin")
id("com.android.library")
id("kotlin-android")
id("com.google.protobuf")
}
dependencies {
implementation(libs.kotlinStdlib)
testImplementation(libs.junit)
testImplementation(libs.kotlinMetadataJvm)
testImplementation(libs.robolectric)
testCompileOnly(libs.kotlinCompiler)
testRuntimeOnly(
project(":compose:compiler:compiler-hosted:integration-tests:kotlin-compiler-repackaged")
)
// tools.jar required for com.sun.jdi
def toolsJar
if (JavaVersion.current().getMajorVersion() == "8") {
toolsJar = ((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs()
} else if (System.env.JAVA_TOOLS_JAR != null) {
toolsJar = System.env.JAVA_TOOLS_JAR
} else {
throw new Exception("If you are not using Java 8, JAVA_TOOLS_JAR env variable " +
"needs to be set to tools.jar from a Java 8 installation to build Doclava")
}
testImplementation(files(toolsJar))
testImplementation(libs.kotlinStdlib)
testImplementation(libs.protobufLite)
testImplementation(libs.guavaAndroid)
testImplementation(project(":compose:compiler:compiler-hosted"))
testImplementation(projectOrArtifact(":compose:foundation:foundation"))
testImplementation(projectOrArtifact(":compose:material:material"))
testImplementation(project(":compose:runtime:runtime"))
testImplementation(projectOrArtifact(":compose:ui:ui"))
testImplementation("androidx.core:core-ktx:1.1.0")
testImplementation("androidx.activity:activity-ktx:1.2.0")
testImplementation("org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3.4")
testImplementation("com.google.dagger:dagger:2.40.1")
}
afterEvaluate {
tasks.withType(Test) { t ->
t.dependsOn(":compose:compiler:compiler:embeddedPlugin")
maxHeapSize("1024m")
t.jvmArgs += ["--add-opens=jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED"]
}
}
android {
defaultConfig {
minSdkVersion 21
}
namespace "androidx.compose.runtime.tests"
}
androidx {
name = "Compiler CLI Tests"
publish = Publish.NONE
inceptionYear = "2019"
description = "Contains test for the compose compiler plugin"
}
protobuf {
protoc {
artifact = libs.protobufCompiler.get()
}
// Generates the java proto-lite code for the protos in this project. See
// https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
// for more information.
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option "lite"
}
}
}
}
}