Best-practices infrastructure for starting your next Android app, fast. 🔥
Kindling is boilerplate for your next app with full support for the Gradle Kotlin DSL, Dagger 2, multi-module builds, and CI.
Minimally opinionated, it provides:
@formatter:on
and @formatter:off
tagsIt does not provide:
dev.petedoyle.starter
)versionCode
management - for CI buildsmaster
master
to Google PlayDecide on your app’s repo name (e.g. myapp
)
$ KINDLING_REPO_NAME=myapp
Create your new repo:
$ git clone https://github.com/petedoyle/kindling.git $KINDLING_REPO_NAME && \
cd $KINDLING_REPO_NAME && \
AS_VERSION="$(git rev-parse --abbrev-ref HEAD)@$(git rev-parse --short HEAD)" && \
rm -rf .git && \
git init && \
git add . && \
git commit -m "Create new project from github.com/petedoyle/kindling ($AS_VERSION)" && \
unset KINDLING_REPO_NAME
Open myapp/build.gradle.kts
in Android Studio. Or, if you’ve installed the command line launcher:
$ studio build.gradle.kts
That’s it! You’re ready to dev! 🔥
MainActivity
to see the sample activity. Note the package: dev.petedoyle.starter.feature.main
.MainModule
to see how MainActivity
‘s dependencies can be provided. The lifetime of MainModule
‘s object graph is scoped to MainActivity
(because @ContributesAndroidInjector
in ActivityBindingModule
created a Dagger Subcomponent
under the hood, scoped to MainActivity
).AppModule
to see how app-wide dependencies can be provided.buildSrc/src/main/java/Dependencies.kt
for declaring libraries and their versions.See app/build.gradle
to see how to consume libraries, e.g.
implementation(Deps.androidx_appcompat)
daggerutil/build.gradle.kts
to see how to set up a module’s build script.build.gradle.kts
refer to Deps.[name]
, thus allowing you to update dependency versions across many gradle modules at once.
Copyright 2019 Pete Doyle
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.