From 994b1dd43424579683b049351f9d71382b7494b6 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Fri, 2 Jul 2021 21:49:07 +0200 Subject: [PATCH] Release 2.7.1 (#1111) * Update dependencies * Don't crash onConfigureFailed * Publish to Maven Central * Release 2.7.1 --- .github/workflows/build.yml | 1 - .github/workflows/deploy.yml | 15 ++++--- .github/workflows/snapshot.yml | 23 ++++++++++ LICENSE | 2 +- README.md | 4 +- build.gradle.kts | 8 ++-- cameraview/build.gradle.kts | 44 ++++++++++++------- .../cameraview/engine/Camera2Engine.java | 10 ++++- demo/build.gradle.kts | 4 +- docs/_about/changelog.md | 14 ++++++ docs/_about/faq.md | 2 +- docs/_about/install.md | 6 +-- docs/_config.yml | 4 +- docs/_extra/contributing.md | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 15 files changed, 96 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 395539b5..9ccf2610 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,6 @@ name: Build on: push: branches: - - master - main pull_request: jobs: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7eed30cd..4fcf2fbb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,17 +4,18 @@ on: release: types: [published] jobs: - BINTRAY_UPLOAD: - name: Bintray Upload + MAVEN_UPLOAD: + name: Maven Upload runs-on: ubuntu-latest env: - BINTRAY_USER: ${{ secrets.BINTRAY_USER }} - BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} - BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} steps: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Perform bintray upload - run: ./gradlew cameraview:publishToBintray + - name: Perform maven upload + run: ./gradlew publishToSonatype diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 00000000..dae1ea77 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,23 @@ +# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions +# Renaming ? Change the README badge. +name: Snapshot +on: + push: + branches: + - main +jobs: + SNAPSHOT: + name: Publish Snapshot + runs-on: ubuntu-latest + env: + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Publish sonatype snapshot + run: ./gradlew publishToSonatypeSnapshot \ No newline at end of file diff --git a/LICENSE b/LICENSE index dc04615b..b44d8842 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ Copyrights for portions of project CameraView are held by WonderKiln, Inc as part of project CameraKit-Android (https://github.com/wonderkiln/CameraKit-Android). Their original license is available below, or at -https://github.com/wonderkiln/CameraKit-Android/blob/master/LICENSE . +https://github.com/wonderkiln/CameraKit-Android/blob/main/LICENSE . All other copyrights for project CameraView are held by Otalia Studios, 2017. ------------------------------------------------------------------------------ diff --git a/README.md b/README.md index c3aee6ec..db154f50 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Build Status](https://github.com/natario1/CameraView/workflows/Build/badge.svg?event=push)](https://github.com/natario1/CameraView/actions) -[![Code Coverage](https://codecov.io/gh/natario1/CameraView/branch/master/graph/badge.svg)](https://codecov.io/gh/natario1/CameraView) +[![Code Coverage](https://codecov.io/gh/natario1/CameraView/branch/main/graph/badge.svg)](https://codecov.io/gh/natario1/CameraView) [![Release](https://img.shields.io/github/release/natario1/CameraView.svg)](https://github.com/natario1/CameraView/releases) [![Issues](https://img.shields.io/github/issues-raw/natario1/CameraView.svg)](https://github.com/natario1/CameraView/issues) [![Funding](https://img.shields.io/opencollective/all/CameraView.svg?colorB=r)](https://natario1.github.io/CameraView/extra/donate) @@ -22,7 +22,7 @@ CameraView is a well documented, high-level library that makes capturing picture addressing most of the common issues and needs, and still leaving you with flexibility where needed. ```groovy -api 'com.otaliastudios:cameraview:2.7.0' +api 'com.otaliastudios:cameraview:2.7.1' ``` - Fast & reliable diff --git a/build.gradle.kts b/build.gradle.kts index de358275..be75b022 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,13 +8,12 @@ buildscript { repositories { google() mavenCentral() - jcenter() } dependencies { - classpath("com.android.tools.build:gradle:4.1.2") - classpath("io.deepmedia.tools:publisher:0.4.1") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21") + classpath("com.android.tools.build:gradle:4.2.2") + classpath("io.deepmedia.tools:publisher:0.6.0") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20") } } @@ -23,7 +22,6 @@ allprojects { repositories { google() mavenCentral() - jcenter() } } diff --git a/cameraview/build.gradle.kts b/cameraview/build.gradle.kts index f1e0ac8b..eb1ea01f 100644 --- a/cameraview/build.gradle.kts +++ b/cameraview/build.gradle.kts @@ -14,7 +14,7 @@ android { setMinSdkVersion(property("minSdkVersion") as Int) setTargetSdkVersion(property("targetSdkVersion") as Int) versionCode = 1 - versionName = "2.7.0" + versionName = "2.7.1" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunnerArgument("filter", "" + "com.otaliastudios.cameraview.tools.SdkExcludeFilter," + @@ -28,17 +28,17 @@ dependencies { testImplementation("junit:junit:4.13") testImplementation("org.mockito:mockito-inline:2.28.2") - androidTestImplementation("androidx.test:runner:1.3.0") - androidTestImplementation("androidx.test:rules:1.3.0") - androidTestImplementation("androidx.test.ext:junit:1.1.2") + androidTestImplementation("androidx.test:runner:1.4.0") + androidTestImplementation("androidx.test:rules:1.4.0") + androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("org.mockito:mockito-android:2.28.2") - androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0") + androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") api("androidx.exifinterface:exifinterface:1.3.2") - api("androidx.lifecycle:lifecycle-common:2.2.0") - api("com.google.android.gms:play-services-tasks:17.2.0") - implementation("androidx.annotation:annotation:1.1.0") - implementation("com.otaliastudios.opengl:egloo:0.5.3") + api("androidx.lifecycle:lifecycle-common:2.3.1") + api("com.google.android.gms:play-services-tasks:17.2.1") + implementation("androidx.annotation:annotation:1.2.0") + implementation("com.otaliastudios.opengl:egloo:0.6.1") } // Publishing @@ -51,15 +51,25 @@ publisher { project.group = "com.otaliastudios" project.url = "https://github.com/natario1/CameraView" project.addLicense(License.APACHE_2_0) - bintray { - release.sources = Release.SOURCES_AUTO - release.docs = Release.DOCS_AUTO - auth.user = "BINTRAY_USER" - auth.key = "BINTRAY_KEY" - auth.repo = "BINTRAY_REPO" + release.sources = Release.SOURCES_AUTO + release.docs = Release.DOCS_AUTO + + directory() + + sonatype { + auth.user = "SONATYPE_USER" + auth.password = "SONATYPE_PASSWORD" + signing.key = "SIGNING_KEY" + signing.password = "SIGNING_PASSWORD" } - directory { - directory = file(repositories.mavenLocal().url).absolutePath + + sonatype("snapshot") { + repository = io.deepmedia.tools.publisher.sonatype.Sonatype.OSSRH_SNAPSHOT_1 + release.version = "latest-SNAPSHOT" + auth.user = "SONATYPE_USER" + auth.password = "SONATYPE_PASSWORD" + signing.key = "SIGNING_KEY" + signing.password = "SIGNING_PASSWORD" } } diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java index 041dcc44..0f14f0ec 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java @@ -590,9 +590,15 @@ public class Camera2Engine extends CameraBaseEngine implements @Override public void onConfigureFailed(@NonNull CameraCaptureSession session) { - // This SHOULD be a library error so we throw a RuntimeException. String message = LOG.e("onConfigureFailed! Session", session); - throw new RuntimeException(message); + Throwable cause = new RuntimeException(message); + if (!task.getTask().isComplete()) { + task.trySetException(new CameraException(cause, + CameraException.REASON_FAILED_TO_START_PREVIEW)); + } else { + // Like onStartEngine.onError + throw new CameraException(CameraException.REASON_DISCONNECTED); + } } @Override diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index ece186ac..bb93390f 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -18,6 +18,6 @@ android { dependencies { implementation(project(":cameraview")) - implementation("androidx.appcompat:appcompat:1.2.0") - implementation("com.google.android.material:material:1.2.0") + implementation("androidx.appcompat:appcompat:1.3.0") + implementation("com.google.android.material:material:1.4.0") } diff --git a/docs/_about/changelog.md b/docs/_about/changelog.md index 859313c9..fc8c0585 100644 --- a/docs/_about/changelog.md +++ b/docs/_about/changelog.md @@ -9,6 +9,15 @@ New versions are released through GitHub, so the reference page is the [GitHub R > Starting from 2.4.0, you can now [support development](https://github.com/sponsors/natario1) through the GitHub Sponsors program. Companies can share a tiny part of their revenue and get private support hours in return. Thanks! +##### v2.7.1 + +- Fix: fix preview issues on Pixel 4A with certain FPS, thanks to [@honzasmuk][honzasmuk] ([#1089][1089]) +- Improvement: don't catch gestures if they're turned off, thanks to [@ObsidianX][ObsidianX] ([#1068][1068]) +- New: new flag cameraDrawHardwareOverlays and setDrawHardwareOverlays() to draw overlays on hardware canvas, thanks to [@ObsidianX][ObsidianX] ([#1066][1066]) +- Publish on Maven Central instead of JCenter + + + ##### v2.7.0 - New: onPictureShutter() callback when taking pictures, thanks to [@EzequielAdrianM][EzequielAdrianM] ([#1030][1030]) @@ -359,6 +368,8 @@ This is the last release before v2. [jeffreyfjohnson]: https://github.com/jeffreyfjohnson [michaelspecht]: https://github.com/michaelspecht [EzequielAdrianM]: https://github.com/EzequielAdrianM +[honzasmuk]: https://github.com/honzasmuk +[ObsidianX]: https://github.com/ObsidianX [73]: https://github.com/natario1/CameraView/pull/73 @@ -462,3 +473,6 @@ This is the last release before v2. [1020]: https://github.com/natario1/CameraView/pull/1020 [1024]: https://github.com/natario1/CameraView/pull/1024 [1030]: https://github.com/natario1/CameraView/pull/1030 +[1089]: https://github.com/natario1/CameraView/pull/1089 +[1068]: https://github.com/natario1/CameraView/pull/1068 +[1066]: https://github.com/natario1/CameraView/pull/1066 diff --git a/docs/_about/faq.md b/docs/_about/faq.md index 72daf34e..08800f70 100644 --- a/docs/_about/faq.md +++ b/docs/_about/faq.md @@ -87,7 +87,7 @@ and maintainers have had time to execute and publish the release. You can speed [sponsoring the project](../extra/donate) or pull snapshots from [jitpack.io](https://jitpack.io): ```groovy -implementation 'com.github.natario1:CameraView:master-SNAPSHOT' +implementation 'com.github.natario1:CameraView:main-SNAPSHOT' implementation 'com.github.natario1:CameraView:' ``` diff --git a/docs/_about/install.md b/docs/_about/install.md index d653a721..00bc560e 100644 --- a/docs/_about/install.md +++ b/docs/_about/install.md @@ -7,13 +7,13 @@ order: 1 The library works on API 15+, which is the only requirement and should be met by most projects nowadays. -It is publicly hosted on [JCenter](https://bintray.com/natario/android/CameraView), where you -can download the AAR package. To fetch with Gradle, make sure you add the JCenter repository in your root projects `build.gradle` file: +It is publicly hosted on [Maven Central](https://repo.maven.apache.org/maven2/com/otaliastudios/cameraview), where you +can download the AAR package. To fetch with Gradle, make sure you add the Maven Central repository in your root projects `build.gradle` file: ```groovy allprojects { repositories { - jcenter() + mavenCentral() } } ``` diff --git a/docs/_config.yml b/docs/_config.yml index 17f87a18..c54b6615 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -12,8 +12,8 @@ google_analytics_id: 'UA-155077779-1' google_site_verification: '4x49i17ABIrSvUl52SeL0-t0341aTnWWaC62-FYCRT4' github: [metadata] # TODO What's this? github_repo: CameraView -github_version: 2.7.0 -github_branch: master +github_version: 2.7.1 +github_branch: main baseurl: '/CameraView' # Keep as an empty string if served up at the root collections: about: diff --git a/docs/_extra/contributing.md b/docs/_extra/contributing.md index db2cf651..346ec94a 100644 --- a/docs/_extra/contributing.md +++ b/docs/_extra/contributing.md @@ -48,4 +48,4 @@ and [Google's CameraView](https://github.com/google/cameraview), but has been co CameraKit's source code is licensed under the [MIT](https://github.com/wonderkiln/CameraKit-Android/blob/master/LICENSE) license. -CameraView is licensed under the [MIT](https://github.com/natario1/CameraView/blob/master/LICENSE) license as well. +CameraView is licensed under the [MIT](https://github.com/natario1/CameraView/blob/main/LICENSE) license as well. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6c82b158..6ce64c26 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip