diff --git a/README.md b/README.md index 3452c5a..76f954d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Add this line to your dependencies in app-level build.gradle file: ``` dependencies { - implementation 'com.appswithlove.updraft:updraft-sdk:1.0.6' + implementation 'com.appswithlove.updraft:updraft-sdk:1.0.8' } ``` diff --git a/build.gradle b/build.gradle index a3ce8b0..889f611 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,8 @@ buildscript { classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.appswithlove.updraft:updraft:2.1.7' + classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.5.0' + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.appswithlove.loco:loco:0.2.4' @@ -44,7 +46,7 @@ ext { siteUrl = 'https://github.com/appswithlove/updraft-sdk-android' gitUrl = 'https://github.com/appswithlove/updraft-sdk-android.git' - libraryVersion = '1.0.6' + libraryVersion = '1.0.8' developerId = 'satorikomeiji' developerName = 'Ilia Kuznetcov' diff --git a/updraft-sdk/build.gradle b/updraft-sdk/build.gradle index 78b9c5e..f498ed0 100644 --- a/updraft-sdk/build.gradle +++ b/updraft-sdk/build.gradle @@ -4,6 +4,7 @@ plugins { id 'maven-publish' id 'base' id 'com.appswithlove.loco' + id 'com.vanniktech.maven.publish' } def packageName = 'com.appswithlove.updraft' @@ -32,29 +33,6 @@ android { } } -publishing { - publications { - aar(MavenPublication) { - groupId packageName - version = libraryVersion - artifactId artifact - - // Tell maven to prepare the generated "*.aar" file for publishing - artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") - - pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') - configurations.api.allDependencies.each { dependency -> - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', dependency.group) - dependencyNode.appendNode('artifactId', dependency.name) - dependencyNode.appendNode('version', dependency.version) - } - } - } - } -} - dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -86,32 +64,16 @@ dependencies { group = publishedGroupId version = libraryVersion - -task sourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.srcDirs -} - -task javadoc(type: Javadoc) { - options.encoding = 'UTF-8' - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { - archives javadocJar - archives sourcesJar -} - -afterEvaluate { - assembleRelease.dependsOn(clean) - tasks.withType(GenerateMavenPom).all { - it.dependsOn assembleRelease +mavenPublish { + targets { + // Modify the existing uploadArchives task + uploadArchives { + releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + // repositoryUsername = // This defaults to either the SONATYPE_NEXUS_USERNAME Gradle property or the system environment variable. + // repositoryPassword = // This defaults to either the SONATYPE_NEXUS_PASSWORD Gradle property or the system environment variable. + signing = true + } } }