-
Notifications
You must be signed in to change notification settings - Fork 116
Gradle Version, TargetSdk, CompileSdk Upgraded and VersionCatalogs Implemented #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2942a8b
Gradle upgraded
svlilyas d0ddfc1
test-app version, targetSdk, compileSdk upgraded
svlilyas 4939b79
streamer library dependencies upgrade
svlilyas 6443b75
opds library dependencies upgraded
svlilyas f50289d
navigator-media2 library dependencies upgraded.
svlilyas 177c3b8
libraries upgraded
svlilyas 21b3f8e
Added buildSrc to manage Android Configs from one place and implemen…
svlilyas 8bf32ed
TOML library implementation
svlilyas 2271ffd
AndroidConfig variables used in gradles
svlilyas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import org.gradle.kotlin.dsl.`kotlin-dsl` | ||
|
|
||
| plugins { | ||
| `kotlin-dsl` | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import java.util.* | ||
|
|
||
| object AndroidConfig { | ||
| const val APP_NAME = "R2 Reader" | ||
| const val APP_ID = "org.readium.r2reader" | ||
| const val MIN_SDK_VERSION = 21 | ||
| const val TARGET_SDK_VERSION = 32 | ||
| const val BUILD_TOOLS_VERSION = "30.0.3" | ||
| const val COMPILE_SDK_VERSION = 32 | ||
| const val NDK_VERSION = "23.0.7599858" | ||
| const val TEST_INSTRUMENTATION_RUNNER = "androidx.test.runner.AndroidJUnitRunner" | ||
| const val GROUP_ID = "com.github.readium" | ||
| const val VERSION_CODE = 1 | ||
| val VERSION_NAME = calculateVersionName() | ||
| private const val versionMajor = 2 | ||
| private const val versionMinor = 2 | ||
| private const val versionPatch = 0 | ||
|
|
||
| private fun calculateVersionName(): String = "v$versionMajor.$versionMinor.$versionPatch" | ||
svlilyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| object Flavors { | ||
| object ProductFlavors { | ||
| const val DEV = "dev" | ||
| const val UAT = "uat" | ||
| const val PILOT = "pilot" | ||
| const val STORE = "store" | ||
| } | ||
|
|
||
| object FlavorDimensions { | ||
| const val ENVIRONMENT = "environment" | ||
| } | ||
|
|
||
| object BuildTypes { | ||
| const val DEBUG = "debug" | ||
| const val RELEASE = "release" | ||
| } | ||
|
|
||
| object Default { | ||
| const val MAIN = "main" | ||
svlilyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private const val BUILD_TYPE = BuildTypes.DEBUG | ||
| private const val BUILD_FLAVOR = ProductFlavors.DEV | ||
|
|
||
| val BUILD_VARIANT = | ||
| "${BUILD_FLAVOR.capitalize(Locale.ROOT)}${BUILD_TYPE.capitalize(Locale.ROOT)}" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| object Fields { | ||
| const val SERVICE_URL = "SERVICE_URL" | ||
| const val SERVICE_API_KEY = "SERVICE_API_KEY" // optional | ||
| const val SERVICE_CERTIFICATE_PATH = "SERVICE_CERTIFICATE_PATH" // optional | ||
| } | ||
svlilyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import org.gradle.api.artifacts.Dependency | ||
| import org.gradle.api.artifacts.dsl.DependencyHandler | ||
| import kotlin.reflect.full.memberProperties | ||
|
|
||
| // "Module" means "subproject" in terminology of Gradle API. | ||
| // To be specific each "Android module" is a Gradle "subproject" | ||
| @Suppress("unused") | ||
| object ModuleDependency { | ||
| // All consts are accessed via reflection | ||
| const val APP = ":app" | ||
| const val FEATURE_DATA = ":data" | ||
|
|
||
| // False positive" function can be private" | ||
| // See: https://youtrack.jetbrains.com/issue/KT-33610 | ||
| /* | ||
| Return list of all modules in the project | ||
| */ | ||
| private fun getAllModules() = ModuleDependency::class.memberProperties | ||
| .filter { it.isConst } | ||
| .map { it.getter.call().toString() } | ||
| .toSet() | ||
|
|
||
| /* | ||
| Return list of feature modules in the project | ||
| */ | ||
| fun getFeatureModules(): Set<String> { | ||
| val featurePrefix = "" | ||
|
|
||
| return getAllModules() | ||
| .filter { it.startsWith(featurePrefix) } | ||
| .toSet() | ||
| } | ||
svlilyas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| object Project { | ||
| fun DependencyHandler.streamer(): Dependency = project(mapOf("path" to ":readium:streamer")) | ||
| fun DependencyHandler.navigator(): Dependency = | ||
| project(mapOf("path" to ":readium:navigator")) | ||
|
|
||
| fun DependencyHandler.navigatorMedia2(): Dependency = | ||
| project(mapOf("path" to ":readium:navigator-media2")) | ||
|
|
||
| fun DependencyHandler.opds(): Dependency = project(mapOf("path" to ":readium:opds")) | ||
| fun DependencyHandler.lcp(): Dependency = project(mapOf("path" to ":readium:lcp")) | ||
| fun DependencyHandler.shared(): Dependency = project(mapOf("path" to ":readium:shared")) | ||
| fun DependencyHandler.app(): Dependency = project(mapOf("path" to ":test-app")) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| object Plugins { | ||
| const val ANDROID_LIBRARY = "com.android.library" | ||
| const val ANDROID_APPLICATION = "com.android.application" | ||
| const val ANDROID = "android" | ||
| const val KOTLIN_PARCELIZE = "kotlin-parcelize" | ||
| const val KOTLIN_ANDROID = "kotlin-android" | ||
| const val MAVEN_PUBLISH = "maven-publish" | ||
| const val DOKKA = "org.jetbrains.dokka" | ||
| const val KAPT = "kotlin-kapt" | ||
| const val SAFE_ARGS = "androidx.navigation.safeargs.kotlin" | ||
| const val DETEKT = "io.gitlab.arturbosch.detekt" | ||
| const val KTLINT_GRADLE = "org.jlleitschuh.gradle.ktlint" | ||
| const val ANDROID_JUNIT_5 = "de.mannodermaus.android-junit5" | ||
| const val DAGGER_HILT = "dagger.hilt.android.plugin" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| #Mon Aug 22 14:58:22 TRT 2022 | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| zipStoreBase=GRADLE_USER_HOME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.