11
22buildscript {
3- ext. kotlin_version = ' 1.3.72 '
3+ ext. kotlin_version = " 1.5.10 "
44 repositories {
55 google()
6- jcenter()
7- }
6+ mavenCentral()
87 dependencies {
9- classpath " com.android.tools.build:gradle:4.0.0 "
8+ classpath " com.android.tools.build:gradle:4.2.1 "
109 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
11- classpath " com.diffplug.spotless:spotless-plugin-gradle:4.4.0 "
10+ classpath " com.diffplug.spotless:spotless-plugin-gradle:5.12.5 "
1211 }
1312}
1413
1514allprojects {
1615 repositories {
1716 google()
18- jcenter()
19- maven { url ' https://jitpack.io' }
17+ mavenCentral()
18+ maven { url " https://jitpack.io" }
19+ }
20+ }
21+
22+ ext {
23+ artifactId = ' wifi-watcher'
24+ groupId = ' net.kuama.android'
25+ compile_sdk_version = 30
26+ min_sdk_version = 21
27+ target_sdk_version = 30
28+ version_code = project. property(" version_code" ). toInteger()
29+ version_name = project. property(" version_name" ) as String
2030 }
2131}
2232
2333apply plugin : " com.android.library"
2434apply plugin : " kotlin-android"
25- apply plugin : " kotlin-android-extensions"
2635apply plugin : " maven-publish"
27- apply plugin : " com.diffplug.gradle. spotless"
36+ apply plugin : " com.diffplug.spotless"
2837
2938android {
30- compileSdkVersion 29
31- buildToolsVersion " 29 .0.3"
39+ compileSdkVersion 30
40+ buildToolsVersion " 30 .0.3"
3241
3342
3443 defaultConfig {
35- minSdkVersion 19
36- targetSdkVersion 29
37- versionCode project . property( ' version_code ' ) . toInteger()
38- versionName project . property( ' version_name' ) as String
44+ minSdkVersion rootProject . ext . min_sdk_version
45+ targetSdkVersion rootProject . ext . target_sdk_version
46+ versionCode rootProject . ext . version_code
47+ versionName rootProject . ext . version_name
3948
4049 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
41- consumerProguardFiles ' consumer-rules.pro'
50+ consumerProguardFiles " consumer-rules.pro"
4251 }
4352
4453 buildTypes {
4554 release {
4655 minifyEnabled false
47- proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
56+ proguardFiles getDefaultProguardFile(" proguard-android-optimize.txt" ), " proguard-rules.pro"
4857 }
4958 }
5059
5160}
5261
5362dependencies {
54- implementation fileTree(dir : ' libs' , include : [' *.jar' ])
55- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
56- implementation ' androidx.appcompat:appcompat:1.1.0'
57- implementation ' androidx.core:core-ktx:1.3.0'
58- implementation " io.reactivex.rxjava2:rxjava:2.2.19"
59- implementation " io.reactivex.rxjava2:rxkotlin:2.4.0"
60- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
61- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7"
62- implementation ' com.github.jitpack:gradle-simple:1.0'
63- testImplementation ' junit:junit:4.13'
64- androidTestImplementation ' androidx.test.ext:junit:1.1.1'
65- androidTestImplementation ' androidx.test.espresso:espresso-core:3.2.0'
63+ implementation fileTree(dir : " libs" , include : [" *.jar" ])
64+ implementation " androidx.core:core-ktx:1.5.0"
65+ implementation " androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
66+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3"
67+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
68+
69+ testImplementation " junit:junit:4.13.2"
70+ testImplementation " io.mockk:mockk:1.11.0"
71+ androidTestImplementation " androidx.test.ext:junit:1.1.2"
72+ androidTestImplementation " androidx.test.espresso:espresso-core:3.3.0"
6673}
6774
6875
@@ -81,19 +88,26 @@ task sourceJar(type: Jar) {
8188 classifier " sources"
8289}
8390
84- publishing {
85- publications {
86- bar(MavenPublication ) {
87- groupId ' net.kuama.android'
88- artifactId ' wifi-monitor'
89- version project. property(' version_name' )
90- artifact(sourceJar)
91- artifact(" $buildDir /outputs/aar/wifi-monitor-release.aar" )
92- }
93- }
94- repositories {
95- maven {
96- url " $buildDir /repo"
91+ task androidSourcesJar (type : Jar ) {
92+ archiveClassifier. set(' sources' )
93+ from android. sourceSets. main. java. srcDirs
94+ }
95+
96+ afterEvaluate {
97+ publishing {
98+ publications {
99+ release(MavenPublication ) {
100+ from components. release
101+
102+ // Adds javadocs and sources as separate jars.
103+ // artifact androidJavadocsJar
104+ artifact androidSourcesJar
105+
106+ groupId rootProject. ext. groupId
107+ artifactId rootProject. ext. artifactId
108+ version project. property(" version_name" ) as String
109+
110+ }
97111 }
98112 }
99113}
0 commit comments