Skip to content

Commit

Permalink
Merge branch 'release/1.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
G00fY2 committed Jul 23, 2023
2 parents 883c447 + 9ee26be commit 0a56639
Show file tree
Hide file tree
Showing 15 changed files with 288 additions and 227 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ indent_style=space
ij_kotlin_name_count_to_use_star_import=2147483647
ij_kotlin_name_count_to_use_star_import_for_members=2147483647
ij_kotlin_imports_layout=*,java.**,javax.**,kotlin.**,^
ij_kotlin_line_break_after_multiline_when_entry=false

[*.xml]
ij_continuation_indent_size=4
Expand Down
5 changes: 3 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": [
"config:base"
"config:base",
":disableDependencyDashboard"
],
"baseBranches": [
"develop"
]
}
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ There are two different flavors available on `mavenCentral()`:

```kotlin
// bundled:
implementation("io.github.g00fy2.quickie:quickie-bundled:1.7.0")
implementation("io.github.g00fy2.quickie:quickie-bundled:1.8.0")

// unbundled:
implementation("io.github.g00fy2.quickie:quickie-unbundled:1.7.0")
implementation("io.github.g00fy2.quickie:quickie-unbundled:1.8.0")
```

## Quick Start
Expand Down Expand Up @@ -65,13 +65,13 @@ The activity result is a subclass of the sealed `QRResult` class:

1. `QRSuccess` when ML Kit successfully detected a QR code
* wraps a `QRContent` object
1. `QRUserCanceled` when the Activity got canceled by the user
1. `QRMissingPermission` when the user didn't accept the camera permission
1. `QRError` when CameraX or ML Kit threw an exception
2. `QRUserCanceled` when the Activity got canceled by the user
3. `QRMissingPermission` when the user didn't accept the camera permission
4. `QRError` when CameraX or ML Kit threw an exception
* wraps the `exception`
#### Content
The content type of the QR code detected by ML Kit is wrapped inside a subclass of the sealed `QRContent` class which always provides a `rawValue`.
The content type of the QR code detected by ML Kit is wrapped inside a subclass of the sealed `QRContent` class which always provides a `rawBytes` and `rawValue` (will only be `null` for non-UTF8 barcodes).
Currently, supported subtypes are:
`Plain`, `Wifi`, `Url`, `Sms`, `GeoPoint`, `Email`, `Phone`, `ContactInfo`, `CalendarEvent`
Expand Down
54 changes: 19 additions & 35 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import com.android.build.gradle.BaseExtension
import com.android.build.gradle.BasePlugin
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -11,36 +12,21 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.dokka) apply false
alias(libs.plugins.misc.detekt) apply false
alias(libs.plugins.misc.gradleVersions)
alias(libs.plugins.detekt) apply false
}

subprojects {
apply(plugin = rootProject.libs.plugins.misc.detekt.get().pluginId)
extensions.configure<DetektExtension> {
toolVersion = rootProject.libs.versions.detekt.get()
config = files("$rootDir/detekt.yml")
buildUponDefaultConfig = true
ignoredBuildTypes = listOf("release")
}
dependencies {
add("detektPlugins", rootProject.libs.misc.detektFormatting)
}
tasks.withType<Detekt>().configureEach {
jvmTarget = "11"
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
allWarningsAsErrors.set(true)
freeCompilerArgs.addAll(
listOfNotNull(
"-progressive",
"-Xexplicit-api=strict".takeIf { (this@subprojects.name != "sample") },
)
)
progressiveMode.set(true)
jvmTarget.set(JvmTarget.JVM_11)
}
if ((this@subprojects.name != "sample")) {
explicitApiMode.set(ExplicitApiMode.Strict)
}
}

plugins.withType<BasePlugin>().configureEach {
extensions.configure<BaseExtension> {
compileSdkVersion(libs.versions.androidconfig.compileSdk.get().toInt())
Expand All @@ -55,20 +41,18 @@ subprojects {
}
}
}
}

tasks.dependencyUpdates.configure {
gradleReleaseChannel = "current"

fun releaseType(version: String): Int {
val qualifiers = listOf("alpha", "beta", "m", "rc")
val index = qualifiers.indexOfFirst { version.matches(".*[.\\-]$it[.\\-\\d]*".toRegex(RegexOption.IGNORE_CASE)) }
return if (index < 0) qualifiers.size else index
apply(plugin = rootProject.libs.plugins.detekt.get().pluginId)
extensions.configure<DetektExtension> {
toolVersion = rootProject.libs.versions.detekt.get()
config.setFrom(files("$rootDir/detekt.yml"))
buildUponDefaultConfig = true
ignoredBuildTypes = listOf("release")
}
dependencies {
add("detektPlugins", rootProject.libs.detektFormatting)
}
tasks.withType<Detekt>().configureEach {
jvmTarget = JvmTarget.JVM_11.target
}

rejectVersionIf { releaseType(candidate.version) < releaseType(currentVersion) }
}

tasks.register<Delete>("clean") {
delete(buildDir)
}
22 changes: 11 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
[versions]
quickie = "1.7.0"
quickie = "1.8.0"

androidconfig-minSdk = "21"
androidconfig-compileSdk = "33"
androidconfig-targetSdk = "33"
androidconfig-buildTools = "33.0.2"

androidGradle = "8.0.1"
kotlin = "1.8.21"
androidGradle = "8.0.2"
kotlin = "1.9.0"

appcompat = "1.6.1"
core = "1.10.1"

cameraX = "1.2.2"
cameraX = "1.2.3"

barcodeScanning = "17.1.0"
barcodeScanningGms = "18.2.0"

materialDesign = "1.9.0"

detekt = "1.22.0"
gradleVersions = "0.46.0"
dokka = "1.8.10"
detekt = "1.23.0"
dokka = "1.8.20"

junit = "5.9.3"
junit = "5.10.0"

[libraries]
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-camera = { module = "androidx.camera:camera-camera2", version.ref = "cameraX" }
androidx-cameraLifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "cameraX" }
androidx-cameraPreview = { module = "androidx.camera:camera-view", version.ref = "cameraX" }
androidx-core = { module = "androidx.core:core-ktx", version.ref = "core" }

mlkit-barcodeScanning = { module = "com.google.mlkit:barcode-scanning", version.ref = "barcodeScanning" }
mlkit-barcodeScanningGms = { module = "com.google.android.gms:play-services-mlkit-barcode-scanning", version.ref = "barcodeScanningGms" }
Expand All @@ -38,7 +39,7 @@ google-materialDesign = { module = "com.google.android.material:material", versi
test-junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
test-junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }

misc-detektFormatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detektFormatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradle" }
Expand All @@ -48,5 +49,4 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }

misc-detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
misc-gradleVersions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersions" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
Loading

0 comments on commit 0a56639

Please sign in to comment.