Simplifying Android Module Creation: Enter the Module Maker Plugin
We've all been there. It's another day in the Android Studio jungle, and you're tasked with creating a new module for your project. As you fire up the built-in New Module wizard in Android Studio, you're hit with a sense of dread. Isn't there a better way?
While the default New Module wizard does its job, it often falls short when aligning with specific project standards. It doesn't allow for much customization, leading to tedious and time-consuming manual adjustments. But, fret not! There's a new player in town, ready to streamline your module creation - introducing the Module Maker plugin.
Meet the Module Maker Plugin
The Module Maker plugin for Android Studio is an IntelliJ / Android Studio plugin for those looking to tailor their new modules to their project-specific standards. The plugin extends beyond the limitations of Android Studio's built-in tools, allowing for a more streamlined and customizable module creation experience.
Let's take a look at some of the unique features that make this plugin a must-have in your development toolkit.
3 Module Creation Structure: Following the structure highlighted in this talk from Ralf Wondratschek at Square, the plugin allows you to create three modules at a time with customizable names. By default, the three module structure is composed of an API, Glue, and Impl module, helping you maintain cleaner and more manageable codebases.
Kotlin and Groovy Build Files: You can choose to have build files for each module generated as either Kotlin or Groovy. This flexibility ensures you can stick with your preferred language and keep your project's standards consistent.
Customizable Build File Names: Either stick with the default name (
build.gradle.kts) or have your build file name follow the module. Tailoring the build file names to the module can help streamline the identification process and improve project organization.
Optional README and .gitignore Files: Upon creating your modules, the plugin can generate an optional README and .gitignore file, helping you jumpstart your module documentation and version control settings.
Android or JVM Only Module: Whether your module is meant for Android or just JVM, the plugin has got you covered.
Package Structure Specification: Specify your package structure and have the folders created directly on the filesystem, eliminating the need for manual creation and organization.
Automatic Settings Update and Sync: Once your new modules are ready, the plugin automatically adds them to your settings.gradle(.kts) file and syncs your project, sparing you the hassle of manual updates and syncs.
Customize Modules to Your Heart's Content
The Module Maker plugin understands that every project is unique, and therefore, it offers a robust settings page where you can specify a range of options to suit your project's specific needs. You can:
Specify different Android and JVM build file templates.
Define different API, Glue, and Impl build file templates.
Customize API, Glue, and Impl module names.
Specify a custom .gitignore template.
Specify a default package name to persist across usages of the plugin
The Wrap Up
In the dynamic landscape of Android development, maintaining a consistent and efficient project structure can often be challenging. The built-in New Module wizard, while helpful, may not always align with your project's specific standards. This is where the Module Maker plugin comes in - designed as a practical solution to enhance your module creation process.
With a wide range of features, from allowing a 3-module creation structure to offering customization options for your build files, the Module Maker plugin equips you with the tools to tailor your project to your preferences. Its ability to generate optional README and .gitignore files, automatic project sync, and customizable settings, all work towards a more streamlined and personalized Android project setup.
As the author of the Module Maker plugin, I aimed to provide a tool that could simplify and adapt to the unique needs of each Android project. I hope you find this plugin helpful and that it can assist in enhancing your workflow, saving time, and maintaining project consistency. After all, development should be more about solving complex problems and less about wrestling with project setup and organization.