1 /* 2 * Copyright (C) 2020 The Dagger Authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package dagger.hilt.android.plugin 17 18 /** 19 * Configuration options for the Hilt Gradle Plugin 20 */ 21 interface HiltExtension { 22 23 /** 24 * If set to `true`, Hilt will adjust the compile classpath such that it includes transitive 25 * dependencies, ignoring `api` or `implementation` boundaries during compilation. You should 26 * enable this option if your project has multiple level of transitive dependencies that contain 27 * injected classes or entry points. 28 * 29 * Enabling this option also requires android.lintOptions.checkReleaseBuilds to be set to 'false' 30 * if the Android Gradle Plugin version being used is less than 7.0. 31 * 32 * See https://github.com/google/dagger/issues/1991 for more context. 33 */ 34 var enableExperimentalClasspathAggregation: Boolean 35 36 /** 37 * If set to `true`, Hilt will register a transform task that will rewrite `@AndroidEntryPoint` 38 * annotated classes before the host-side JVM tests run. You should enable this option if you are 39 * running Robolectric UI tests as part of your JUnit tests. 40 * 41 * This flag is not necessary if when com.android.tools.build:gradle:4.2.0+ is used and will be 42 * deprecated in a future version. 43 */ 44 var enableTransformForLocalTests: Boolean 45 } 46 47 internal open class HiltExtensionImpl : HiltExtension { 48 override var enableExperimentalClasspathAggregation: Boolean = false 49 override var enableTransformForLocalTests: Boolean = false 50 } 51