mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Use dependencies and constants from buildSrc
This commit is contained in:
parent
eb3bfca5a8
commit
4f2dd5f189
6 changed files with 76 additions and 58 deletions
|
@ -4,50 +4,46 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
namespace = "com.newsblur.benchmark"
|
||||
compileSdk = 33
|
||||
namespace = Const.namespaceBenchmark
|
||||
compileSdk = Config.compileSdk
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
sourceCompatibility = Config.javaVersion
|
||||
targetCompatibility = Config.javaVersion
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 23
|
||||
targetSdk = 33
|
||||
minSdk = Config.minSdk
|
||||
targetSdk = Config.targetSdk
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
testInstrumentationRunner = Config.androidTestInstrumentation
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
// This benchmark buildType is used for benchmarking, and should function like your
|
||||
// release build (for example, with minification on). It's signed with a debug key
|
||||
// for easy local/CI testing.
|
||||
maybeCreate("benchmark")
|
||||
getByName("benchmark") {
|
||||
maybeCreate(Const.benchmark)
|
||||
getByName(Const.benchmark) {
|
||||
isDebuggable = true
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
matchingFallbacks += listOf("release")
|
||||
signingConfig = signingConfigs.getByName(Const.debug)
|
||||
matchingFallbacks += listOf(Const.release)
|
||||
}
|
||||
}
|
||||
|
||||
targetProjectPath = ":app"
|
||||
experimentalProperties["android.experimental.self-instrumenting"] = true
|
||||
experimentalProperties[Const.selfInstrumenting] = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.test.ext:junit:1.1.5")
|
||||
implementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
|
||||
implementation("androidx.benchmark:benchmark-macro-junit4:1.1.1")
|
||||
implementation(Dependencies.junitExt)
|
||||
implementation(Dependencies.espressoCore)
|
||||
implementation(Dependencies.uiAutomator)
|
||||
implementation(Dependencies.benchmarkMacroJunit4)
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
beforeVariants(selector().all()) {
|
||||
it.enabled = it.buildType == "benchmark"
|
||||
it.enabled = it.buildType == Const.benchmark
|
||||
}
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
plugins {
|
||||
id ("com.android.application")
|
||||
id("com.android.application")
|
||||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
id ("com.google.dagger.hilt.android")
|
||||
id("com.google.dagger.hilt.android")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.newsblur"
|
||||
namespace = Const.namespace
|
||||
compileSdk = Config.compileSdk
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.newsblur"
|
||||
applicationId = Const.namespace
|
||||
minSdk = Config.minSdk
|
||||
targetSdk = Config.targetSdk
|
||||
versionCode = Config.versionCode
|
||||
|
@ -20,32 +20,29 @@ android {
|
|||
}
|
||||
|
||||
buildTypes {
|
||||
getByName("debug") {
|
||||
getByName(Const.debug) {
|
||||
isMinifyEnabled = false
|
||||
isShrinkResources = false
|
||||
}
|
||||
maybeCreate("benchmark")
|
||||
getByName("benchmark") {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
matchingFallbacks += listOf("release")
|
||||
maybeCreate(Const.benchmark)
|
||||
getByName(Const.benchmark) {
|
||||
signingConfig = signingConfigs.getByName(Const.debug)
|
||||
matchingFallbacks += listOf(Const.release)
|
||||
isDebuggable = false
|
||||
proguardFiles("benchmark-rules.pro")
|
||||
proguardFiles(Const.benchmarkProguard)
|
||||
}
|
||||
getByName("release") {
|
||||
getByName(Const.release) {
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
|
||||
proguardFiles(getDefaultProguardFile(Const.defaultProguard), Const.appProguard)
|
||||
}
|
||||
}
|
||||
packaging {
|
||||
resources.excludes.add("META-INF/*")
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
sourceCompatibility = Config.javaVersion
|
||||
targetCompatibility = Config.javaVersion
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
|
@ -53,26 +50,26 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("androidx.fragment:fragment-ktx:1.6.1")
|
||||
implementation("androidx.recyclerview:recyclerview:1.3.1")
|
||||
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.11.0")
|
||||
implementation("com.google.code.gson:gson:2.10")
|
||||
implementation("com.android.billingclient:billing:6.0.1")
|
||||
implementation("com.google.android.play:core:1.10.3")
|
||||
implementation("com.google.android.material:material:1.9.0")
|
||||
implementation("androidx.preference:preference-ktx:1.2.0")
|
||||
implementation("androidx.browser:browser:1.5.0")
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
|
||||
implementation("androidx.lifecycle:lifecycle-process:2.6.1")
|
||||
implementation("androidx.core:core-splashscreen:1.0.1")
|
||||
implementation("com.google.dagger:hilt-android:2.44.2")
|
||||
kapt("com.google.dagger:hilt-compiler:2.44.2")
|
||||
implementation("androidx.profileinstaller:profileinstaller:1.3.1")
|
||||
implementation(Dependencies.fragment)
|
||||
implementation(Dependencies.recyclerView)
|
||||
implementation(Dependencies.swipeRefreshLayout)
|
||||
implementation(Dependencies.okHttp)
|
||||
implementation(Dependencies.gson)
|
||||
implementation(Dependencies.billing)
|
||||
implementation(Dependencies.playCore)
|
||||
implementation(Dependencies.material)
|
||||
implementation(Dependencies.preference)
|
||||
implementation(Dependencies.browser)
|
||||
implementation(Dependencies.lifecycleRuntime)
|
||||
implementation(Dependencies.lifecycleProcess)
|
||||
implementation(Dependencies.splashScreen)
|
||||
implementation(Dependencies.hiltAndroid)
|
||||
kapt(Dependencies.hiltCompiler)
|
||||
implementation(Dependencies.profileInstaller)
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("io.mockk:mockk:1.13.4")
|
||||
testImplementation(Dependencies.junit)
|
||||
testImplementation(Dependencies.mockk)
|
||||
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
androidTestImplementation(Dependencies.junitExt)
|
||||
androidTestImplementation(Dependencies.espressoCore)
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
import org.gradle.api.JavaVersion
|
||||
|
||||
object Config {
|
||||
|
||||
const val compileSdk = 33
|
||||
|
@ -7,4 +9,6 @@ object Config {
|
|||
const val versionName = "13.0.0b3"
|
||||
|
||||
const val androidTestInstrumentation = "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
val javaVersion = JavaVersion.VERSION_17
|
||||
}
|
15
clients/android/NewsBlur/buildSrc/src/main/java/Const.kt
Normal file
15
clients/android/NewsBlur/buildSrc/src/main/java/Const.kt
Normal file
|
@ -0,0 +1,15 @@
|
|||
object Const {
|
||||
|
||||
const val namespace = "com.newsblur"
|
||||
const val namespaceBenchmark = "com.newsblur.benchmark"
|
||||
|
||||
const val release = "release"
|
||||
const val debug = "debug"
|
||||
const val benchmark = "benchmark"
|
||||
|
||||
const val selfInstrumenting = "android.experimental.self-instrumenting"
|
||||
|
||||
const val benchmarkProguard = "benchmark-rules.pro"
|
||||
const val appProguard = "proguard-rules.pro"
|
||||
const val defaultProguard = "proguard-android.txt"
|
||||
}
|
|
@ -24,4 +24,7 @@ object Dependencies {
|
|||
// android test
|
||||
const val junitExt = "androidx.test.ext:junit:${Version.junitExt}"
|
||||
const val espressoCore = "androidx.test.espresso:espresso-core:${Version.espresso}"
|
||||
|
||||
const val uiAutomator = "androidx.test.uiautomator:uiautomator:${Version.uiAutomator}"
|
||||
const val benchmarkMacroJunit4 = "androidx.benchmark:benchmark-macro-junit4:${Version.benchmarkMacroJunit4}"
|
||||
}
|
|
@ -25,4 +25,7 @@ object Version {
|
|||
|
||||
const val junitExt = "1.1.5"
|
||||
const val espresso = "3.5.1"
|
||||
|
||||
const val uiAutomator = "2.2.0"
|
||||
const val benchmarkMacroJunit4 = "1.1.1"
|
||||
}
|
Loading…
Add table
Reference in a new issue