Skip to content

Commit 3be2d82

Browse files
committed
Fix Android test: add library deps and exclude integration tests
Add gson, gson-fire, okhttp, swagger-annotations as implementation deps so they're packaged into the test APK. Use exclude instead of include to filter out integration test packages that need API tokens.
1 parent 50e2d9c commit 3be2d82

5 files changed

Lines changed: 46 additions & 46 deletions

File tree

.github/workflows/android-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Android Compatibility
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
android-test:
@@ -15,9 +15,9 @@ jobs:
1515

1616
- uses: actions/setup-java@v4
1717
with:
18-
distribution: 'temurin'
18+
distribution: "temurin"
1919
java-version: 17
20-
cache: 'gradle'
20+
cache: "gradle"
2121

2222
- name: Build Java library JAR
2323
run: mvn package -Dmaven.test.skip=true

.github/workflows/check-badges.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Check badges in README.md
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
build-and-test:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v4
1515

16-
- name: Check badges in README.md
17-
run: ./scripts/check-badges.bash "README.md"
16+
- name: Check badges in README.md
17+
run: ./scripts/check-badges.bash "README.md"

.github/workflows/check-style.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ name: Java check style
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-java@v3
16-
with:
17-
distribution: 'corretto'
18-
java-version: 11
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-java@v3
16+
with:
17+
distribution: "corretto"
18+
java-version: 11
1919

20-
- name: Lint with CheckStyle
21-
run: ./scripts/checkstyle.bash
20+
- name: Lint with CheckStyle
21+
run: ./scripts/checkstyle.bash

.github/workflows/maven.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,35 @@ name: Java CI with Maven
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [main]
99
pull_request:
10-
branches: [ main ]
10+
branches: [main]
1111

1212
jobs:
1313
test:
14-
14+
name: test (Java version ${{ matrix.java-version }})
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
1818
java-version: [11, 21]
1919

2020
steps:
21-
- uses: actions/checkout@v4
22-
- name: Set up JDK ${{ matrix.java-version }}
23-
uses: actions/setup-java@v4
24-
with:
25-
# Use same in Dockerfile
26-
distribution: 'corretto'
27-
java-version: ${{ matrix.java-version }}
28-
cache: 'maven'
29-
30-
- name: Maven Compile
31-
run: mvn compile
32-
33-
- name: Test with Maven
34-
env:
35-
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
36-
run: |
37-
chmod +x scripts/*
38-
make build
39-
make test
40-
41-
# TODO: Move to pack.yml
42-
# - name: Build the Docker image
43-
# run: docker build . --file Dockerfile
21+
- uses: actions/checkout@v4
22+
- name: Set up JDK ${{ matrix.java-version }}
23+
uses: actions/setup-java@v4
24+
with:
25+
# Use same in Dockerfile
26+
distribution: "corretto"
27+
java-version: ${{ matrix.java-version }}
28+
cache: "maven"
29+
30+
- name: Maven Compile
31+
run: mvn compile
32+
33+
- name: Test with Maven
34+
env:
35+
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
36+
run: |
37+
chmod +x scripts/*
38+
make build
39+
make test

android-test/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ android {
2020
androidTest {
2121
java {
2222
srcDirs = ['../src/test/java']
23-
include 'com/aspose/barcode/cloud/api/**'
23+
exclude 'com/aspose/barcode/cloud/test/**'
24+
exclude 'com/aspose/barcode/cloud/examples/**'
2425
}
2526
}
2627
}
@@ -40,8 +41,11 @@ android {
4041

4142
dependencies {
4243
implementation files('../target/aspose-barcode-cloud-26.3.0.jar')
44+
implementation 'com.google.code.gson:gson:2.13.2'
45+
implementation 'io.gsonfire:gson-fire:1.9.0'
46+
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
47+
implementation 'io.swagger:swagger-annotations:1.6.16'
4348
androidTestImplementation 'junit:junit:4.13.2'
4449
androidTestImplementation 'androidx.test:runner:1.5.2'
4550
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
46-
androidTestImplementation 'com.squareup.okhttp3:okhttp:5.3.2'
4751
}

0 commit comments

Comments
 (0)