Setup Gradle to run Java executable in Android Studio

回眸只為那壹抹淺笑 提交于 2019-11-30 18:40:00

I use IDE configuration for this. Here is how to achieve it:

  1. in menu select Run -> Edit configuration
  2. press plus icon -> Application
  3. Name: OrmLite DB config, Main class: com.yourclasspath.DatabaseConfigUtil, Use classpath of module: main
  4. switch to your main build configuration and in the Before launch press plus icon -> Run another configuration and select OrmLite DB config

Now everytime you build your main configuration it also executes DatabaseConfigUtil.

If you dont want to run DatabaseConfigUtil before every build just skip step 4 and run it from configuration selection next to the Run icon in the toolbar.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!