Skip to content

Commit 3055ddc

Browse files
author
Iain McGinniss
committed
Minor updates to demo
Bumps dependency versions, cleanup of gradle script, and minor code change in MainActivity to reference official constant.
1 parent a5f199c commit 3055ddc

File tree

3 files changed

+27
-36
lines changed

3 files changed

+27
-36
lines changed

build.gradle

+23-33
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,31 @@
1-
// determines the location of the Android SDK, using a key from
2-
// local.properties. If this file does not exist, an attempt is made to
3-
// infer the location and stored in the local.properties file for future use
4-
// (and easy modification, if the inferred value is wrong).
5-
def androidSdkDir = {
6-
def localPropertiesFile = file(new File(projectDir, "local.properties"))
7-
8-
if (!localPropertiesFile.exists()) {
9-
throw new GradleException("local.properties file missing")
10-
}
11-
12-
def props = new Properties()
13-
localPropertiesFile.withInputStream { props.load(it) }
14-
def sdkDir = props.get("sdk.dir")
15-
if (sdkDir == null) {
16-
throw new GradleException("sdk.dir not defined in local.properties")
17-
}
18-
return sdkDir
19-
}
20-
211
buildscript {
222
repositories {
233
jcenter()
4+
google()
245
}
256

267
dependencies {
27-
classpath 'com.android.tools.build:gradle:2.3.1'
28-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
8+
classpath 'com.android.tools.build:gradle:3.0.0-rc2'
9+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
2910
}
3011
}
3112

3213
allprojects {
3314
repositories {
3415
jcenter()
35-
36-
maven {
37-
url "${androidSdkDir()}/extras/android/m2repository"
38-
}
16+
google()
3917
}
4018
}
4119

4220
apply plugin: 'com.android.application'
4321

4422
dependencies {
45-
compile 'com.android.support:appcompat-v7:25.3.1'
46-
compile 'com.android.support:design:25.3.1'
47-
compile 'com.squareup.picasso:picasso:2.5.2'
48-
compile 'org.apmem.tools:layouts:1.10@aar'
49-
compile 'net.openid:appauth:0.7.0'
23+
implementation 'com.android.support:appcompat-v7:26.1.0'
24+
implementation 'com.android.support:customtabs:26.1.0'
25+
implementation 'com.android.support:design:26.1.0'
26+
implementation 'com.squareup.picasso:picasso:2.5.2'
27+
implementation 'org.apmem.tools:layouts:1.10@aar'
28+
implementation 'net.openid:appauth:0.7.0'
5029
}
5130

5231
android {
@@ -55,6 +34,7 @@ android {
5534
'appAuthRedirectScheme': 'com.googleusercontent.apps.533526602309-6g5u7a7gk5gaevtei81mt8c5aokbeklv'
5635
]
5736
}
37+
5838
signingConfigs {
5939
debugAndRelease {
6040
keyAlias 'appauth'
@@ -63,8 +43,10 @@ android {
6343
storePassword 'appauth'
6444
}
6545
}
66-
compileSdkVersion 25
67-
buildToolsVersion '25.0.2'
46+
47+
compileSdkVersion 26
48+
buildToolsVersion '26.0.2'
49+
6850
sourceSets {
6951
main.manifest.srcFile 'AndroidManifest.xml'
7052
main.java.srcDirs = ['src']
@@ -73,6 +55,12 @@ android {
7355
main.assets.srcDir 'assets'
7456
main.resources.srcDir 'src'
7557
}
58+
59+
compileOptions {
60+
sourceCompatibility = JavaVersion.VERSION_1_8
61+
targetCompatibility = JavaVersion.VERSION_1_8
62+
}
63+
7664
buildTypes {
7765
release {
7866
minifyEnabled false
@@ -83,10 +71,12 @@ android {
8371
signingConfig signingConfigs.debugAndRelease
8472
}
8573
}
74+
8675
packagingOptions {
8776
exclude 'META-INF/LICENSE.txt'
8877
exclude 'META-INF/NOTICE.txt'
8978
}
79+
9080
lintOptions {
9181
warningsAsErrors true
9282
disable 'PrivateResource'
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Apr 18 19:56:02 PDT 2017
1+
#Tue Oct 24 08:21:52 BST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

src/net/openid/appauthdemo/moreidps/MainActivity.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import net.openid.appauth.AuthorizationRequest;
3030
import net.openid.appauth.AuthorizationService;
3131
import net.openid.appauth.AuthorizationServiceConfiguration;
32+
import net.openid.appauth.ResponseTypeValues;
3233

3334
import java.util.List;
3435

@@ -102,7 +103,7 @@ private void makeAuthRequest(
102103
AuthorizationRequest authRequest = new AuthorizationRequest.Builder(
103104
serviceConfig,
104105
idp.getClientId(),
105-
"code",
106+
ResponseTypeValues.CODE,
106107
idp.getRedirectUri())
107108
.setScope(idp.getScope())
108109
.build();

0 commit comments

Comments
 (0)