Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.46 KB

README.md

File metadata and controls

65 lines (46 loc) · 2.46 KB

Sample for Android (Kotlin)

CircleCI

This is the sample continuous integrated project for Android (Kotlin).

What is this repository?

  • 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.

How to setup

  1. Setup CircleCI build.
    • Turn "On" "Only build pull requests".
  2. Copy or refer to below files. diff
    • .circleci/config.yml
    • Dangerfile
    • Gemfile
    • Gemfile.lock : If you want newer version, please exec bundle update.
    • build.gradle
    • detekt.yml : Please create default config by ./gradlew detektGenerateConfig
    • app/build.gradle
    • app/keystores/debug.keystore : Please get from local.
    • app/keystores/release.jks : Please get or create.
  3. Set environment variable.
    • DANGER_GITHUB_API_TOKEN : token for check bot
    • ANDROID_KEYSTORE_PASSWORD : password for release keystore
    • ANDROID_KEYSTORE_ALIAS : alias for release keystore
    • ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD : alias's password for release keystore

Memo

Why integrate both of ktlint and detekt?

I think, 2 tools check different points.

  • ktlint focus code style. (e.g. position of whitespace, naming rule.)
  • detekt focus code smell. (e.g. condition is too complex, equals is implemented by hashCode is not.)

Why configure ktlint and detekt in build.gradle directly?

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.)

Customize

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.