Better share version information between modules

Move important version properties to buildSrc directory to access between modules
as needed.

Also add a simple task to generate a simple BuildConfig class to access version name.
This is better than adding dependency on a third-party library/plugin.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta 2026-05-11 16:45:56 +08:00
parent ee814cdd88
commit eccbb4c510
4 changed files with 48 additions and 14 deletions

View file

@ -31,25 +31,25 @@ kotlin {
configure<ApplicationExtension> {
compileSdk {
version = release(36) {
minorApiLevel = 1
version = release(NEWPIPE_VERSION_SDK_COMPILE_MAJOR) {
minorApiLevel = NEWPIPE_VERSION_SDK_COMPILE_MINOR
}
}
namespace = "org.schabi.newpipe"
namespace = NEWPIPE_APPLICATION_ID_OLD
defaultConfig {
applicationId = "org.schabi.newpipe"
applicationId = NEWPIPE_APPLICATION_ID_OLD
resValue("string", "app_name", "NewPipe")
minSdk {
version = release(23)
version = release(NEWPIPE_VERSION_SDK_MIN)
}
targetSdk {
version = release(35)
version = release(NEWPIPE_VERSION_SDK_TARGET)
}
versionCode = System.getProperty("versionCodeOverride")?.toInt() ?: 1011
versionCode = System.getProperty("versionCodeOverride")?.toInt() ?: NEWPIPE_VERSION_CODE
versionName = "0.28.6"
versionName = NEWPIPE_VERSION_NAME
System.getProperty("versionNameSuffix")?.let { versionNameSuffix = it }
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"