/Android-MVVM-Boilerplate-Creater

A script that automates the tedious task of creating basic android files with the packages and imports for MVVM architecture.

Primary LanguageShellMIT LicenseMIT

Hey there!

Android MVVM Boilerplate Creater Logo

Android MVVM Boilerplate Creater

A script that creates the files and codes in them for android MVVM architecture in kotlin.

Android-MVVM-Boilerplate-Creater - behind the scenes

Features

  • Type command > Enter > Done. (it's that fast)
  • Each layer in different package.
  • Generates basic utility package too.
  • Packages with all the basic codes in Kotlin.
  • Contains imports for all the files created.
  • Uses Retrofit2, Dagger2 and Lifecycle.
  • Dependencies and suggestions after boilerplate created.

Steps to run

(tested on linux)

METHOD 1:

  • Go to the release space here
  • Download suitable Asset
  • Extract it
  • Move into the directory
  • Modify the file permission (if applicable)
  • Run according to the usage

METHOD 2:

  • git clone https://github.com/thenishchalraj/Android-MVVM-Boilerplate-Creater.git
  • cd Android-MVVM-Boilerplate-Creater
  • chmod +x ./mvvm_creater.sh
  • (for demo) ./mvvm_creater.sh ~/testing_dir Weather com.example.weatherapp

Boom! you're done.

Packages and files that are created

.
└── data/
    ├── api/
    │   ├── MainApi.kt
    │   └── MainDataSource.kt
    ├── model/
    │   └── SomeModel.kt
    ├── repository/
    │   └── MainRepository.kt
    ├── di/
    │   ├── base/
    │   │   ├── AppComponent.kt
    │   │   ├── AppModule.kt
    │   │   ├── ViewModelFactoryModule.kt
    │   │   ├── ViewModelKey.kt
    │   │   └── ViewModelModule.kt
    │   ├── ActivityBuildersModule.kt
    │   └── MainModule.kt
    ├── ui/
    │   ├── base/
    │   │   └── ViewModelFactory.kt
    │   └── main/
    │       ├── view
    │       └── viewmodel/
    │           └── MainViewModel.kt
    ├── utils/
    │   ├── Endpoints.kt
    │   ├── ISTDateDeserializer.kt
    │   ├── Resource.kt
    │   └── Status.kt
    └── WeatherApplication.kt

Usage

  • -h (shows help)
  • -s (shows suggestions)
  • -d (shows used dependencies)
  • arguments 1, 2, 3 (path-to-directory, base application name, application package name)

ToDos

  • Make the script compact/optimized
  • Different scripts for different architecture (MVP, MVC, Full-Modular or some best techniques)
  • Make and test its working on windows & mac

References

Contribution

Fork the repository, either do your own improvements or pick something from the ToDos or Issues and start a PR to the dev branch after successful testing.

License

Read the license here