-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
165 changed files
with
940 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
root=true | ||
|
||
[*.{kt,kts}] | ||
# possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely) | ||
indent_size=2 | ||
# true (recommended) / false | ||
# insert_final_newline=true | ||
# possible values: number (e.g. 120) (package name, imports & comments are ignored), "off" | ||
# it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide) | ||
charset=utf-8 | ||
end_of_line=lf | ||
insert_final_newline=false | ||
|
||
max_line_length=120 | ||
|
||
indent_size=2 | ||
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 | ||
# Comma-separated list of rules to disable (Since 0.34.0) | ||
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed | ||
# by the ruleset identifier. | ||
# Note that rules in any ruleset other than the standard ruleset will need to be prefixed by the ruleset identifier. | ||
# noinspection EditorConfigKeyCorrectness | ||
disabled_rules=final-newline | ||
# Defines the imports layout. There are predefined layouts like "ascii" or "idea", as well as a custom layout. | ||
# noinspection EditorConfigKeyCorrectness | ||
kotlin_imports_layout=idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Allow usage of AndroidX instead of the old support libraries. | ||
android.useAndroidX=true | ||
# Set the build VMs heap size. | ||
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
# AndroidX package structure to make it clearer which packages are bundled with the | ||
# Android operating system, and which are packaged with your app"s APK | ||
android.useAndroidX=true | ||
# Disable publishing SHA256 and SHA512 checksums. | ||
systemProp.org.gradle.internal.publish.checksums.insecure=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
plugins { | ||
id(Plugins.Android.library) | ||
kotlin(Plugins.Kotlin.android) | ||
kotlin(Plugins.Kotlin.parcelize) | ||
id(Plugins.Kotlin.android) | ||
id(Plugins.Kotlin.parcelize) | ||
id(Plugins.Kotlin.dokka) version Versions.dokka | ||
`maven-publish` | ||
} | ||
|
||
android { | ||
compileSdkVersion(Config.androidCompileSdkVersion) | ||
defaultConfig { | ||
minSdkVersion(Config.androidMinSdkVersion) | ||
} | ||
resourcePrefix = project.name | ||
buildFeatures { | ||
viewBinding = true | ||
buildConfig = false | ||
|
@@ -25,13 +28,13 @@ android { | |
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
} | ||
flavorDimensions("bundleMode") | ||
flavorDimensions("mlkit") | ||
productFlavors { | ||
create("bundledML") { | ||
dimension("bundleMode") | ||
create("bundled") { | ||
dimension("mlkit") | ||
} | ||
create("unbundledML") { | ||
dimension("bundleMode") | ||
create("unbundled") { | ||
dimension("mlkit") | ||
} | ||
} | ||
} | ||
|
@@ -41,13 +44,14 @@ repositories { | |
mavenCentral() | ||
jcenter { | ||
content { | ||
includeModule("org.jetbrains.trove4j", "trove4j") // required by com.android.tools.lint:lint-gradle | ||
includeGroupByRegex("org\\.jetbrains.*") | ||
includeModule("com.soywiz.korlibs.korte", "korte-jvm") | ||
} | ||
} | ||
} | ||
|
||
val bundledMLImplementation by configurations | ||
val unbundledMLImplementation by configurations | ||
val bundledImplementation by configurations | ||
val unbundledImplementation by configurations | ||
dependencies { | ||
implementation(Deps.AndroidX.activity) | ||
implementation(Deps.AndroidX.fragment) | ||
|
@@ -58,6 +62,94 @@ dependencies { | |
implementation(Deps.AndroidX.cameraLifecycle) | ||
implementation(Deps.AndroidX.cameraPreview) | ||
|
||
bundledMLImplementation(Deps.MLKit.barcodeScanning) | ||
unbundledMLImplementation(Deps.MLKit.barcodeScanningGms) | ||
bundledImplementation(Deps.MLKit.barcodeScanning) | ||
unbundledImplementation(Deps.MLKit.barcodeScanningGms) | ||
} | ||
|
||
group = "com.g00fy2.quickie" | ||
version = "0.1.0" | ||
|
||
tasks.register<Jar>("androidJavadocJar") { | ||
archiveClassifier.set("javadoc") | ||
from("$buildDir/dokka/javadoc") | ||
dependsOn("dokkaJavadoc") | ||
} | ||
|
||
tasks.register<Jar>("androidSourcesJar") { | ||
archiveClassifier.set("sources") | ||
from(android.sourceSets.getByName("main").java.srcDirs) | ||
} | ||
|
||
// JCenter does not support Gradle module metadata | ||
tasks.withType<GenerateModuleMetadata> { | ||
enabled = false | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
// publishBundledReleasePublicationToBintrayQuickieBundledRepository -Pbintray_user=name -Pbintray_key=key | ||
publications { | ||
create<MavenPublication>("bundledRelease") { | ||
from(components["bundledRelease"]) | ||
val libraryName = "quickie-bundled" | ||
artifactId = libraryName | ||
artifact(tasks.named("androidJavadocJar")) | ||
artifact(tasks.named("androidSourcesJar")) | ||
configurePom(libraryName) | ||
} | ||
// publishUnbundledReleasePublicationToBintrayQuickieUnbundledRepository -Pbintray_user=name -Pbintray_key=key | ||
create<MavenPublication>("unbundledRelease") { | ||
from(components["unbundledRelease"]) | ||
val libraryName = "quickie-unbundled" | ||
artifactId = libraryName | ||
artifact(tasks.named("androidJavadocJar")) | ||
artifact(tasks.named("androidSourcesJar")) | ||
configurePom(libraryName) | ||
} | ||
} | ||
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;") | ||
credentials { | ||
username = findProperty("bintray_user") as String? | ||
password = findProperty("bintray_key") as String? | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
fun MavenPublication.configurePom(libraryName: String) { | ||
pom { | ||
name.set(libraryName) | ||
description.set("Android QR code scanner library") | ||
url.set("https://github.com/G00fY2/Quickie") | ||
licenses { | ||
license { | ||
name.set("MIT License") | ||
url.set("https://opensource.org/licenses/MIT") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("g00fy2") | ||
name.set("Thomas Wirth") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
connection.set("https://github.com/G00fY2/Quickie.git") | ||
developerConnection.set("https://github.com/G00fY2/Quickie.git") | ||
url.set("https://github.com/G00fY2/Quickie") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.