Skip to content

Commit

Permalink
Fix boolean param inheritance on Android (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Oberwasserlechner authored Jul 9, 2021
1 parent e9403f1 commit f421e42
Show file tree
Hide file tree
Showing 14 changed files with 492 additions and 338 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
branches:
- '**'
tags-ignore:
- '*.*'
paths-ignore:
- README.md

jobs:
test-web:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/setup-node@v2
with:
java-version: 14.x
- uses: actions/checkout@v2
- name: Restore Dependency Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
# test-ios:
# runs-on: macos-latest
# timeout-minutes: 30
# strategy:
# matrix:
# xcode:
# - /Applications/Xcode_12.4.app
# steps:
# - run: sudo xcode-select --switch ${{ matrix.xcode }}
# - uses: actions/setup-node@v1
# with:
# node-version: 14.x
# - uses: actions/checkout@v2
# - name: Restore Dependency Cache
# uses: actions/cache@v1
# with:
# path: ~/.npm
# key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
# - run: npm install
# - run: npm run verify
# working-directory: ./ios
test-android:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout latest source
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Set up Node
uses: actions/setup-node@v2
with:
java-version: 14.x

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: ./android

- name: Cache .gradle
uses: actions/cache@v1
with:
path: .gradle
key: ${{ runner.os }}-dotgradle-${{ hashFiles('**/build.gradle') }}
restore-keys: |
${{ runner.os }}-dotgradle-
- name: Cache gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install Capacitor Android dependency
run: npm ci

- name: Run Tests
run: ./gradlew test
working-directory: ./android
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Capacitor OAuth 2 client plugin

[![npm](https://img.shields.io/npm/v/@capacitor-community/oauth2.svg)](https://www.npmjs.com/package/@capacitor-community/oauth2)
[![Travis](https://img.shields.io/travis/moberwasserlechner/capacitor-oauth2/master.svg?maxAge=2592000)](https://travis-ci.org/moberwasserlechner/capacitor-oauth2)
[![npm](https://img.shields.io/npm/dt/@capacitor-community/capacitor-oauth2.svg?label=npm%20downloads)](https://www.npmjs.com/package/@capacitor-community/capacitor-oauth2)
[![Twitter Follow](https://img.shields.io/twitter/follow/michaelowl_web.svg?style=social&label=Follow&style=flat-square)](https://twitter.com/michaelowl_web)
<a href="https://github.com/moberwasserlechner/capacitor-oauth2/actions?query=workflow%3ACI"><img src="https://img.shields.io/github/workflow/status/moberwasserlechner/capacitor-oauth2/CI?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@byteowls/capacitor-oauth2"><img src="https://img.shields.io/npm/dw/@byteowls/capacitor-oauth2?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@byteowls/capacitor-oauth2"><img src="https://img.shields.io/npm/v/@byteowls/capacitor-oauth2?style=flat-square" /></a>
<a href="https://www.npmjs.com/package/@byteowls/capacitor-oauth2"><img src="https://img.shields.io/npm/l/@byteowls/capacitor-oauth2?style=flat-square" /></a>

This a generic OAuth 2 client plugin.

Expand Down
35 changes: 28 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
commonsIoVersion = project.hasProperty('commonsIoVersion') ? rootProject.ext.commonsIoVersion : '2.10.0'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
junit5Version = project.hasProperty('junit5Version') ? rootProject.ext.junit5Version : '5.7.2'
androidJunit5Version = project.hasProperty('androidJunit5Version') ? rootProject.ext.androidJunit5Version : '1.2.2';
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
}

Expand All @@ -27,7 +28,10 @@ android {
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// 1) Make sure to use the AndroidJUnitRunner, or a subclass of it. This requires a dependency on androidx.test:runner, too!
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// 2) Connect JUnit 5 to the runner
// testInstrumentationRunnerArgument("runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder")
}
buildTypes {
release {
Expand All @@ -38,18 +42,33 @@ android {
lintOptions {
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

unitTestVariants.all {
it.mergedFlavor.manifestPlaceholders += [
appAuthRedirectScheme: "com.byteowls.capacitorapp"
]
}

// testOptions {
// unitTests {
// all {
// include 'com.byteowls.capacitor.oauth2'
// }
// }
// }
}

repositories {
google()
mavenCentral()
jcenter()
}


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':capacitor-android')
Expand All @@ -58,10 +77,12 @@ dependencies {
implementation "net.openid:appauth:$appAuthVersion"
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"

testImplementation "junit:junit:$junitVersion"
androidTestImplementation "commons-io:commons-io:$commonsIoVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
// 4) Jupiter API & Test Runner, if you don't have it already
testImplementation("org.junit.jupiter:junit-jupiter-params:${junit5Version}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${junit5Version}") {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation "commons-io:commons-io:$commonsIoVersion"
}

// ###############
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit f421e42

Please sign in to comment.