plugins {
	id 'com.android.library'
	id 'kotlin-android'
	id 'kotlin-android-extensions'
	id 'kotlin-kapt'
	id 'com.novoda.bintray-release'
}

publish {
	bintrayUser = rootProject.ext.publish_user_org
	bintrayKey = rootProject.ext.publish_bintray_key
	uploadName = rootProject.ext.framework_package_name
	userOrg = rootProject.ext.publish_user_org
	groupId = rootProject.ext.publish_group_id
	artifactId = rootProject.ext.framework_artifact_id
	publishVersion = rootProject.ext.framework_version_name
	desc = rootProject.ext.framework_artifact_id
	website = rootProject.ext.website + rootProject.ext.framework_artifact_id
	dryRun = false
}

android {
	compileSdkVersion rootProject.ext.compile_sdk_version
	defaultConfig {
		minSdkVersion rootProject.ext.min_sdk_version
		versionCode rootProject.ext.framework_version_code
		versionName rootProject.ext.framework_version_name
		kapt {
			arguments {
				arg('eventBusIndex', 'com.djangoogle.framework.FrameworkEventBusIndex')
			}
		}
	}
	compileOptions {
		sourceCompatibility rootProject.ext.java_version
		targetCompatibility rootProject.ext.java_version
	}
	sourceSets {
		main.java.srcDirs += 'src/main/kotlin'
	}
}

dependencies {
	//https://www.kotlincn.net/docs/reference/using-gradle.html
	implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
	implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
	//https://maven.google.com
	api "com.google.android.material:material:$androidx_material_version"
	api "androidx.constraintlayout:constraintlayout:$androidx_constraintlayout_version"
	//https://github.com/bumptech/glide
	api "com.github.bumptech.glide:glide:$glide_version"
	kapt "com.github.bumptech.glide:compiler:$glide_version"
	//https://github.com/greenrobot/EventBus
	api "org.greenrobot:eventbus:$event_bus_version"
	//http://greenrobot.org/eventbus/documentation/subscriber-index
	kapt "org.greenrobot:eventbus-annotation-processor:$event_bus_version"
	//https://github.com/square/okhttp
	api "com.squareup.okhttp3:okhttp:$okhttp_version"
	//https://github.com/square/retrofit
	api "com.squareup.retrofit2:retrofit:$retrofit2_version"
	//https://github.com/square/retrofit/tree/master/retrofit-converters/gson
	api "com.squareup.retrofit2:converter-gson:$retrofit2_version"
	//https://github.com/square/retrofit/tree/master/retrofit-adapters/rxjava2
	api "com.squareup.retrofit2:adapter-rxjava2:$retrofit2_version"
	//https://github.com/ReactiveX/RxAndroid
	api "io.reactivex.rxjava2:rxandroid:$rx_android_version"
	//https://github.com/Blankj/AndroidUtilCode/blob/master/utilcode/README-CN.md
	api "com.blankj:utilcodex:$util_codex_version"
	//https://github.com/trello/RxLifecycle
	api "com.trello.rxlifecycle3:rxlifecycle-components:$rx_lifecycle_version"
	api "com.trello.rxlifecycle3:rxlifecycle-kotlin:$rx_lifecycle_version"
	//https://github.com/JakeWharton/RxBinding
	api 'com.jakewharton.rxbinding3:rxbinding:3.0.0'
	//https://github.com/ihsanbal/LoggingInterceptor
	api('com.github.ihsanbal:LoggingInterceptor:3.0.0') {
		exclude group: 'org.json', module: 'json'
	}
	//https://github.com/franmontiel/PersistentCookieJar
	api 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
	//https://github.com/google/gson
	api 'com.google.code.gson:gson:2.8.6'
	//https://github.com/yanzhenjie/Album
	api 'com.yanzhenjie:album:2.1.3'
	//https://github.com/LitePalFramework/LitePal
	api 'org.litepal.android:java:3.0.0'
	//https://github.com/Tencent/MMKV
	api 'com.tencent:mmkv-static:1.0.22'
	//https://github.com/ybq/Android-SpinKit
	api 'com.github.ybq:Android-SpinKit:1.4.0'
}
