Skip to content

Commit

Permalink
Build tools update (#911)
Browse files Browse the repository at this point in the history
* Improve #877

* Update pull_request_template.md

* Update gradle version

* Update AGP version

* Update build files, use MavenPublisher plugin

* Add FAQs

* Fix tests
  • Loading branch information
natario1 authored Jul 12, 2020
1 parent 66c3737 commit a7c1832
Show file tree
Hide file tree
Showing 18 changed files with 304 additions and 348 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Please add a clear description of what the bug is, **and** fill the list below.
- Camera engine used: *camera1/camera2/both*
- Reproducible in official demo app: *yes/no*
- Device / Android version: *Pixel, API 28*
- I have read the [FAQ page](https://natario1.github.io/CameraView/about/faq): *yes/no*

### To Reproduce
Steps to reproduce the behavior, possibly in the demo app:
1. Go to '...'
2. Click on '....'
2. Click on '...'
3. See error

### Expected behavior
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

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

### Version used
Expand Down
10 changes: 7 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
### Before you go
Unless this is a simple fix (typos, bugs with obvious solution), please open an issue first.
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.
Unless this is a simple fix (typos, bugs with obvious solution), please open an issue first so that
we can discuss the best approach to address the problem. Without a reference issue and discussion,
unfortunately, this PR will likely be ignored.

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.

- Fixes ... (*issue number*)
- Tests: ... (*yes/no*)
- Docs updated: ... (*yes/no*)

### Solution
If applicable, briefly describe how the issue was addressed.
If applicable, describe briefly how the issue was addressed.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
java-version: 1.8
- name: Perform base checks
run: ./gradlew demo:assembleDebug cameraview:javadoc
run: ./gradlew demo:assembleDebug cameraview:publishToDirectory
ANDROID_UNIT_TESTS:
name: Unit Tests
runs-on: ubuntu-latest
Expand All @@ -28,12 +28,12 @@ jobs:
with:
java-version: 1.8
- name: Execute unit tests
run: ./gradlew cameraview:testDebugUnitTest
run: ./gradlew cameraview:runUnitTests
- name: Upload unit tests artifact
uses: actions/upload-artifact@v1
with:
name: unit_tests
path: ./cameraview/build/jacoco/
path: ./cameraview/build/coverage_input/unit_tests
ANDROID_EMULATOR_TESTS:
name: Emulator Tests
runs-on: macOS-latest
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: emulator_tests_${{ matrix.EMULATOR_API }}
path: ./cameraview/build/outputs/code_coverage/debugAndroidTest/connected
path: ./cameraview/build/coverage_input/android_tests
CODE_COVERAGE:
name: Code Coverage Report
runs-on: ubuntu-latest
Expand All @@ -92,23 +92,23 @@ jobs:
uses: actions/download-artifact@v1
with:
name: unit_tests
path: ./cameraview/build/jacoco/
path: ./cameraview/build/coverage_input/unit_tests
- name: Download emulator tests artifact
uses: actions/download-artifact@v1
with:
# 27 is the EMULATOR_API with less SdkExclude annotations, and should have
# the best possible coverage.
name: emulator_tests_27
path: ./cameraview/build/outputs/code_coverage/debugAndroidTest/connected
path: ./cameraview/build/coverage_input/android_tests
- name: Create merged coverage report
run: ./gradlew cameraview:mergeCoverageReports
run: ./gradlew cameraview:computeCoverage
- name: Upload merged coverage report (GitHub)
uses: actions/upload-artifact@v1
with:
name: report
path: ./cameraview/build/reports/mergedCoverageReport
path: ./cameraview/build/coverage_output/xml
- name: Upload merged coverage report (Codecov)
uses: codecov/codecov-action@v1
with:
file: ./cameraview/build/reports/mergedCoverageReport/*
file: ./cameraview/build/coverage_output/xml/*
fail_ci_if_error: true
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ jobs:
TRAVIS: true
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Perform bintray upload
run: ./gradlew bintrayUpload
run: ./gradlew cameraview:publishToBintray
2 changes: 1 addition & 1 deletion .github/workflows/emulator_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ ADB_TAGS="$ADB_TAGS MediaEncoderEngine:I MediaEncoder:I AudioMediaEncoder:I Vide
ADB_TAGS="$ADB_TAGS CameraIntegrationTest:I MessageQueue:W MPEG4Writer:I"
adb logcat -c
adb logcat $ADB_TAGS *:E -v color &
./gradlew cameraview:connectedCheck
./gradlew cameraview:runAndroidTests
29 changes: 0 additions & 29 deletions build.gradle

This file was deleted.

34 changes: 34 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

buildscript {

extra["minSdkVersion"] = 15
extra["compileSdkVersion"] = 29
extra["targetSdkVersion"] = 29
extra["kotlinVersion"] = "1.3.72"

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

dependencies {
classpath("com.android.tools.build:gradle:4.0.0")
classpath("com.otaliastudios.tools:publisher:0.3.3")
val kotlinVersion = property("kotlinVersion") as String
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")

}
}

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

tasks.register("clean", Delete::class) {
delete(buildDir)
}
Loading

0 comments on commit a7c1832

Please sign in to comment.