-
-
Save lynnfield/b2d342ccca63ca6fbf4b401518c067ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.gradle.api.JavaVersion | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
class ModulePlugin implements Plugin<Project> { | |
@Override | |
void apply(Project target) { | |
target.pluginManager.apply("com.android.library") | |
target.pluginManager.apply("kotlin-android") | |
target.pluginManager.apply("kotlin-android-extensions") | |
target.pluginManager.apply("kotlin-kapt") | |
target.android { | |
compileSdkVersion Versions.sdk.compile | |
defaultConfig { | |
minSdkVersion Versions.sdk.min | |
targetSdkVersion Versions.sdk.target | |
javaCompileOptions { | |
annotationProcessorOptions { | |
arguments << ["dagger.gradle.incremental": "true"] | |
} | |
} | |
} | |
// resources prefix: modulename_ | |
resourcePrefix "${target.name.replace("-", "_")}_" | |
lintOptions { | |
baseline "lint-baseline.xml" | |
} | |
compileOptions { | |
encoding 'UTF-8' | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
testOptions { | |
unitTests { | |
returnDefaultValues true | |
includeAndroidResources true | |
} | |
} | |
} | |
target.repositories { | |
google() | |
mavenCentral() | |
jcenter() | |
// add other repositories here | |
} | |
target.dependencies { | |
implementation Dependencies.dagger.dagger | |
implementation Dependencies.dagger.android | |
kapt Dependencies.dagger.compiler | |
kapt Dependencies.dagger.androidProcessor | |
testImplementation Dependencies.test.junit | |
// add other dependencies here | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment