diff --git a/build.gradle b/build.gradle index 8e6261d..4055c94 100644 --- a/build.gradle +++ b/build.gradle @@ -2,26 +2,13 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:4.0.1' } } -plugins { - id "com.jfrog.bintray" version "1.8.4" -} - -plugins { - id "com.github.dcendents.android-maven" version "2.1" -} - -bintray { - publications = [] - configurations = [] -} - allprojects { repositories { google() diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..199d16e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,20 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f4ac9b0..dfb6cb5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/library/build.gradle b/library/build.gradle index 842e033..c25a507 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,14 +1,12 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' +apply plugin: 'maven-publish' +apply plugin: 'signing' -// https://github.com/bintray/gradle-bintray-plugin/issues/74#issuecomment-168367341 -// https://github.com/dcendents/android-maven-gradle-plugin/issues/9 ext { GROUP = 'com.codepath.libraries' - BASE_VERSION = "2.1" - VERSION_NAME = "2.1.4" + BASE_VERSION = "2.3" + VERSION_NAME = "2.3.0" POM_PACKAGING = "aar" POM_DESCRIPTION = "CodePath OAuth Handler" @@ -54,26 +52,65 @@ android { } } -bintray { - user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') - key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') - - configurations = ['archives'] // needs apply plugin 'com.jfrog.bintray' to work - - pkg { - repo = 'maven' - name = 'android-oauth-handler' - userOrg = 'codepath' - licenses = ['Apache-2.0'] - vcsUrl = 'https://github.com/codepath/android-oauth-handler.git' - version { - name = BASE_VERSION - desc = POM_NAME - released = new Date() - vcsTag = VERSION_NAME +afterEvaluate { + publishing { + publications { + // Creates a Maven publication called "release". + release(MavenPublication) { + // Applies the component for the release build variant. + from components.release + + // You can then customize attributes of the publication as shown below. + groupId = GROUP + artifactId = POM_ARTIFACT_ID + version = VERSION_NAME + + pom { + name = POM_NAME + url = POM_URL + description = POM_DESCRIPTION + licenses { + license { + name = POM_LICENCE_NAME + url = POM_LICENCE_URL + } + } + developers { + developer { + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME + } + } + scm { + url = POM_SCM_URL + } + } + } + } + repositories { + maven { + name = "Sonatype" + credentials { + username = System.getenv('NEXUS_USERNAME') + password = System.getenv('NEXUS_PASSWORD') + } + def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + setUrl(url) + } } } +} +signing { + // gpg on MacOS is the same as gpg2 + // ln -s /usr/local/bin/gpg /usr/local/bin/gpg2 + // Make sure to populate the variables in gradle.properties + // signing.gnupg.keyName=XXX + // signing.gnupg.passpharse + useGpgCmd() + sign(publishing.publications) } task sourcesJar(type: Jar) { @@ -86,7 +123,7 @@ artifacts { } ext { - supportVersion = '28.0.0' + supportVersion = '28.0.0' } dependencies {