Skip to content

Commit 4f5fd29

Browse files
committed
versions defined in buildscript.
1 parent 573fcc2 commit 4f5fd29

File tree

3 files changed

+49
-46
lines changed

3 files changed

+49
-46
lines changed

build.gradle

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
// Root project build.gradle
22
buildscript {
33
ext {
4+
java_version = JavaVersion.VERSION_11.toString()
5+
build_tools_version = '32.0.0'
6+
agp_version = '7.2.1'
7+
compile_sdk = 32
8+
target_sdk = 32
9+
min_sdk = 21
10+
nav_version = '2.5.0'
411
kotlin_version = '1.7.0'
512
compose_version = '1.2.0-rc01'
613
compose_compiler = '1.2.0'
7-
version_name = "1.0.9"
14+
version_name = '1.0.9'
815
version_code = 9
916
}
1017
}
18+
1119
plugins {
12-
id 'com.android.application' version '7.2.1' apply false
13-
id 'com.android.library' version '7.2.1' apply false
14-
id 'androidx.navigation.safeargs' version '2.5.0-rc01' apply false
15-
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
20+
id 'com.android.application' version "$agp_version" apply false
21+
id 'com.android.library' version "$agp_version" apply false
22+
id 'androidx.navigation.safeargs' version "$nav_version" apply false
23+
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
1624
}
1725

1826
allprojects {

library/build.gradle

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import org.jetbrains.kotlin.config.KotlinCompilerVersion
2-
31
// Module :library
4-
52
plugins {
63
id 'com.android.library'
74
id 'kotlin-android'
@@ -10,28 +7,24 @@ plugins {
107
}
118

129
android {
13-
compileSdk 32
10+
compileSdk compile_sdk
1411
defaultConfig {
15-
minSdk 21
16-
targetSdk 32
17-
buildToolsVersion "32.0.0"
12+
minSdk min_sdk
13+
targetSdk target_sdk
14+
buildToolsVersion build_tools_version
1815
setProperty('archivesBaseName', 'colorpicker')
1916
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2017
consumerProguardFiles "${project.rootDir}/proguard/consumer.pro"
2118
}
2219
compileOptions {
23-
sourceCompatibility JavaVersion.VERSION_11.toString()
24-
targetCompatibility JavaVersion.VERSION_11.toString()
20+
sourceCompatibility java_version
21+
targetCompatibility java_version
2522
}
2623
kotlinOptions {
27-
jvmTarget = JavaVersion.VERSION_11.toString()
28-
}
29-
kapt {
30-
// correctErrorTypes true
31-
// keepJavacAnnotationProcessors = true
24+
jvmTarget = java_version
3225
}
3326
composeOptions {
34-
kotlinCompilerExtensionVersion "1.2.0"
27+
kotlinCompilerExtensionVersion "$compose_compiler"
3528
}
3629
packagingOptions {
3730
resources.pickFirsts.add('META-INF/LGPL2.1')
@@ -68,20 +61,21 @@ android {
6861

6962
dependencies {
7063

64+
implementation 'com.google.android.material:material:1.6.1'
65+
// implementation "com.google.android.material:compose-theme-adapter-3:1.0.13"
66+
67+
implementation 'androidx.core:core-ktx:1.8.0'
7168
implementation 'androidx.appcompat:appcompat:1.4.2'
7269
implementation 'androidx.preference:preference-ktx:1.2.0'
73-
implementation 'androidx.core:core-ktx:1.8.0'
7470

75-
implementation 'com.google.android.material:material:1.6.1'
76-
// implementation "com.google.android.material:compose-theme-adapter-3:1.0.13"
77-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${KotlinCompilerVersion.VERSION}"
71+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
7872
// implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2'
7973

8074
// https://mvnrepository.com/artifact/androidx.compose
8175
implementation "androidx.compose.ui:ui:$compose_version"
8276
implementation "androidx.compose.material:material:$compose_version"
8377
implementation "androidx.compose.foundation:foundation:$compose_version"
84-
implementation "androidx.compose.material:material-icons-core:$compose_version"
78+
// implementation "androidx.compose.material:material-icons-core:$compose_version"
8579
// implementation 'androidx.compose.material:material-icons-extended:$compose_version'
8680

8781
/* Compose Preview */
@@ -111,6 +105,7 @@ task javadoc(type: Javadoc) {
111105
options.author true
112106

113107
doFirst {
108+
114109
// extract AAR files
115110
configurations.implementation.filter { it.name.endsWith('.aar') }.each { aar ->
116111
copy {
@@ -119,6 +114,7 @@ task javadoc(type: Javadoc) {
119114
into "$buildDir/tmp/aarsToJars/${aar.name.replace('.aar', '')}/"
120115
}
121116
}
117+
122118
// provide JAR, which contains the generated data-binding classes
123119
def aar_main = new File("$buildDir/intermediates/aar_main_jar")
124120
if (aar_main.exists()) {
@@ -135,31 +131,31 @@ javadoc.onlyIf {
135131
}
136132

137133
task javadocJar(type: Jar, dependsOn: javadoc) {
138-
archiveClassifier.set("javadoc")
134+
archiveClassifier.set('javadoc')
139135
from javadoc.destinationDir
140136
}
141137

142138
task sourcesJar(type: Jar) {
143139
from android.sourceSets.main.java.srcDirs
144-
archiveClassifier.set("sources")
140+
archiveClassifier.set('sources')
145141
}
146142

147143
artifacts {
148144
archives javadocJar
149145
archives sourcesJar
150146
}
151147

152-
group = "io.syslogic"
153-
version = "$version_name"
148+
group = 'io.syslogic'
149+
version = version_name
154150

155151
afterEvaluate {
156152
publishing {
157153
publications {
158154
release(MavenPublication) {
159-
groupId = "io.syslogic"
160-
artifactId = "androidx-colorpicker"
155+
groupId = 'io.syslogic'
156+
artifactId = 'androidx-colorpicker'
161157
from components.getByName('release')
162-
version = "$version_name"
158+
version = version_name
163159
pom {
164160
name = 'Color Picker'
165161
description = 'A simple color-picker library for Android'

mobile/build.gradle

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ plugins {
77
}
88

99
android {
10-
compileSdk 32
10+
compileSdk compile_sdk
1111
defaultConfig {
1212
applicationId "io.syslogic.demo.colorpicker"
13-
minSdk 21
14-
targetSdk 32
15-
buildToolsVersion "32.0.0"
16-
versionName "$version_name"
17-
versionCode new Integer("$version_code")
1813
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14+
buildToolsVersion build_tools_version
15+
versionCode version_code
16+
versionName version_name
17+
targetSdk target_sdk
18+
minSdk min_sdk
1919
}
2020
compileOptions {
21-
sourceCompatibility JavaVersion.VERSION_11.toString()
22-
targetCompatibility JavaVersion.VERSION_11.toString()
21+
sourceCompatibility java_version
22+
targetCompatibility java_version
2323
}
2424
kotlinOptions {
25-
jvmTarget = JavaVersion.VERSION_11.toString()
25+
jvmTarget = java_version
2626
}
2727
composeOptions {
2828
kotlinCompilerExtensionVersion "$compose_compiler"
@@ -57,10 +57,9 @@ dependencies {
5757

5858
implementation "androidx.appcompat:appcompat:1.4.2"
5959
implementation "androidx.preference:preference-ktx:1.2.0"
60-
61-
implementation "androidx.navigation:navigation-runtime-ktx:2.5.0"
62-
implementation "androidx.navigation:navigation-fragment-ktx:2.5.0"
63-
implementation "androidx.navigation:navigation-ui-ktx:2.5.0"
60+
implementation "androidx.navigation:navigation-runtime-ktx:$nav_version"
61+
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
62+
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
6463

6564
// https://mvnrepository.com/artifact/androidx.compose
6665
implementation 'androidx.activity:activity-compose:1.5.0'
@@ -73,7 +72,7 @@ dependencies {
7372

7473
testImplementation "junit:junit:4.13.2"
7574
androidTestImplementation "androidx.test.ext:junit:1.1.3"
76-
androidTestImplementation "androidx.navigation:navigation-testing:2.5.0"
75+
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
7776
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
7877
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
7978

0 commit comments

Comments
 (0)