apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'de.mannodermaus.android-junit5'

android {
	def globalConfiguration = rootProject.extensions.getByName("ext")

	compileSdkVersion globalConfiguration["androidCompileSdkVersion"]
	buildToolsVersion globalConfiguration["androidBuildToolsVersion"]

	defaultConfig {
		minSdkVersion globalConfiguration["androidMinSdkVersion"]
		targetSdkVersion globalConfiguration["androidTargetSdkVersion"]

		buildConfigField 'int', 'VERSION_CODE', "${globalConfiguration["androidVersionCode"]}"
		buildConfigField "String", "VERSION_NAME", "\"${globalConfiguration["androidVersionName"]}\""

		testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
	}

	compileOptions {
		sourceCompatibility JavaVersion.VERSION_1_8
		targetCompatibility JavaVersion.VERSION_1_8

		coreLibraryDesugaringEnabled true
	}
	lint {
		abortOnError false
		ignoreWarnings true
		quiet true
	}

}

dependencies {
	def dependencies = rootProject.ext.dependencies

	implementation project(':generator-api')
	implementation project(':util')

	annotationProcessor project(':generator')
	annotationProcessor dependencies.daggerCompiler

	coreLibraryDesugaring dependencies.coreDesugaring

	compileOnly dependencies.javaxAnnotation

	api dependencies.timber
	api dependencies.dagger
	api dependencies.rxJava

	api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

	implementation dependencies.appcompat

	api dependencies.jsonWebTokenApi
	implementation dependencies.jsonWebTokenImpl
	implementation dependencies.jsonWebTokenJson

	// test
	testImplementation dependencies.junit
	testImplementation dependencies.junitApi
	testRuntimeOnly dependencies.junitEngine
	testImplementation dependencies.junitParams

	testRuntimeOnly dependencies.junit4Engine

	testImplementation dependencies.mockito
	testImplementation dependencies.mockitoKotlin
	testImplementation dependencies.mockitoInline
	testImplementation dependencies.hamcrest
}

configurations {
	all*.exclude group: 'com.google.android', module: 'android'
}
