Skip to content

Commit 9a477c1

Browse files
committed
update deps
1 parent ef527ff commit 9a477c1

File tree

5 files changed

+77
-72
lines changed

5 files changed

+77
-72
lines changed

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

3-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4-
53
buildscript {
64
repositories { mavenCentral() }
75
}
86

9-
107
subprojects {
118
apply(from = "${rootProject.rootDir}/spotless.gradle.kts")
129
}
1310

1411
allprojects {
1512
apply(plugin = "com.github.ben-manes.versions")
1613

17-
tasks.withType<KotlinCompile> {
18-
kotlinOptions {
19-
jvmTarget = JavaVersion.VERSION_11.toString()
20-
freeCompilerArgs = freeCompilerArgs + listOf("-Xopt-in=kotlin.RequiresOptIn")
21-
}
22-
}
23-
2414
configurations.all {
2515
resolutionStrategy.eachDependency {
2616
if (requested.group == "org.jetbrains.kotlin" && requested.name == "kotlin-reflect") {
@@ -34,6 +24,7 @@ allprojects {
3424
jcenter()
3525
mavenCentral()
3626
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
27+
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/")
3728
maven(url = "https://jitpack.io")
3829
maven {
3930
url = uri("http://dl.bintray.com/amulyakhare/maven")

buildSrc/build.gradle.kts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ gradlePlugin {
2121
}
2222

2323
object PluginVersions {
24-
const val kotlin = "1.5.0"
25-
const val androidGradle = "7.1.0-alpha01"
26-
const val navigationSafeArgs = "2.3.1"
27-
const val googleServices = "4.3.4"
28-
const val crashlytics = "2.4.1"
29-
const val spotless = "5.12.4"
24+
const val kotlin = "1.6.0-RC"
25+
const val androidGradle = "7.0.3"
26+
const val navigationSafeArgs = "2.4.0-alpha10"
27+
const val googleServices = "4.3.10"
28+
const val crashlytics = "2.7.1"
29+
const val spotless = "5.17.0"
30+
const val gradleVersions = "0.39.0"
3031
}
3132

3233
object Plugins {
@@ -36,17 +37,18 @@ object Plugins {
3637
const val googleServices = "com.google.gms:google-services:${PluginVersions.googleServices}"
3738
const val crashlytics = "com.google.firebase:firebase-crashlytics-gradle:${PluginVersions.crashlytics}"
3839
const val spotless = "com.diffplug.spotless:spotless-plugin-gradle:${PluginVersions.spotless}"
40+
const val gradleVersions = "com.github.ben-manes:gradle-versions-plugin:${PluginVersions.gradleVersions}"
3941
}
4042

4143
dependencies {
4244
implementation(Plugins.androidGradle)
4345
implementation(Plugins.kotlin)
4446

45-
implementation(Plugins.spotless)
4647
implementation(Plugins.navigationSafeArgs)
4748

4849
implementation(Plugins.googleServices)
4950
implementation(Plugins.crashlytics)
5051

51-
implementation("com.github.ben-manes:gradle-versions-plugin:0.39.0")
52+
implementation(Plugins.gradleVersions)
53+
implementation(Plugins.spotless)
5254
}

buildSrc/src/main/kotlin/Configurations.kt

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ import java.util.Date
66
object appConfig {
77
const val applicationId = "com.hoc.comicapp"
88

9-
const val versionCode = 1
9+
private const val MAJOR = 1
10+
private const val MINOR = 0
11+
private const val PATCH = 0
12+
const val versionCode = MAJOR * 10_000 + MINOR * 100 + PATCH
1013
val versionName by lazy {
11-
val x = versionCode / 10_000
12-
val y = (versionCode % 10_000) / 100
13-
val z = versionCode % 100
14-
1514
val date = SimpleDateFormat("yyyy-MM-dd").format(Date())
16-
17-
"$x.$y.$z $date"
15+
"$MAJOR.$MINOR.$PATCH $date"
1816
}
1917

2018
val supportedLocales = setOf("en")
@@ -24,52 +22,52 @@ object versions {
2422
const val ktLint = "0.41.0"
2523

2624
object sdk {
27-
const val buildTools = "30.0.3"
28-
const val compile = 30
25+
const val buildTools = "31.0.0"
26+
const val compile = 31
2927
const val min = 23
30-
const val target = 30
28+
const val target = 31
3129
}
3230

3331
object kotlin {
34-
const val core = "1.5.0"
35-
const val coroutines = "1.5.0"
32+
const val core = "1.6.0-RC"
33+
const val coroutines = "1.5.2"
3634
}
3735

3836
object androidX {
39-
const val activity = "1.2.0-beta01"
40-
const val appCompat = "1.3.0-alpha02"
41-
const val core = "1.5.0-alpha05"
42-
const val fragment = "1.3.0-beta01"
43-
const val startUp = "1.0.0"
37+
const val activity = "1.4.0-rc01"
38+
const val appCompat = "1.4.0-beta01"
39+
const val core = "1.7.0-rc01"
40+
const val fragment = "1.4.0-alpha10"
41+
const val startUp = "1.1.0"
4442

4543
object view {
46-
const val constraintLayout = "2.1.0-alpha1"
47-
const val material = "1.3.0-alpha04"
48-
const val recyclerView = "1.2.0-alpha06"
44+
const val constraintLayout = "2.1.1"
45+
const val material = "1.5.0-alpha04"
46+
const val recyclerView = "1.3.0-alpha01"
4947
}
5048

51-
const val navigation = "2.3.1"
52-
const val lifecycle = "2.3.0-beta01"
53-
const val room = "2.3.0"
54-
const val work = "2.5.0-beta01"
49+
const val navigation = "2.4.0-alpha10"
50+
const val lifecycle = "2.4.0-rc01"
51+
const val room = "2.4.0-beta01"
52+
const val work = "2.7.0"
5553
}
5654

57-
const val koin = "3.0.1"
58-
const val moshiKotlin = "1.11.0"
55+
const val koin = "3.1.2"
56+
const val moshiKotlin = "1.12.0"
5957
const val retrofit = "2.9.0"
60-
const val okHttpLoggingInterceptor = "4.10.0-RC1"
61-
const val leakCanaryAndroid = "2.5"
62-
const val rxRelay = "3.0.0"
58+
const val okHttpLoggingInterceptor = "5.0.0-alpha.2"
59+
const val leakCanaryAndroid = "2.7"
60+
const val rxRelay = "3.0.1"
6361
const val rxBinding = "4.0.0"
64-
const val timber = "4.7.1"
62+
const val timber = "5.0.1"
6563

6664
object reactiveX {
6765
const val kotlin = "3.0.1"
68-
const val java = "3.0.7"
66+
const val java = "3.1.2"
6967
const val android = "3.0.0"
7068
}
7169

72-
const val glide = "4.11.0"
70+
const val glide = "4.12.0"
7371

7472
object customView {
7573
const val materialSearchView = "1.4.0"
@@ -83,16 +81,16 @@ object versions {
8381
}
8482

8583
object firebase {
86-
const val auth = "20.0.1"
87-
const val storage = "19.2.0"
88-
const val firestore = "22.0.0"
89-
const val analytics = "18.0.0"
90-
const val crashlytics = "17.3.0"
84+
const val auth = "21.0.1"
85+
const val storage = "20.0.0"
86+
const val firestore = "23.0.4"
87+
const val analytics = "19.0.2"
88+
const val crashlytics = "18.2.3"
9189
}
9290

93-
const val arrow = "0.13.1"
91+
const val arrow = "1.0.0"
9492

95-
const val viewBindingDelegate = "1.0.0"
93+
const val viewBindingDelegate = "1.2.0"
9694
}
9795

9896
object deps {

buildSrc/src/main/kotlin/com/hoc/comicapp/plugin/ComicAppPlugin.kt

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ import com.android.build.gradle.AppExtension
55
import com.android.build.gradle.AppPlugin
66
import com.android.build.gradle.LibraryExtension
77
import com.android.build.gradle.LibraryPlugin
8-
import org.gradle.api.JavaVersion.VERSION_11
8+
import org.gradle.api.JavaVersion.VERSION_1_8
99
import org.gradle.api.Plugin
1010
import org.gradle.api.Project
1111
import org.gradle.api.plugins.JavaLibraryPlugin
1212
import org.gradle.api.plugins.JavaPlugin
13-
import org.gradle.api.plugins.JavaPluginConvention
13+
import org.gradle.api.plugins.JavaPluginExtension
1414
import org.gradle.kotlin.dsl.create
1515
import org.gradle.kotlin.dsl.getByType
16-
import org.gradle.kotlin.dsl.getPlugin
1716
import org.gradle.kotlin.dsl.withType
1817
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper
1918
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2019
import versions
2120

2221
private inline val Project.libraryExtension get() = extensions.getByType<LibraryExtension>()
2322
private inline val Project.appExtension get() = extensions.getByType<AppExtension>()
23+
private inline val Project.javaPluginExtension get() = extensions.getByType<JavaPluginExtension>()
2424

2525
open class ComicAppExtension {
2626
var viewBinding: Boolean = false
@@ -30,23 +30,30 @@ open class ComicAppExtension {
3030
class ComicAppPlugin : Plugin<Project> {
3131
override fun apply(project: Project) {
3232
project.run {
33+
println("Setup $this")
3334
plugins.all {
3435
when (this) {
3536
is JavaPlugin, is JavaLibraryPlugin -> {
36-
project.convention.getPlugin<JavaPluginConvention>().run {
37-
targetCompatibility = VERSION_11
38-
sourceCompatibility = VERSION_11
37+
println(" >>> is JavaPlugin, is JavaLibraryPlugin")
38+
javaPluginExtension.run {
39+
targetCompatibility = VERSION_1_8
40+
sourceCompatibility = VERSION_1_8
3941
}
4042
}
4143
is LibraryPlugin -> {
44+
println(" >>> is LibraryPlugin")
4245
plugins.apply("kotlin-android")
4346
configAndroidLibrary()
4447
}
4548
is AppPlugin -> {
49+
println(" >>> is AppPlugin")
4650
plugins.apply("kotlin-android")
4751
configAndroidApplication()
4852
}
49-
is KotlinBasePluginWrapper -> configKotlinOptions()
53+
is KotlinBasePluginWrapper -> {
54+
println(" >>> is KotlinBasePluginWrapper")
55+
configKotlinOptions()
56+
}
5057
}
5158
}
5259
}
@@ -57,7 +64,6 @@ class ComicAppPlugin : Plugin<Project> {
5764
project.plugins.all {
5865
when (this) {
5966
is LibraryPlugin -> {
60-
@Suppress("UnstableApiUsage")
6167
libraryExtension.buildFeatures {
6268
viewBinding = comicAppExtension.viewBinding
6369
dataBinding = false
@@ -66,7 +72,6 @@ class ComicAppPlugin : Plugin<Project> {
6672
}
6773
is AppPlugin -> {
6874
appExtension.buildFeatures.run {
69-
@Suppress("UnstableApiUsage")
7075
viewBinding = comicAppExtension.viewBinding
7176
}
7277
enableParcelize(comicAppExtension.parcelize)
@@ -86,8 +91,12 @@ private fun Project.enableParcelize(enabled: Boolean) {
8691
private fun Project.configKotlinOptions() {
8792
tasks.withType<KotlinCompile>().configureEach {
8893
kotlinOptions {
89-
jvmTarget = VERSION_11.toString()
94+
val version = VERSION_1_8.toString()
95+
jvmTarget = version
96+
sourceCompatibility = version
97+
targetCompatibility = version
9098
freeCompilerArgs = freeCompilerArgs + listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xinline-classes")
99+
languageVersion = "1.6"
91100
}
92101
}
93102
}
@@ -105,7 +114,7 @@ private fun Project.configAndroidLibrary() = libraryExtension.run {
105114
}
106115

107116
buildTypes {
108-
getByName("release") {
117+
release {
109118
isMinifyEnabled = true
110119

111120
proguardFiles(
@@ -116,8 +125,8 @@ private fun Project.configAndroidLibrary() = libraryExtension.run {
116125
}
117126

118127
compileOptions {
119-
sourceCompatibility = VERSION_11
120-
targetCompatibility = VERSION_11
128+
sourceCompatibility = VERSION_1_8
129+
targetCompatibility = VERSION_1_8
121130
}
122131
}
123132

@@ -152,7 +161,7 @@ private fun Project.configAndroidApplication() = appExtension.run {
152161
}
153162

154163
compileOptions {
155-
sourceCompatibility = VERSION_11
156-
targetCompatibility = VERSION_11
164+
sourceCompatibility = VERSION_1_8
165+
targetCompatibility = VERSION_1_8
157166
}
158167
}

0 commit comments

Comments
 (0)