Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Generate Viper classes #52

Open
devtechvalens opened this issue Jul 26, 2017 · 3 comments
Open

Auto Generate Viper classes #52

devtechvalens opened this issue Jul 26, 2017 · 3 comments
Labels

Comments

@devtechvalens
Copy link

Hello,

Great Work!!!

I just need to know that how can i Auto Generate Viper classes?

@DmitriyZaitsev
Copy link
Contributor

Hello @devtechvalens!

Thanks!

You can easily generate VIPER classes using RxViper gradle plugin. Sorry, I'm still working on readme (#21).
You need to:

  • add the plugin to your classpath
buildscript {
    dependencies {
        classpath "com.dzaitsev.rxviper:rxviper:1.0.0-rc2"
    }
}
  • and apply it in your script: apply plugin: "com.dzaitsev.rxviper"
  • then you will be able to config your screens and use cases. For example, you have two screens in your app (Auth and Dashboard) like this:
...
rxViper {
    packageName android.defaultConfig.applicationId // default "generated"
    useLambdas true // default false. enable this if you've lambdas in your project
    screens {
        auth {  // name of screen1
            useCases {
                logIn { }
                signUp { }
            }
        }
        dashboard { // name of screen2
            useCases {
                getItems { }
                makeOrder { }
            }
        }
    }
}
  • run task ./gradlew generateRxViper. The plugin will parse the config and generate all boilerplate classes in defined package, so you just need to make edits to the right places.
  • continue to develop with pleasure.
  • Please see the example of usage here: https://github.com/RxViper/RxViper/blob/1.x/sample/build.gradle#L55 It demonstrates all available properties, so you can play with them and see what and how it changes.
    Feel free to ask questions if any.

@vikrams061
Copy link

Hi i want to use rxviper as viper architecture template so that it can auto generate viper class in android studio is this can be possible
Thanks.

@DmitriyZaitsev
Copy link
Contributor

Hi @vikrams061
your question relates to #53 The work is in progress. For now, you can check out the branch ide_template, fix sh scripts with the exact name of your version of AS and install that template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants