Skip to content

Commit

Permalink
Regenerate android example (FormidableLabs#265)
Browse files Browse the repository at this point in the history
* Regenerate android example

* Remove test directory
  • Loading branch information
kadikraman authored Mar 8, 2019
1 parent d979132 commit 2985737
Show file tree
Hide file tree
Showing 17 changed files with 1,807 additions and 1,898 deletions.
3 changes: 0 additions & 3 deletions Example/AndroidExample/.babelrc

This file was deleted.

20 changes: 0 additions & 20 deletions Example/AndroidExample/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion Example/AndroidExample/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.78.0
^0.86.0
4 changes: 0 additions & 4 deletions Example/AndroidExample/.prettierrc

This file was deleted.

6 changes: 3 additions & 3 deletions Example/AndroidExample/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ export default class App extends Component<{}, State> {
<Form.Value>{state.accessTokenExpirationDate}</Form.Value>
<Form.Label>refreshToken</Form.Label>
<Form.Value>{state.refreshToken}</Form.Value>
<Form.Label>Scopes</Form.Label>
<Form.Label>scopes</Form.Label>
<Form.Value>{state.scopes.join(', ')}</Form.Value>
</Form>
) : (
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>
)}
<Heading>{state.hasLoggedInOnce ? 'Goodbye.' : 'Hello, stranger.'}</Heading>
)}

<ButtonContainer>
{!state.accessToken ? (
Expand Down
30 changes: 0 additions & 30 deletions Example/AndroidExample/README.md

This file was deleted.

18 changes: 4 additions & 14 deletions Example/AndroidExample/android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
create_aar_targets(glob(["libs/*.aar"]))

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
Expand Down
11 changes: 4 additions & 7 deletions Example/AndroidExample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,16 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
manifestPlaceholders = [
appAuthRedirectScheme: 'io.identityserver.demo'
appAuthRedirectScheme: "io.identityserver.demo"
]
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
include "armeabi-v7a", "x86", "arm64-v8a"
}
}
buildTypes {
Expand All @@ -129,7 +126,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Expand All @@ -140,7 +137,7 @@ android {
}

dependencies {
compile project(':react-native-app-auth')
implementation project(':react-native-app-auth')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
Expand Down
19 changes: 19 additions & 0 deletions Example/AndroidExample/android/app/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""

def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rnappauthandroidexample">
package="com.rnappauthandroidexample">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Expand All @@ -8,6 +8,7 @@
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
Expand Down
16 changes: 8 additions & 8 deletions Example/AndroidExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

buildscript {
ext {
buildToolsVersion = "27.0.3"
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -23,17 +23,17 @@ buildscript {
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}


task wrapper(type: Wrapper) {
gradleVersion = '4.4'
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip
3 changes: 3 additions & 0 deletions Example/AndroidExample/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["module:metro-react-native-babel-preset"]
}
2 changes: 1 addition & 1 deletion Example/AndroidExample/components/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SafeArea = styled.SafeAreaView`
`;

const Background = styled.ImageBackground.attrs({
source: require('../assets/background.jpg'),
source: require('../assets/background.jpg')
})`
flex: 1;
background-color: white;
Expand Down
5 changes: 4 additions & 1 deletion Example/AndroidExample/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @format */
/**
* @format
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/

import {AppRegistry} from 'react-native';
import App from './App';
Expand Down
15 changes: 8 additions & 7 deletions Example/AndroidExample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
"test": "jest"
},
"dependencies": {
"react": "16.5.0",
"react-native": "0.57.2",
"react": "16.6.3",
"react-native": "0.58.6",
"react-native-app-auth": "4.1.1",
"styled-components": "^3.4.10"
"styled-components": "^4.1.3"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.48.1",
"react-test-renderer": "16.5.0"
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.3.0",
"jest": "24.3.0",
"metro-react-native-babel-preset": "0.53.0",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
Expand Down
Loading

0 comments on commit 2985737

Please sign in to comment.