~captainepoch/husky

d54974a18f17ef1e9de4ef23a47aabb6177da637 — Adolfo Santiago 7 months ago 8910520
Changes on flavors

Old flavors has been changed to "beta" and "stable", so beta versions of
husky can be released with the proper flavor config, along the name of
the application, the package name, and the versions.

In the future it will ship ACRA too, so random crashes can be reported
with an email (using a template).
21 files changed, 288 insertions(+), 243 deletions(-)

M husky/app/build.gradle.kts
R husky/app/src/{green/res/mipmap-anydpi-v26/ic_launcher.xml => beta/res/mipmap-anydpi-v26/ic_launcher.xml}
R husky/app/src/{green/res/mipmap-hdpi/ic_launcher.png => beta/res/mipmap-hdpi/ic_launcher.png}
R husky/app/src/{green/res/mipmap-mdpi/ic_launcher.png => beta/res/mipmap-mdpi/ic_launcher.png}
R husky/app/src/{green/res/mipmap-xhdpi/ic_launcher.png => beta/res/mipmap-xhdpi/ic_launcher.png}
R husky/app/src/{green/res/mipmap-xxhdpi/ic_launcher.png => beta/res/mipmap-xxhdpi/ic_launcher.png}
R husky/app/src/{green/res/mipmap-xxxhdpi/ic_launcher.png => beta/res/mipmap-xxxhdpi/ic_launcher.png}
A husky/app/src/beta/res/values/strings.xml
R husky/app/src/{blue/res/mipmap-anydpi-v26/ic_launcher.xml => husky/res/mipmap-anydpi-v26/ic_launcher.xml}
R husky/app/src/{blue/res/mipmap-hdpi/ic_launcher.png => husky/res/mipmap-hdpi/ic_launcher.png}
R husky/app/src/{blue/res/mipmap-hdpi/ic_shortcut_compose.png => husky/res/mipmap-hdpi/ic_shortcut_compose.png}
R husky/app/src/{blue/res/mipmap-mdpi/ic_launcher.png => husky/res/mipmap-mdpi/ic_launcher.png}
R husky/app/src/{blue/res/mipmap-mdpi/ic_shortcut_compose.png => husky/res/mipmap-mdpi/ic_shortcut_compose.png}
R husky/app/src/{blue/res/mipmap-xhdpi/ic_launcher.png => husky/res/mipmap-xhdpi/ic_launcher.png}
R husky/app/src/{blue/res/mipmap-xhdpi/ic_shortcut_compose.png => husky/res/mipmap-xhdpi/ic_shortcut_compose.png}
R husky/app/src/{blue/res/mipmap-xxhdpi/ic_launcher.png => husky/res/mipmap-xxhdpi/ic_launcher.png}
R husky/app/src/{blue/res/mipmap-xxhdpi/ic_shortcut_compose.png => husky/res/mipmap-xxhdpi/ic_shortcut_compose.png}
R husky/app/src/{blue/res/mipmap-xxxhdpi/ic_launcher.png => husky/res/mipmap-xxxhdpi/ic_launcher.png}
R husky/app/src/{blue/res/mipmap-xxxhdpi/ic_shortcut_compose.png => husky/res/mipmap-xxxhdpi/ic_shortcut_compose.png}
M husky/app/src/main/res/values/strings.xml
M husky/buildSrc/src/main/kotlin/Dependencies.kt
M husky/app/build.gradle.kts => husky/app/build.gradle.kts +230 -209
@@ 1,219 1,240 @@
plugins {
	id("com.android.application")
    id("com.android.application")

	kotlin("android")
	id("kotlin-android-extensions")
	kotlin("kapt")
    kotlin("android")
    id("kotlin-android-extensions")
    kotlin("kapt")

	//id("kotlin-parcelize")
	id("com.github.ben-manes.versions")
    //id("kotlin-parcelize")
    id("com.github.ben-manes.versions")
}

android {
	compileSdk = AndroidSDK.compileSdk
	buildToolsVersion = AndroidSDK.buildTools

	defaultConfig {
		applicationId = DefaultConfig.applicationID

		minSdk = DefaultConfig.minSdk
		targetSdk = DefaultConfig.targetSdk

		versionCode = DefaultConfig.versionCodeRel
		versionName = DefaultConfig.versionNameRel

		testInstrumentationRunner = DefaultConfig.instrumentationRunner

		vectorDrawables.useSupportLibrary = true

		kapt {
			arguments {
				arg("room.schemaLocation", "$projectDir/schemas")
				arg("room.incremental", true)
			}
		}

		// TODO: remove, just for compiling
		resValue("string", "app_name", "\"${CustomHuskyBuild.applicationName}\"")
		buildConfigField("String", "APPLICATION_NAME", "\"${CustomHuskyBuild.applicationName}\"")
		buildConfigField("String", "CUSTOM_LOGO_URL", "\"${CustomHuskyBuild.customLogo}\"")
		buildConfigField("String", "CUSTOM_INSTANCE", "\"${CustomHuskyBuild.customInstance}\"")
		buildConfigField("String", "SUPPORT_ACCOUNT_URL", "\"${CustomHuskyBuild.supportAccountUrl}\"")
	}

	buildTypes {
		getByName(BuildTypes.debug) {
			isDebuggable = true
			isMinifyEnabled = false
			isShrinkResources = false
		}

		getByName(BuildTypes.release) {
			isDebuggable = false
			isMinifyEnabled = false
			isShrinkResources = false

			proguardFiles(
				getDefaultProguardFile(ProguardFile.defaultFile),
				ProguardFile.defaultRules
			)
		}

		flavorDimensions.addAll(
			listOf(
				"husky",
				"color"
			)
		)
		productFlavors {
			create("husky") {
				dimension = "husky"
			}

			create("blue") {
				dimension = "color"
			}

			create("green") {
				dimension = "color"
				applicationIdSuffix = ".test"
				versionNameSuffix = "-beta"
			}
		}

		lint {
			// isAbortOnError = true
			disable("MissingTranslation")
			disable("ExtraTranslation")
			disable("AppCompatCustomView")
			disable("UseRequireInsteadOfGet")
		}

		compileOptions {
			sourceCompatibility = DefaultConfig.javaVersion
			targetCompatibility = DefaultConfig.javaVersion
		}

		kotlinOptions {
			jvmTarget = DefaultConfig.javaVersion.toString()
		}

		buildFeatures {
			viewBinding = true
		}

		// TODO: remove this, only for compiling
		androidExtensions {
			isExperimental = true
		}

		testOptions {
			unitTests {
				isReturnDefaultValues = true
				isIncludeAndroidResources = true
			}
		}

		sourceSets {
			getByName("androidTest").assets.srcDirs("$projectDir/schemas")
		}

		packagingOptions {
			resources.excludes.addAll(
				listOf(
					"LICENSE_OFL",
					"LICENSE_UNICODE"
				)
			)
		}

		bundle {
			language {
				enableSplit = true
			}
		}
	}
    compileSdk = AndroidSDK.compileSdk
    buildToolsVersion = AndroidSDK.buildTools

    defaultConfig {
        applicationId = DefaultConfig.applicationID

        minSdk = DefaultConfig.minSdk
        targetSdk = DefaultConfig.targetSdk

        versionCode = DefaultConfig.versionCodeRel
        versionName = DefaultConfig.versionNameRel

        testInstrumentationRunner = DefaultConfig.instrumentationRunner

        vectorDrawables.useSupportLibrary = true

        kapt {
            arguments {
                arg("room.schemaLocation", "$projectDir/schemas")
                arg("room.incremental", true)
            }
        }

        // TODO: remove, just for compiling
        buildConfigField(
            "String", "APPLICATION_NAME",
            "\"${CustomHuskyBuild.applicationName}\""
        )
        buildConfigField(
            "String", "CUSTOM_LOGO_URL",
            "\"${CustomHuskyBuild.customLogo}\""
        )
        buildConfigField(
            "String", "CUSTOM_INSTANCE",
            "\"${CustomHuskyBuild.customInstance}\""
        )
        buildConfigField(
            "String", "SUPPORT_ACCOUNT_URL",
            "\"${CustomHuskyBuild.supportAccountUrl}\""
        )
    }

    buildTypes {
        getByName(BuildTypes.debug) {
            isDebuggable = true
            isMinifyEnabled = false
            isShrinkResources = false
        }

        getByName(BuildTypes.release) {
            isDebuggable = false
            isMinifyEnabled = false
            isShrinkResources = false

            proguardFiles(
                getDefaultProguardFile(ProguardFile.defaultFile),
                ProguardFile.defaultRules
            )
        }

        flavorDimensions.addAll(
            listOf(
                Flavors.Dimensions.husky,
                Flavors.Dimensions.release
            )
        )
        productFlavors {
            create(Flavors.husky) {
                dimension = Flavors.Dimensions.husky
            }

            create(Flavors.beta) {
                dimension = Flavors.Dimensions.release

                versionCode = BetaConfig.versionCodeBeta
                versionName = BetaConfig.versionNameBeta

                applicationIdSuffix = BetaConfig.betaSufix
                versionNameSuffix = "-${BetaConfig.betaSufix}${BetaConfig.betaSufixVersion}"

                buildConfigField(
                    "String",
                    "APPLICATION_NAME",
                    "\"${CustomHuskyBuild.applicationName} Beta\""
                )
            }

            create(Flavors.stable) {
                dimension = Flavors.Dimensions.release
            }
        }

        lint {
            // isAbortOnError = true
            disable("MissingTranslation")
            disable("ExtraTranslation")
            disable("AppCompatCustomView")
            disable("UseRequireInsteadOfGet")
        }

        compileOptions {
            sourceCompatibility = DefaultConfig.javaVersion
            targetCompatibility = DefaultConfig.javaVersion
        }

        kotlinOptions {
            jvmTarget = DefaultConfig.javaVersion.toString()
        }

        buildFeatures {
            viewBinding = true
        }

        // TODO: remove this, only for compiling
        androidExtensions {
            isExperimental = true
        }

        testOptions {
            unitTests {
                isReturnDefaultValues = true
                isIncludeAndroidResources = true
            }
        }

        sourceSets {
            getByName("androidTest").assets.srcDirs("$projectDir/schemas")
        }

        packagingOptions {
            resources.excludes.addAll(
                listOf(
                    "LICENSE_OFL",
                    "LICENSE_UNICODE"
                )
            )
        }

        bundle {
            language {
                enableSplit = true
            }
        }
    }
}

dependencies {
	implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))

	implementation(ApplicationLibs.AndroidX.appCompat)
	implementation(ApplicationLibs.AndroidX.browser)
	implementation(ApplicationLibs.AndroidX.cardView)
	implementation(ApplicationLibs.AndroidX.constraintLayout)
	implementation(ApplicationLibs.AndroidX.coreKtx)
	implementation(ApplicationLibs.AndroidX.emoji)
	implementation(ApplicationLibs.AndroidX.emojiAppCompat)
	implementation(ApplicationLibs.AndroidX.emojiBundled)
	implementation(ApplicationLibs.AndroidX.exifInterface)
	implementation(ApplicationLibs.AndroidX.fragmentKtx)
	implementation(ApplicationLibs.AndroidX.pagingRuntimeKtx)
	implementation(ApplicationLibs.AndroidX.preferenceKtx)
	implementation(ApplicationLibs.AndroidX.recyclerView)
	kapt(ApplicationLibs.AndroidX.roomCompiler)
	implementation(ApplicationLibs.AndroidX.roomRuntime)
	implementation(ApplicationLibs.AndroidX.roomRxJava)
	implementation(ApplicationLibs.AndroidX.shareTarget)
	implementation(ApplicationLibs.AndroidX.swipeRefreshLayout)
	implementation(ApplicationLibs.AndroidX.viewpager2)
	implementation(ApplicationLibs.AndroidX.workRuntime)
	implementation(ApplicationLibs.AndroidX.Lifecycle.commonJava)
	implementation(ApplicationLibs.AndroidX.Lifecycle.liveDataKtx)
	implementation(ApplicationLibs.AndroidX.Lifecycle.reactiveStreamsKtx)
	implementation(ApplicationLibs.AndroidX.Lifecycle.viewmodelKtx)

	implementation(ApplicationLibs.Dagger.dagger)
	implementation(ApplicationLibs.Dagger.daggerAndroid)
	kapt(ApplicationLibs.Dagger.daggerCompiler)
	kapt(ApplicationLibs.Dagger.daggerProcessor)
	implementation(ApplicationLibs.Dagger.daggerSupport)

	implementation(ApplicationLibs.Glide.glide)
	implementation(ApplicationLibs.Glide.glideOkhttp)
	kapt(ApplicationLibs.Glide.glideCompiler)

	implementation(ApplicationLibs.Google.flexbox)
	implementation(ApplicationLibs.Google.exoplayer)
	implementation(ApplicationLibs.Google.materialDesign)

	implementation(ApplicationLibs.Kotlin.stdlib)
	implementation(ApplicationLibs.Kotlin.stdlibJdk)

	implementation(ApplicationLibs.RxJava.rxAndroid)
	implementation(ApplicationLibs.RxJava.rxJava)
	implementation(ApplicationLibs.RxJava.rxKotlin)

	implementation(ApplicationLibs.Square.retrofit)
	implementation(ApplicationLibs.Square.retrofitAdapterRxJ2)
	implementation(ApplicationLibs.Square.retrofitConvGson)
	implementation(ApplicationLibs.Square.logginInterceptor)
	implementation(ApplicationLibs.Square.okhttp)
	implementation(ApplicationLibs.Square.okhttpBrotli)

	implementation(ApplicationLibs.androidImageCropper)
	implementation(ApplicationLibs.autodispose)
	implementation(ApplicationLibs.autodisposeAndroidArchComp)
	implementation(ApplicationLibs.bigImageViewer)
	implementation(ApplicationLibs.conscryptAndroid)
	implementation(ApplicationLibs.filemojiCompat)
	implementation(ApplicationLibs.glideImage)
	implementation(ApplicationLibs.glideImageViewFactory)
	implementation(ApplicationLibs.markdownEdit)
	implementation(ApplicationLibs.materialDrawer)
	implementation(ApplicationLibs.materialDrawerIconics)
	implementation(ApplicationLibs.materialDrawerTypeface)
	implementation(ApplicationLibs.filemojiCompat)
	implementation(ApplicationLibs.sparkButton)
	implementation(ApplicationLibs.timber)

	testImplementation(TestLibs.extJunit)
	testImplementation(TestLibs.junit)
	testImplementation(TestLibs.mockitoInline)
	testImplementation(TestLibs.mockitoKotlin)
	testImplementation(TestLibs.roboelectric)

	androidTestImplementation(TestLibs.espresso)
	androidTestImplementation(TestLibs.junit)
	androidTestImplementation(TestLibs.roomTesting)
    implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))

    implementation(ApplicationLibs.AndroidX.appCompat)
    implementation(ApplicationLibs.AndroidX.browser)
    implementation(ApplicationLibs.AndroidX.cardView)
    implementation(ApplicationLibs.AndroidX.constraintLayout)
    implementation(ApplicationLibs.AndroidX.coreKtx)
    implementation(ApplicationLibs.AndroidX.emoji)
    implementation(ApplicationLibs.AndroidX.emojiAppCompat)
    implementation(ApplicationLibs.AndroidX.emojiBundled)
    implementation(ApplicationLibs.AndroidX.exifInterface)
    implementation(ApplicationLibs.AndroidX.fragmentKtx)
    implementation(ApplicationLibs.AndroidX.pagingRuntimeKtx)
    implementation(ApplicationLibs.AndroidX.preferenceKtx)
    implementation(ApplicationLibs.AndroidX.recyclerView)
    kapt(ApplicationLibs.AndroidX.roomCompiler)
    implementation(ApplicationLibs.AndroidX.roomRuntime)
    implementation(ApplicationLibs.AndroidX.roomRxJava)
    implementation(ApplicationLibs.AndroidX.shareTarget)
    implementation(ApplicationLibs.AndroidX.swipeRefreshLayout)
    implementation(ApplicationLibs.AndroidX.viewpager2)
    implementation(ApplicationLibs.AndroidX.workRuntime)
    implementation(ApplicationLibs.AndroidX.Lifecycle.commonJava)
    implementation(ApplicationLibs.AndroidX.Lifecycle.liveDataKtx)
    implementation(ApplicationLibs.AndroidX.Lifecycle.reactiveStreamsKtx)
    implementation(ApplicationLibs.AndroidX.Lifecycle.viewmodelKtx)

    implementation(ApplicationLibs.Dagger.dagger)
    implementation(ApplicationLibs.Dagger.daggerAndroid)
    kapt(ApplicationLibs.Dagger.daggerCompiler)
    kapt(ApplicationLibs.Dagger.daggerProcessor)
    implementation(ApplicationLibs.Dagger.daggerSupport)

    implementation(ApplicationLibs.Glide.glide)
    implementation(ApplicationLibs.Glide.glideOkhttp)
    kapt(ApplicationLibs.Glide.glideCompiler)

    implementation(ApplicationLibs.Google.flexbox)
    implementation(ApplicationLibs.Google.exoplayer)
    implementation(ApplicationLibs.Google.materialDesign)

    implementation(ApplicationLibs.Kotlin.stdlib)
    implementation(ApplicationLibs.Kotlin.stdlibJdk)

    implementation(ApplicationLibs.RxJava.rxAndroid)
    implementation(ApplicationLibs.RxJava.rxJava)
    implementation(ApplicationLibs.RxJava.rxKotlin)

    implementation(ApplicationLibs.Square.retrofit)
    implementation(ApplicationLibs.Square.retrofitAdapterRxJ2)
    implementation(ApplicationLibs.Square.retrofitConvGson)
    implementation(ApplicationLibs.Square.logginInterceptor)
    implementation(ApplicationLibs.Square.okhttp)
    implementation(ApplicationLibs.Square.okhttpBrotli)

    implementation(ApplicationLibs.androidImageCropper)
    implementation(ApplicationLibs.autodispose)
    implementation(ApplicationLibs.autodisposeAndroidArchComp)
    implementation(ApplicationLibs.bigImageViewer)
    implementation(ApplicationLibs.conscryptAndroid)
    implementation(ApplicationLibs.filemojiCompat)
    implementation(ApplicationLibs.glideImage)
    implementation(ApplicationLibs.glideImageViewFactory)
    implementation(ApplicationLibs.markdownEdit)
    implementation(ApplicationLibs.materialDrawer)
    implementation(ApplicationLibs.materialDrawerIconics)
    implementation(ApplicationLibs.materialDrawerTypeface)
    implementation(ApplicationLibs.filemojiCompat)
    implementation(ApplicationLibs.sparkButton)
    implementation(ApplicationLibs.timber)

    testImplementation(TestLibs.extJunit)
    testImplementation(TestLibs.junit)
    testImplementation(TestLibs.mockitoInline)
    testImplementation(TestLibs.mockitoKotlin)
    testImplementation(TestLibs.roboelectric)

    androidTestImplementation(TestLibs.espresso)
    androidTestImplementation(TestLibs.junit)
    androidTestImplementation(TestLibs.roomTesting)
}

R husky/app/src/green/res/mipmap-anydpi-v26/ic_launcher.xml => husky/app/src/beta/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
R husky/app/src/green/res/mipmap-hdpi/ic_launcher.png => husky/app/src/beta/res/mipmap-hdpi/ic_launcher.png +0 -0
R husky/app/src/green/res/mipmap-mdpi/ic_launcher.png => husky/app/src/beta/res/mipmap-mdpi/ic_launcher.png +0 -0
R husky/app/src/green/res/mipmap-xhdpi/ic_launcher.png => husky/app/src/beta/res/mipmap-xhdpi/ic_launcher.png +0 -0
R husky/app/src/green/res/mipmap-xxhdpi/ic_launcher.png => husky/app/src/beta/res/mipmap-xxhdpi/ic_launcher.png +0 -0
R husky/app/src/green/res/mipmap-xxxhdpi/ic_launcher.png => husky/app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
A husky/app/src/beta/res/values/strings.xml => husky/app/src/beta/res/values/strings.xml +4 -0
@@ 0,0 1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Husky Beta</string>
</resources>

R husky/app/src/blue/res/mipmap-anydpi-v26/ic_launcher.xml => husky/app/src/husky/res/mipmap-anydpi-v26/ic_launcher.xml +0 -0
R husky/app/src/blue/res/mipmap-hdpi/ic_launcher.png => husky/app/src/husky/res/mipmap-hdpi/ic_launcher.png +0 -0
R husky/app/src/blue/res/mipmap-hdpi/ic_shortcut_compose.png => husky/app/src/husky/res/mipmap-hdpi/ic_shortcut_compose.png +0 -0
R husky/app/src/blue/res/mipmap-mdpi/ic_launcher.png => husky/app/src/husky/res/mipmap-mdpi/ic_launcher.png +0 -0
R husky/app/src/blue/res/mipmap-mdpi/ic_shortcut_compose.png => husky/app/src/husky/res/mipmap-mdpi/ic_shortcut_compose.png +0 -0
R husky/app/src/blue/res/mipmap-xhdpi/ic_launcher.png => husky/app/src/husky/res/mipmap-xhdpi/ic_launcher.png +0 -0
R husky/app/src/blue/res/mipmap-xhdpi/ic_shortcut_compose.png => husky/app/src/husky/res/mipmap-xhdpi/ic_shortcut_compose.png +0 -0
R husky/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png => husky/app/src/husky/res/mipmap-xxhdpi/ic_launcher.png +0 -0
R husky/app/src/blue/res/mipmap-xxhdpi/ic_shortcut_compose.png => husky/app/src/husky/res/mipmap-xxhdpi/ic_shortcut_compose.png +0 -0
R husky/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png => husky/app/src/husky/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
R husky/app/src/blue/res/mipmap-xxxhdpi/ic_shortcut_compose.png => husky/app/src/husky/res/mipmap-xxxhdpi/ic_shortcut_compose.png +0 -0
M husky/app/src/main/res/values/strings.xml => husky/app/src/main/res/values/strings.xml +2 -0
@@ 1,4 1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Husky</string>

    <string name="error_generic">An error occurred.</string>
    <string name="error_network">A network error occurred! Please check your connection and try again!</string>

M husky/buildSrc/src/main/kotlin/Dependencies.kt => husky/buildSrc/src/main/kotlin/Dependencies.kt +52 -34
@@ 6,67 6,85 @@ import org.gradle.kotlin.dsl.maven
const val kotlinVersion = "1.5.31"

object AndroidSDK {
	const val compileSdk = 30
	const val buildTools = "30.0.3"
    const val compileSdk = 30
    const val buildTools = "30.0.3"
}

object CustomHuskyBuild {
	const val applicationName = "Husky"
	const val customLogo = ""
	const val customInstance = ""
	const val supportAccountUrl = "https://huskyapp.dev/users/husky"
    const val applicationName = "Husky"
    const val customLogo = ""
    const val customInstance = ""
    const val supportAccountUrl = "https://huskyapp.dev/users/husky"
}

object DefaultConfig {
	const val applicationID = "su.xash.husky"
	const val minSdk = 23
	const val targetSdk = 30
	const val versionCodeRel = 169
	const val versionNameRel = "1.0.2"
    const val applicationID = "su.xash.husky"
    const val minSdk = 23
    const val targetSdk = 30
    const val versionCodeRel = 169
    const val versionNameRel = "1.0.2"

	val javaVersion = JavaVersion.VERSION_1_8
    val javaVersion = JavaVersion.VERSION_1_8

	const val instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    const val instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

	const val encoding = "UTF-8"
    const val encoding = "UTF-8"
}

object BetaConfig {
    const val betaSufix = "beta"
    const val betaSufixVersion = "1"
    const val versionCodeBeta = 1
    const val versionNameBeta = "1.0.2"
}

object BuildTypes {
	const val debug = "debug"
	const val release = "release"
    const val debug = "debug"
    const val release = "release"
}

object Flavors {
    object Dimensions {
        const val husky = "husky"
        const val release = "release"
    }

    const val husky = "husky"
    const val beta = "beta"
    const val stable = "stable"
}

object ProguardFile {
	const val defaultFile = "proguard-android-optimize.txt"
	const val defaultRules = "proguard-rules.pro"
    const val defaultFile = "proguard-android-optimize.txt"
    const val defaultRules = "proguard-rules.pro"
}

object BuildTasks {
	const val taskTypeClean = "clean"
    const val taskTypeClean = "clean"
}

object GradlePlugins {
	object Versions {
		const val gradle = "7.0.2"
		const val gradleVersions = "0.38.0"
	}

	const val android = "com.android.tools.build:gradle:${Versions.gradle}"
	const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
	const val gradleVersions =
		"com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersions}"
    object Versions {
        const val gradle = "7.0.2"
        const val gradleVersions = "0.38.0"
    }

    const val android = "com.android.tools.build:gradle:${Versions.gradle}"
    const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
    const val gradleVersions =
        "com.github.ben-manes:gradle-versions-plugin:${Versions.gradleVersions}"
}

// Function to add repositories to the project.
fun addRepos(handler: RepositoryHandler) {
	handler.google()
	handler.maven(url = "https://jitpack.io")
	handler.gradlePluginPortal()
    handler.google()
    handler.maven(url = "https://jitpack.io")
    handler.gradlePluginPortal()
}

// Function to check stable versions
fun isNonStable(version: String): Boolean {
	val stableKeyword = listOf("alpha", "beta", "final", "ga", "m", "release", "rc")
		.any { version.toLowerCase(Locale.ROOT).contains(it) }
	return stableKeyword.not()
    val stableKeyword = listOf("alpha", "beta", "final", "ga", "m", "release", "rc")
        .any { version.toLowerCase(Locale.ROOT).contains(it) }
    return stableKeyword.not()
}