Skip to content

Commit 2985737

Browse files
authored
Regenerate android example (#265)
* Regenerate android example * Remove test directory
1 parent d979132 commit 2985737

File tree

17 files changed

+1807
-1898
lines changed

17 files changed

+1807
-1898
lines changed

Example/AndroidExample/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

Example/AndroidExample/.eslintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

Example/AndroidExample/.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6767
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6868

6969
[version]
70-
^0.78.0
70+
^0.86.0

Example/AndroidExample/.prettierrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

Example/AndroidExample/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ export default class App extends Component<{}, State> {
108108
<Form.Value>{state.accessTokenExpirationDate}</Form.Value>
109109
<Form.Label>refreshToken</Form.Label>
110110
<Form.Value>{state.refreshToken}</Form.Value>
111-
<Form.Label>Scopes</Form.Label>
111+
<Form.Label>scopes</Form.Label>
112112
<Form.Value>{state.scopes.join(', ')}</Form.Value>
113113
</Form>
114114
) : (
115-
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>
116-
)}
115+
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>
116+
)}
117117

118118
<ButtonContainer>
119119
{!state.accessToken ? (

Example/AndroidExample/README.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

Example/AndroidExample/android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

Example/AndroidExample/android/app/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,16 @@ android {
103103
targetSdkVersion rootProject.ext.targetSdkVersion
104104
versionCode 1
105105
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109106
manifestPlaceholders = [
110-
appAuthRedirectScheme: 'io.identityserver.demo'
107+
appAuthRedirectScheme: "io.identityserver.demo"
111108
]
112109
}
113110
splits {
114111
abi {
115112
reset()
116113
enable enableSeparateBuildPerCPUArchitecture
117114
universalApk false // If true, also generate a universal APK
118-
include "armeabi-v7a", "x86"
115+
include "armeabi-v7a", "x86", "arm64-v8a"
119116
}
120117
}
121118
buildTypes {
@@ -129,7 +126,7 @@ android {
129126
variant.outputs.each { output ->
130127
// For each separate APK per architecture, set a unique version code as described here:
131128
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
132-
def versionCodes = ["armeabi-v7a":1, "x86":2]
129+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
133130
def abi = output.getFilter(OutputFile.ABI)
134131
if (abi != null) { // null for the universal-debug, universal-release variants
135132
output.versionCodeOverride =
@@ -140,7 +137,7 @@ android {
140137
}
141138

142139
dependencies {
143-
compile project(':react-native-app-auth')
140+
implementation project(':react-native-app-auth')
144141
implementation fileTree(dir: "libs", include: ["*.jar"])
145142
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
146143
implementation "com.facebook.react:react-native:+" // From node_modules
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)

Example/AndroidExample/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.rnappauthandroidexample">
2+
package="com.rnappauthandroidexample">
33

44
<uses-permission android:name="android.permission.INTERNET" />
55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
@@ -8,6 +8,7 @@
88
android:name=".MainApplication"
99
android:label="@string/app_name"
1010
android:icon="@mipmap/ic_launcher"
11+
android:roundIcon="@mipmap/ic_launcher_round"
1112
android:allowBackup="false"
1213
android:theme="@style/AppTheme">
1314
<activity

0 commit comments

Comments
 (0)