| /* |
| * 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") |
| } |
| |
| dependencies { |
| implementation(libs.kotlinStdlib) |
| testImplementation(libs.junit) |
| 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(project(":compose:compiler:compiler-hosted")) |
| 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") |
| } |
| |
| afterEvaluate { |
| tasks.withType(Test) { t -> |
| t.dependsOn(":compose:compiler:compiler:embeddedPlugin") |
| |
| maxHeapSize("1024m") |
| } |
| } |
| |
| android { |
| defaultConfig { |
| minSdkVersion 21 |
| } |
| lintOptions { |
| disable("SyntheticAccessor") |
| } |
| namespace "androidx.compose.runtime.tests" |
| } |
| |
| tasks.withType(KotlinCompile).configureEach { |
| kotlinOptions { |
| freeCompilerArgs += ["-opt-in=kotlin.RequiresOptIn"] |
| } |
| } |
| |
| androidx { |
| name = "AndroidX Compiler CLI Tests" |
| publish = Publish.NONE |
| inceptionYear = "2019" |
| description = "Contains test for the compose compiler plugin" |
| } |