From 0efc925d59fa32a7779456d1fc2634a7d0281f4c Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Mon, 19 Aug 2019 23:14:06 -0700 Subject: [PATCH 1/6] fix regression again --- library/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index 8b52bc3..d0c6189 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,8 +7,8 @@ apply plugin: 'com.jfrog.bintray' ext { GROUP = 'com.codepath.libraries' - BASE_VERSION = "2.0" - VERSION_NAME = "2.1.3" + BASE_VERSION = "2.1" + VERSION_NAME = "2.1.4" POM_PACKAGING = "aar" POM_DESCRIPTION = "CodePath OAuth Handler" From e72ea942ea0feb1d985ca0716a9fc588c70fb138 Mon Sep 17 00:00:00 2001 From: lgleasain Date: Mon, 28 Jun 2021 20:52:53 -0400 Subject: [PATCH 2/6] adding in changes so that this will work with api 30 --- library/build.gradle | 14 +++++++------- .../java/com/codepath/oauth/OAuthTokenClient.java | 10 +++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index d0c6189..842e033 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -32,13 +32,13 @@ group = GROUP archivesBaseName = POM_ARTIFACT_ID android { - compileSdkVersion 28 + compileSdkVersion 30 defaultConfig { versionCode 1 versionName VERSION_NAME minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 30 } // Related to https://github.com/scribejava/scribejava/issues/480 @@ -90,18 +90,18 @@ ext { } dependencies { - api "androidx.appcompat:appcompat:1.0.2" - api 'com.codepath.libraries:asynchttpclient:0.0.8' + api "androidx.appcompat:appcompat:1.3.0" + api 'com.codepath.libraries:asynchttpclient:2.1.1' api 'com.github.scribejava:scribejava-apis:4.1.1' api 'com.github.scribejava:scribejava-httpclient-okhttp:4.1.1' implementation 'se.akerfeldt:okhttp-signpost:1.1.0' implementation 'oauth.signpost:signpost-core:1.2.1.2' implementation 'com.facebook.stetho:stetho:1.5.1' implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1' - implementation "com.squareup.okhttp3:logging-interceptor:4.1.0" + implementation "com.squareup.okhttp3:logging-interceptor:4.7.2" } -/*task jar(type: Jar) { +task jar(type: Jar) { from android.sourceSets.main.java.srcDirs -}*/ +} diff --git a/library/src/main/java/com/codepath/oauth/OAuthTokenClient.java b/library/src/main/java/com/codepath/oauth/OAuthTokenClient.java index 03629b4..d76079d 100755 --- a/library/src/main/java/com/codepath/oauth/OAuthTokenClient.java +++ b/library/src/main/java/com/codepath/oauth/OAuthTokenClient.java @@ -34,12 +34,20 @@ public OAuthTokenClient(BaseApi apiInstance, String consumerKey, String consumer this.apiInstance = apiInstance; this.handler = handler; if (callbackUrl == null) { callbackUrl = OAuthConstants.OUT_OF_BAND; }; - this.service = new ServiceBuilder() + if(scope == null) { + this.service = new ServiceBuilder() + .apiKey(consumerKey) + .apiSecret(consumerSecret).callback(callbackUrl) + .httpClientConfig(OkHttpHttpClientConfig.defaultConfig()) + .build(apiInstance); + } else { + this.service = new ServiceBuilder() .apiKey(consumerKey) .apiSecret(consumerSecret).callback(callbackUrl) .httpClientConfig(OkHttpHttpClientConfig.defaultConfig()) .scope(scope) // OAuth2 requires scope .build(apiInstance); + } } // Get a request token and the authorization url From fb129fe91e8291554df26c92d93d86b83b883410 Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Mon, 28 Jun 2021 21:23:58 -0700 Subject: [PATCH 3/6] Bump library deps and get rid of Bintray, move to Sonatype make sure to check this file in --- build.gradle | 17 +------- gradle.properties | 20 +++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- library/build.gradle | 53 +++++++++++++----------- 4 files changed, 52 insertions(+), 40 deletions(-) create mode 100644 gradle.properties 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..08ef71c 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,14 +1,11 @@ apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' +apply plugin: 'maven-publish' -// 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.2" + VERSION_NAME = "2.2.0" POM_PACKAGING = "aar" POM_DESCRIPTION = "CodePath OAuth Handler" @@ -54,26 +51,34 @@ 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 + } } + 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) + } } - + } } task sourcesJar(type: Jar) { From b0d0e140922cf7eed2e44e8f407e93b552be528c Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Sat, 10 Jul 2021 14:29:03 -0700 Subject: [PATCH 4/6] Add GPG signing --- library/build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/build.gradle b/library/build.gradle index 08ef71c..a5615d6 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'com.android.library' apply plugin: 'maven-publish' +apply plugin: 'signing' ext { @@ -81,6 +82,16 @@ afterEvaluate { } } +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) { from android.sourceSets.main.java.srcDirs archiveClassifier.set("sources") From bb10d670dad9a4c95c8c49e8ebbf2ded2ccd6d4c Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Sat, 10 Jul 2021 14:48:15 -0700 Subject: [PATCH 5/6] Fix for Sonatype publishing --- library/build.gradle | 49 +++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index a5615d6..d95fb57 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -64,22 +64,43 @@ afterEvaluate { 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) } } - 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 { @@ -102,7 +123,7 @@ artifacts { } ext { - supportVersion = '28.0.0' + supportVersion = '28.0.0' } dependencies { From 3a7c3a523ef9c574d3bc4b0fb8493548c6a7abff Mon Sep 17 00:00:00 2001 From: Roger Hu Date: Sat, 10 Jul 2021 15:17:06 -0700 Subject: [PATCH 6/6] Bump to 2.3.0 - 2.2.0 was a mistag. --- library/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index d95fb57..c25a507 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -5,8 +5,8 @@ apply plugin: 'signing' ext { GROUP = 'com.codepath.libraries' - BASE_VERSION = "2.2" - VERSION_NAME = "2.2.0" + BASE_VERSION = "2.3" + VERSION_NAME = "2.3.0" POM_PACKAGING = "aar" POM_DESCRIPTION = "CodePath OAuth Handler"