Skip to content

Commit d569577

Browse files
authored
feat: apply convention plugins (#7)
1 parent 68b06f0 commit d569577

28 files changed

Lines changed: 386 additions & 437 deletions

.editorconfig

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
root = true
22

33
[*.{kt,kts}]
4-
disabled_rules = filename
5-
max_line_length = off
6-
insert_final_newline = true
7-
ij_kotlin_name_count_to_use_star_import = 999
8-
ij_kotlin_name_count_to_use_star_import_for_members = 999
94
ij_java_class_count_to_use_import_on_demand = 999
105
ij_kotlin_allow_trailing_comma = true
116
ij_kotlin_allow_trailing_comma_on_call_site = true
7+
ij_kotlin_name_count_to_use_star_import = 999
8+
ij_kotlin_name_count_to_use_star_import_for_members = 999
9+
insert_final_newline = true
10+
max_line_length = off
11+
12+
ktlint_code_style = intellij_idea
13+
ktlint_function_naming_ignore_when_annotated_with = Composable
14+
ktlint_standard_filename = disabled

.github/workflows/commit.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ on: [ push, workflow_dispatch ]
55
jobs:
66
semantic_library_workflow:
77
name: push
8-
uses: krogerco/Shared-CI-Workflow-Android/.github/workflows/semantic_library_workflow.yml@v1.0.0
8+
uses: krogerco/Shared-CI-Workflow-Android/.github/workflows/semantic_library_workflow.yml@v1.3.0
9+
with:
10+
java_version: '17'
11+
ktlint_version: '-1'
12+
test_command: 'test'
913
secrets:
1014
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
1115
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}

.husky/_/husky.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.husky/commit-msg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx --no-install commitlint --edit
1+
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
1+
### AUTOGENERATED KGP KOTLINTER HOOK START - DO NOT MODIFY ###
2+
staged_files="$(git --no-pager diff --name-status --no-color --staged | awk '$1 != "D" && $NF ~ /\.kts|\.kt/ { print $NF }')"
3+
if [ -z "$staged_files" ]; then
4+
echo "No Kotlin files are staged."
5+
exit 0
6+
fi;
37

4-
ktlint "**/src/**/*.kt" "!**/generated/**" --android --reporter=plain?group_by_file
8+
echo "Running ktlint on the following staged files:"
9+
echo "$staged_files"
10+
11+
auto_format_files=false
12+
if [ "$auto_format_files" = true ] ; then
13+
echo "auto-formatting staged files..."
14+
./gradlew formatKotlinFiles -Pfiles="$staged_files"
15+
fi
16+
17+
if ! ./gradlew checkKotlinFiles -Pfiles="$staged_files"; then
18+
echo "pre-commit hook: Some files are either not properly formatted or could not be auto-formatted. Aborting commit."
19+
exit 1
20+
else
21+
# Re-index any files that may have been corrected before committing
22+
echo "$staged_files" | xargs git add
23+
exit_code=0
24+
fi
25+
### AUTOGENERATED KGP KOTLINTER HOOK END ###

CHANGELOG.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,15 @@
33
All notable changes to this project will be documented in this file.
44
`Cache-Android` adheres to [Semantic Versioning](https://semver.org/).
55

6-
## main
7-
8-
### Added
9-
10-
### Breaking Changes
11-
12-
### Updated
13-
14-
### Fixed
15-
6+
## 3.1.0
7+
- [feat] use kotlin 1.9.23
8+
- [fix] remove kotlin serialization dependencies from android module
9+
- [build] use convention plugins
10+
- [chore] update sample app dependencies
11+
## 3.0.0
12+
- [feat!] renamed `CacheSerializer.decodeFromString(...)` to `CacheSerializer.decodeFromByteArray(...)`
13+
- [feat] add moshi serialization implementation module
14+
## 2.0.0
15+
- [feat!] abstract serialization and add kotlin serialization implementation module
1616
## 1.0.0
17-
18-
### Added
19-
2017
- Initial open source release.

android/build.gradle.kts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.kroger.gradle.config.junitVintage
2+
13
/**
24
* MIT License
35
*
@@ -22,25 +24,27 @@
2224
* SOFTWARE.
2325
*/
2426
plugins {
25-
`android-library-module`
26-
`release-module`
27+
alias(libs.plugins.conventions.publishedAndroidLibrary)
2728
}
2829

2930
android {
3031
namespace = "com.kroger.cache.android"
3132
}
3233

34+
koverReport {
35+
defaults {
36+
mergeWith("debug")
37+
}
38+
}
39+
3340
dependencies {
3441
api(project(":cache"))
35-
api(libs.kotlinx.serialization.core)
36-
implementation(libs.kotlinx.serialization.json)
3742
implementation(libs.kotlinx.coroutines)
3843

44+
junitVintage()
3945
testImplementation(project(":kotlinx"))
40-
testImplementation(libs.jupiter.api)
4146
testImplementation(libs.mockk)
4247
testImplementation(libs.truth)
43-
testRuntimeOnly(libs.jupiter.engine)
4448

4549
androidTestImplementation(libs.androidx.test.ext)
4650
androidTestImplementation(libs.androidx.test.rules)

build.gradle.kts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import com.kroger.gradle.config.koverAllProjects
2+
13
/**
24
* MIT License
35
*
@@ -22,12 +24,31 @@
2224
* SOFTWARE.
2325
*/
2426
plugins {
25-
id("org.jetbrains.dokka")
26-
id("com.google.devtools.ksp") version "1.7.20-1.0.8" apply false
27+
alias(libs.plugins.android.application) apply false
28+
alias(libs.plugins.android.junit5) apply false
29+
alias(libs.plugins.conventions.androidApplication) apply false
30+
alias(libs.plugins.conventions.publishedAndroidLibrary) apply false
31+
alias(libs.plugins.conventions.publishedKotlinLibrary) apply false
32+
alias(libs.plugins.conventions.root)
33+
alias(libs.plugins.dependencyAnalysis) apply false
34+
alias(libs.plugins.dokka)
35+
alias(libs.plugins.gradleVersions) apply false
36+
alias(libs.plugins.hilt) apply false
37+
alias(libs.plugins.kapt) apply false
38+
alias(libs.plugins.kotlinter) apply false
39+
alias(libs.plugins.kover) apply true
40+
alias(libs.plugins.ksp) apply false
41+
alias(libs.plugins.mavenPublish) apply false
2742
}
2843

29-
tasks {
30-
register("clean", Delete::class) {
31-
delete(rootProject.buildDir)
44+
koverReport {
45+
filters {
46+
excludes {
47+
packages("com.kroger.cache.sampleapp")
48+
}
3249
}
3350
}
51+
52+
dependencies {
53+
koverAllProjects(rootProject)
54+
}

buildSrc/build.gradle.kts

Lines changed: 0 additions & 13 deletions
This file was deleted.

buildSrc/settings.gradle.kts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)