Android-MVVM-Boilerplate-Creater
Android-MVVM-Boilerplate-Creater copied to clipboard
A script that automates the tedious task of creating basic android files with the packages and imports for MVVM architecture.
Hey there!
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
- [x] Type command > Enter > Done. (it's that fast)
- [x] Each layer in different package.
- [x] Generates basic utility package too.
- [x] Packages with all the basic codes in Kotlin.
- [x] Contains imports for all the files created.
- [x] Uses Retrofit2, Dagger2 and Lifecycle.
- [x] 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