Skip to content

Commit a7c1832

Browse files
authored
Build tools update (#911)
* Improve #877 * Update pull_request_template.md * Update gradle version * Update AGP version * Update build files, use MavenPublisher plugin * Add FAQs * Fix tests
1 parent 66c3737 commit a7c1832

File tree

18 files changed

+304
-348
lines changed

18 files changed

+304
-348
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ Please add a clear description of what the bug is, **and** fill the list below.
1313
- Camera engine used: *camera1/camera2/both*
1414
- Reproducible in official demo app: *yes/no*
1515
- Device / Android version: *Pixel, API 28*
16+
- I have read the [FAQ page](https://natario1.github.io/CameraView/about/faq): *yes/no*
1617

1718
### To Reproduce
1819
Steps to reproduce the behavior, possibly in the demo app:
1920
1. Go to '...'
20-
2. Click on '....'
21+
2. Click on '...'
2122
3. See error
2223

2324
### Expected behavior

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ assignees: ''
88
---
99

1010
### How do I?
11-
Describe your problem here. Please, read the docs first.
11+
Describe your problem here. Please, read the [docs](https://natario1.github.io/CameraView) and [FAQ page](https://natario1.github.io/CameraView/about/faq) first.
1212
Questions not strictly related to CameraView should be asked elsewhere.
1313

1414
### Version used

.github/pull_request_template.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
### Before you go
2-
Unless this is a simple fix (typos, bugs with obvious solution), please open an issue first.
3-
If the edited files were covered by tests, updated tests are required for merging. Please look into the tests folders and make sure you cover new code.
2+
Unless this is a simple fix (typos, bugs with obvious solution), please open an issue first so that
3+
we can discuss the best approach to address the problem. Without a reference issue and discussion,
4+
unfortunately, this PR will likely be ignored.
5+
6+
If the edited files were covered by tests, updated tests are required for merging.
7+
Please look into the tests folders and make sure you cover new code.
48

59
- Fixes ... (*issue number*)
610
- Tests: ... (*yes/no*)
711
- Docs updated: ... (*yes/no*)
812

913
### Solution
10-
If applicable, briefly describe how the issue was addressed.
14+
If applicable, describe briefly how the issue was addressed.

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
java-version: 1.8
2020
- name: Perform base checks
21-
run: ./gradlew demo:assembleDebug cameraview:javadoc
21+
run: ./gradlew demo:assembleDebug cameraview:publishToDirectory
2222
ANDROID_UNIT_TESTS:
2323
name: Unit Tests
2424
runs-on: ubuntu-latest
@@ -28,12 +28,12 @@ jobs:
2828
with:
2929
java-version: 1.8
3030
- name: Execute unit tests
31-
run: ./gradlew cameraview:testDebugUnitTest
31+
run: ./gradlew cameraview:runUnitTests
3232
- name: Upload unit tests artifact
3333
uses: actions/upload-artifact@v1
3434
with:
3535
name: unit_tests
36-
path: ./cameraview/build/jacoco/
36+
path: ./cameraview/build/coverage_input/unit_tests
3737
ANDROID_EMULATOR_TESTS:
3838
name: Emulator Tests
3939
runs-on: macOS-latest
@@ -78,7 +78,7 @@ jobs:
7878
uses: actions/upload-artifact@v1
7979
with:
8080
name: emulator_tests_${{ matrix.EMULATOR_API }}
81-
path: ./cameraview/build/outputs/code_coverage/debugAndroidTest/connected
81+
path: ./cameraview/build/coverage_input/android_tests
8282
CODE_COVERAGE:
8383
name: Code Coverage Report
8484
runs-on: ubuntu-latest
@@ -92,23 +92,23 @@ jobs:
9292
uses: actions/download-artifact@v1
9393
with:
9494
name: unit_tests
95-
path: ./cameraview/build/jacoco/
95+
path: ./cameraview/build/coverage_input/unit_tests
9696
- name: Download emulator tests artifact
9797
uses: actions/download-artifact@v1
9898
with:
9999
# 27 is the EMULATOR_API with less SdkExclude annotations, and should have
100100
# the best possible coverage.
101101
name: emulator_tests_27
102-
path: ./cameraview/build/outputs/code_coverage/debugAndroidTest/connected
102+
path: ./cameraview/build/coverage_input/android_tests
103103
- name: Create merged coverage report
104-
run: ./gradlew cameraview:mergeCoverageReports
104+
run: ./gradlew cameraview:computeCoverage
105105
- name: Upload merged coverage report (GitHub)
106106
uses: actions/upload-artifact@v1
107107
with:
108108
name: report
109-
path: ./cameraview/build/reports/mergedCoverageReport
109+
path: ./cameraview/build/coverage_output/xml
110110
- name: Upload merged coverage report (Codecov)
111111
uses: codecov/codecov-action@v1
112112
with:
113-
file: ./cameraview/build/reports/mergedCoverageReport/*
113+
file: ./cameraview/build/coverage_output/xml/*
114114
fail_ci_if_error: true

.github/workflows/deploy.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ jobs:
1111
TRAVIS: true
1212
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
1313
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
14+
BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }}
1415
steps:
1516
- uses: actions/checkout@v2
1617
- uses: actions/setup-java@v1
1718
with:
1819
java-version: 1.8
1920
- name: Perform bintray upload
20-
run: ./gradlew bintrayUpload
21+
run: ./gradlew cameraview:publishToBintray

.github/workflows/emulator_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ ADB_TAGS="$ADB_TAGS MediaEncoderEngine:I MediaEncoder:I AudioMediaEncoder:I Vide
1111
ADB_TAGS="$ADB_TAGS CameraIntegrationTest:I MessageQueue:W MPEG4Writer:I"
1212
adb logcat -c
1313
adb logcat $ADB_TAGS *:E -v color &
14-
./gradlew cameraview:connectedCheck
14+
./gradlew cameraview:runAndroidTests

build.gradle

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

build.gradle.kts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
buildscript {
3+
4+
extra["minSdkVersion"] = 15
5+
extra["compileSdkVersion"] = 29
6+
extra["targetSdkVersion"] = 29
7+
extra["kotlinVersion"] = "1.3.72"
8+
9+
repositories {
10+
google()
11+
mavenCentral()
12+
jcenter()
13+
}
14+
15+
dependencies {
16+
classpath("com.android.tools.build:gradle:4.0.0")
17+
classpath("com.otaliastudios.tools:publisher:0.3.3")
18+
val kotlinVersion = property("kotlinVersion") as String
19+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
20+
21+
}
22+
}
23+
24+
allprojects {
25+
repositories {
26+
google()
27+
mavenCentral()
28+
jcenter()
29+
}
30+
}
31+
32+
tasks.register("clean", Delete::class) {
33+
delete(buildDir)
34+
}

0 commit comments

Comments
 (0)