1- apply plugin : ' com.android.library'
2- apply plugin : ' kotlin-android'
3- apply plugin : ' com.github.dcendents.android-maven'
1+ plugins {
2+ id ' com.android.library'
3+ id ' kotlin-android'
4+ id ' maven-publish'
5+ }
46
57repositories {
68 mavenCentral()
@@ -13,62 +15,47 @@ group = 'com.github.jitpack'
1315version = ' 1.0'
1416
1517android {
16- compileSdkVersion 29
17- buildToolsVersion " 28.0.3"
18+ compileSdkVersion 30
1819
1920 defaultConfig {
2021 minSdkVersion 21
21- targetSdkVersion 29
22+ targetSdkVersion 30
2223 versionCode 1
23- versionName version
24- testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
24+ versionName " 1.0"
2525 }
26+
2627 buildTypes {
2728 release {
2829 minifyEnabled false
29- proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
30+ proguardFiles getDefaultProguardFile(' proguard-android-optimize .txt' ), ' proguard-rules.pro'
3031 }
3132 }
32- lintOptions {
33- abortOnError false
33+ compileOptions {
34+ sourceCompatibility JavaVersion . VERSION_1_8
35+ targetCompatibility JavaVersion . VERSION_1_8
3436 }
35- sourceSets {
36- main. java. srcDirs + = ' src/main/kotlin'
37- androidTest. java. srcDirs + = ' src/androidTest/kotlin'
38- androidTest. resources. srcDirs + = ' src/androidTest/res'
37+ kotlinOptions {
38+ jvmTarget = ' 1.8'
3939 }
4040}
4141
4242dependencies {
43- testImplementation ' junit:junit:4.12'
44- androidTestImplementation ' androidx.test.ext:junit:1.1.1'
45- androidTestImplementation ' androidx.test.espresso:espresso-core:3.2.0'
46-
47- implementation ' androidx.appcompat:appcompat:1.0.2'
4843 implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
49- }
50-
51- task sourcesJar (type : Jar ) {
52- classifier = ' sources'
53- from android. sourceSets. main. java. sourceFiles
54- }
55-
56- task javadoc (type : Javadoc ) {
57- source = android. sourceSets. main. java. sourceFiles
58- classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
59- }
60-
61- task javadocJar (type : Jar , dependsOn : javadoc) {
62- classifier = ' javadoc'
63- from javadoc. destinationDir
64- }
65-
66- task classesJar (type : Jar ) {
67- from " $buildDir /intermediates/classes/release"
68- }
69-
70- artifacts {
71- archives classesJar
72- archives javadocJar
73- archives sourcesJar
44+ implementation ' androidx.core:core-ktx:1.3.2'
45+ implementation ' androidx.appcompat:appcompat:1.2.0'
46+ implementation ' com.google.android.material:material:1.2.1'
47+ }
48+
49+ afterEvaluate {
50+ publishing {
51+ publications {
52+ // Creates a Maven publication called "release".
53+ release(MavenPublication ) {
54+ from components. release
55+ groupId = ' com.github.jitpack'
56+ artifactId = ' android-example'
57+ version = ' 1.0'
58+ }
59+ }
60+ }
7461}
0 commit comments