A script that creates the files and codes in them for android MVVM architecture in kotlin.
Android-MVVM-Boilerplate-Creater - behind the scenes
- 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.
(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.
.
└── 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
- -h (shows help)
- -s (shows suggestions)
- -d (shows used dependencies)
- arguments 1, 2, 3 (path-to-directory, base application name, application package name)
- 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
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.
Read the license here