apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
	namespace 'de.markusfisch.android.binaryeye'
	compileSdkVersion sdk_version
	defaultConfig {
		minSdkVersion 9
		targetSdkVersion sdk_version

		versionCode 123
		versionName '1.61.2'
	}

	signingConfigs {
		release {
			keyAlias System.getenv('ANDROID_KEY_ALIAS')
			keyPassword System.getenv('ANDROID_KEY_PASSWORD')
			storePassword System.getenv('ANDROID_STORE_PASSWORD')
			def filePath = System.getenv('ANDROID_KEYFILE')
			storeFile filePath ? file(filePath) : null
		}
	}

	sourceSets {
		main.java.srcDirs += 'src/main/kotlin'
		androidTest.java.srcDirs += 'src/androidTest/kotlin'
		test.java.srcDirs += 'src/test/kotlin'
	}

	buildTypes {
		debug {
			applicationIdSuffix '.debug'
		}

		release {
			proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
			minifyEnabled true
			shrinkResources true
			signingConfig signingConfigs.release
		}
	}

	bundle {
		language {
			// To make the app bundle contain all language resources
			// so the in-app language setting works. Another solution
			// would be to use the PlayCore API to download language
			// resources on demand, but it makes much more sense to
			// simply include the ~60 kb than adding fragile code and
			// dependencies.
			enableSplit = false
		}
	}


	compileOptions {
		// Required for Gradle 8.
		sourceCompatibility = 17
		targetCompatibility = 17
	}
}

dependencies {
	testImplementation 'junit:junit:4.13.2'

	implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
	implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
	implementation "com.android.support:appcompat-v7:$support_version"
	implementation "com.android.support:design:$support_version"
	implementation "com.android.support:preference-v7:$support_version"
	implementation "com.android.support:preference-v14:$support_version"
	implementation 'com.github.markusfisch:CameraView:1.9.2'
	implementation 'com.github.markusfisch:ScalingImageView:1.4.1'
	implementation 'com.github.markusfisch:zxing-cpp:v2.2.0.1'
}
