Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Mar 24, 2021
2 parents 7234bf0 + ba4e889 commit 7fab115
Show file tree
Hide file tree
Showing 24 changed files with 148 additions and 154 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ indent_style=space
# TODO remove .idea/codeStyles from vcs when https://youtrack.jetbrains.com/issue/KTIJ-165 is fixed
ij_kotlin_name_count_to_use_star_import=2147483647
ij_kotlin_name_count_to_use_star_import_for_members=2147483647

# ktlint
# noinspection EditorConfigKeyCorrectness
kotlin_imports_layout=idea
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
- Android Jetpack CameraX for communicating with the camera and showing the preview
- ML Kit Vision API for best, fully on-device barcode recognition and decoding

## Download [![Download](https://img.shields.io/maven-metadata/v?label=quickie-bundled&metadataUrl=https%3A%2F%2Fbintray.com%2Fg00fy2%2Fmaven%2Fdownload_file%3Ffile_path%3Dcom%252Fg00fy2%252Fquickie%252Fquickie-unbundled%252Fmaven-metadata.xml)](https://bintray.com/g00fy2/maven/quickie-bundled) [![Download](https://img.shields.io/maven-metadata/v?label=quickie-unbundled&metadataUrl=https%3A%2F%2Fbintray.com%2Fg00fy2%2Fmaven%2Fdownload_file%3Ffile_path%3Dcom%252Fg00fy2%252Fquickie%252Fquickie-bundled%252Fmaven-metadata.xml)](https://bintray.com/g00fy2/maven/quickie-unbundled)
There are two different flavors available on `jcenter()` (I'm planing to move to *mavenCentral()* soon):
## Download [![Maven Central](https://img.shields.io/maven-central/v/io.github.g00fy2.quickie/quickie-unbundled)](https://search.maven.org/search?q=g:io.github.g00fy2.quickie)
There are two different flavors available on `mavenCentral()`:

| Bundled | Unbundled |
| ----------------------------------- | ------------------------------------------------- |
| ML Kit model is bundled inside app (independent of Google Services) | ML Kit model will be automatically downloaded via Play Services (after app install) |
| additional 1.1 MB size per ABI (you should use AAB or ABI splitting) | smaller app size |
| V2 barcode model is used (possibly faster, more accurate) | currently V1 will be downloaded
| additional 1.1 MB per ABI (you should use App Bundle or ABI splitting) | smaller app size |
| V2 model is used (possibly faster, more accurate) | currently V1 model will be downloaded
```kotlin
// bundled:
implementation("com.g00fy2.quickie:quickie-bundled:0.6.1")
implementation("io.github.g00fy2.quickie:quickie-bundled:0.7.0")

// unbundled:
implementation("com.g00fy2.quickie:quickie-unbundled:0.6.1")
implementation("io.github.g00fy2.quickie:quickie-unbundled:0.7.0")
```

## Quick Start
Expand Down Expand Up @@ -73,7 +73,7 @@ You can find the sample app APKs inside the [release](https://github.com/G00fY2/
* A release candidate is a prospective stable release.
* It may contain critical last-minute fixes.
Even though **quickie** is battle-tested you should consider this library to be in pre-release state too. This will change once the dependent libraries hit stable.
Even though **quickie** is battle-tested (used in apps with 500k+ users) you should consider this library to be in pre-release state too. This will change once the dependent libraries hit stable.
## Requirements
* AndroidX
Expand Down
7 changes: 3 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.android.build.gradle.BaseExtension
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -19,8 +18,8 @@ subprojects {
kotlinOptions {
allWarningsAsErrors = true
val arguments = mutableListOf("-progressive")
if (!this@subprojects.name.contains("sample")) arguments += "-Xexplicit-api=strict"
freeCompilerArgs = arguments
if (this@subprojects.name != "sample") arguments += "-Xexplicit-api=strict"
freeCompilerArgs = freeCompilerArgs + arguments
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
Expand All @@ -34,7 +33,7 @@ subprojects {
}
}

tasks.named("dependencyUpdates", DependencyUpdatesTask::class.java).configure {
tasks.dependencyUpdates.configure {
gradleReleaseChannel = "current"
rejectVersionIf { Versions.maturityLevel(candidate.version) < Versions.maturityLevel(currentVersion) }
}
Expand Down
16 changes: 8 additions & 8 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ object Versions {
const val androidTargetSdk = 30
const val androidBuildTools = "30.0.3"

const val androidGradle = "4.1.2"
const val kotlin = "1.4.31"
const val androidGradle = "4.1.3"
const val kotlin = "1.4.32"

const val activity = "1.2.0"
const val fragment = "1.3.0"
const val activity = "1.2.1"
const val fragment = "1.3.1"
const val appcompat = "1.2.0"
const val core = "1.3.2"

Expand All @@ -22,12 +22,12 @@ object Versions {
const val barcodeScanningGms = "16.1.4"

const val ktlintPlugin = "10.0.0"
const val ktlint = "0.40.0"
const val gradleVersions = "0.36.0"
const val dokka = "1.4.20"
const val ktlint = "0.41.0"
const val gradleVersions = "0.38.0"
const val dokka = "1.4.30"

fun maturityLevel(version: String): Int {
val levels = listOf("alpha", "beta", "rc")
val levels = listOf("alpha", "beta", "m", "rc")
levels.forEachIndexed { index, s ->
if (version.matches(".*[.\\-]$s[.\\-\\d]*".toRegex(RegexOption.IGNORE_CASE))) return index
}
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ android.useAndroidX=true
# Use R8 in full mode instead of ProGuard compatibility mode.
android.enableR8.fullMode=true
# Set the build VMs heap size.
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Disable publishing SHA256 and SHA512 checksums.
systemProp.org.gradle.internal.publish.checksums.insecure=true
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
43 changes: 21 additions & 22 deletions quickie/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id(Plugins.Kotlin.parcelize)
id(Plugins.Kotlin.dokka) version Versions.dokka
`maven-publish`
signing
}

android {
Expand Down Expand Up @@ -32,7 +33,6 @@ repositories {
jcenter {
content {
includeGroupByRegex("org\\.jetbrains.*")
includeModule("com.soywiz.korlibs.korte", "korte-jvm")
}
}
}
Expand All @@ -53,8 +53,8 @@ dependencies {
unbundledImplementation(Deps.MLKit.barcodeScanningGms)
}

group = "com.g00fy2.quickie"
version = "0.6.1"
group = "io.github.g00fy2.quickie"
version = "0.7.0"

tasks.register<Jar>("androidJavadocJar") {
archiveClassifier.set("javadoc")
Expand All @@ -67,15 +67,9 @@ tasks.register<Jar>("androidSourcesJar") {
from(android.sourceSets.getByName("main").java.srcDirs)
}

// JCenter does not support Gradle module metadata
tasks.withType<GenerateModuleMetadata> {
enabled = false
}

afterEvaluate {
publishing {
publications {
// publishBundledReleasePublicationToBintrayQuickieBundledRepository -Pbintray_user=name -Pbintray_key=key
create<MavenPublication>("bundledRelease") {
from(components["bundledRelease"])
val libraryName = "quickie-bundled"
Expand All @@ -84,7 +78,6 @@ afterEvaluate {
artifact(tasks.named("androidSourcesJar"))
configurePom(libraryName)
}
// publishUnbundledReleasePublicationToBintrayQuickieUnbundledRepository -Pbintray_user=name -Pbintray_key=key
create<MavenPublication>("unbundledRelease") {
from(components["unbundledRelease"])
val libraryName = "quickie-unbundled"
Expand All @@ -96,25 +89,24 @@ afterEvaluate {
}
repositories {
maven {
name = "bintrayQuickieBundled"
url = uri("https://api.bintray.com/maven/g00fy2/maven/quickie-bundled/;publish=1;")
credentials {
username = findProperty("bintray_user") as String?
password = findProperty("bintray_key") as String?
}
}
maven {
name = "bintrayQuickieUnbundled"
url = uri("https://api.bintray.com/maven/g00fy2/maven/quickie-unbundled/;publish=1;")
name = "sonatype"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = findProperty("bintray_user") as String?
password = findProperty("bintray_key") as String?
username = project.findStringProperty("sonatypeUsername")
password = project.findStringProperty("sonatypePassword")
}
}
}
}
}

signing {
project.findStringProperty("signing.keyId")
project.findStringProperty("signing.password")
project.findStringProperty("signing.secretKeyRingFile")
sign(publishing.publications)
}

fun MavenPublication.configurePom(libraryName: String) {
pom {
name.set(libraryName)
Expand All @@ -139,4 +131,11 @@ fun MavenPublication.configurePom(libraryName: String) {
url.set("https://github.com/G00fY2/Quickie")
}
}
}

fun Project.findStringProperty(propertyName: String): String? {
return findProperty(propertyName) as String? ?: {
logger.error("$propertyName missing in gradle.properties")
null
}()
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.g00fy2.quickie.utils
package io.github.g00fy2.quickie.utils

import android.app.Activity

Expand Down
2 changes: 1 addition & 1 deletion quickie/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.g00fy2.quickie">
package="io.github.g00fy2.quickie">

<uses-feature android:name="android.hardware.camera"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.g00fy2.quickie
package io.github.g00fy2.quickie

import androidx.camera.core.ExperimentalGetImage
import androidx.camera.core.ImageAnalysis
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.g00fy2.quickie
package io.github.g00fy2.quickie

import android.content.Context
import android.graphics.Bitmap
Expand All @@ -16,7 +16,7 @@ import android.view.View
import android.widget.FrameLayout
import androidx.appcompat.widget.AppCompatTextView
import androidx.core.content.ContextCompat
import com.g00fy2.quickie.databinding.QuickieTextviewBinding
import io.github.g00fy2.quickie.databinding.QuickieTextviewBinding
import kotlin.math.min
import kotlin.math.roundToInt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.g00fy2.quickie
package io.github.g00fy2.quickie

import com.g00fy2.quickie.content.QRContent
import io.github.g00fy2.quickie.content.QRContent

public sealed class QRResult {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.g00fy2.quickie
package io.github.g00fy2.quickie

import android.Manifest
import android.app.Activity
Expand All @@ -19,10 +19,10 @@ import androidx.camera.core.Preview
import androidx.camera.lifecycle.ProcessCameraProvider
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import com.g00fy2.quickie.databinding.QuickieScannerActivityBinding
import com.g00fy2.quickie.extensions.toParcelableContentType
import com.g00fy2.quickie.utils.PlayServicesValidator
import com.google.mlkit.vision.barcode.Barcode
import io.github.g00fy2.quickie.databinding.QuickieScannerActivityBinding
import io.github.g00fy2.quickie.extensions.toParcelableContentType
import io.github.g00fy2.quickie.utils.PlayServicesValidator
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.g00fy2.quickie
package io.github.g00fy2.quickie

import android.app.Activity.RESULT_CANCELED
import android.app.Activity.RESULT_OK
import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContract
import com.g00fy2.quickie.QRResult.QRError
import com.g00fy2.quickie.QRResult.QRMissingPermission
import com.g00fy2.quickie.QRResult.QRSuccess
import com.g00fy2.quickie.QRResult.QRUserCanceled
import com.g00fy2.quickie.QRScannerActivity.Companion.RESULT_ERROR
import com.g00fy2.quickie.QRScannerActivity.Companion.RESULT_MISSING_PERMISSION
import com.g00fy2.quickie.extensions.getRootException
import com.g00fy2.quickie.extensions.toQuickieContentType
import io.github.g00fy2.quickie.QRResult.QRError
import io.github.g00fy2.quickie.QRResult.QRMissingPermission
import io.github.g00fy2.quickie.QRResult.QRSuccess
import io.github.g00fy2.quickie.QRResult.QRUserCanceled
import io.github.g00fy2.quickie.QRScannerActivity.Companion.RESULT_ERROR
import io.github.g00fy2.quickie.QRScannerActivity.Companion.RESULT_MISSING_PERMISSION
import io.github.g00fy2.quickie.extensions.getRootException
import io.github.g00fy2.quickie.extensions.toQuickieContentType

public class ScanQRCode : ActivityResultContract<Nothing?, QRResult>() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.g00fy2.quickie.content
package io.github.g00fy2.quickie.content

import android.os.Parcelable
import kotlinx.parcelize.Parcelize
Expand Down
Loading

0 comments on commit 7fab115

Please sign in to comment.