This is the sample continuous integrated project for Android (Kotlin).
- Lint
- ktlint
- detekt
- Android Lint
- Build: Configured build setting. e.g.
signingConfigs,buildTypes - CircleCI: Lint, Test, and Build in CircleCI.
- PR Comment by Danger: Danger configuration is included. Lint error comes as PR comment.
- Setup CircleCI build.
- Turn "On" "Only build pull requests".
- Copy or refer to below files. diff
.circleci/config.ymlDangerfileGemfileGemfile.lock: If you want newer version, please execbundle update.build.gradledetekt.yml: Please create default config by./gradlew detektGenerateConfigapp/build.gradleapp/keystores/debug.keystore: Please get from local.app/keystores/release.jks: Please get or create.
- Set environment variable.
DANGER_GITHUB_API_TOKEN: token for check botANDROID_KEYSTORE_PASSWORD: password for release keystoreANDROID_KEYSTORE_ALIAS: alias for release keystoreANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD: alias's password for release keystore
I think, 2 tools check different points.
ktlintfocus code style. (e.g. position of whitespace, naming rule.)detektfocus code smell. (e.g. condition is too complex, equals is implemented by hashCode is not.)
We have monstar-lab/gradle-android-ci-check.
We need to improve that for kotlin setting.
But, currently, ktlint and detekt is developing very rapidly.
So some interfaces may be changes.
So now, configure in build.gradle directly.
(In the future, we need improve monstar-lab/gradle-android-ci-check.)
This repository is targeting for very simple project.
But in real world, we need to work for complex project.
We have some advice for customizing configuration in Wiki. Please refer to it.