Gradle project for plain Java and Android with single source tree

╄→гoц情女王★ 提交于 2019-12-11 02:08:49

问题


I'm running project which includes both plain Java (Swing UI) and Android parts, basically source tree consisting 3 parts:

         |---swing  (30% of code)
         |
 src-----|---common (40% of code)
         |
         |---android (30% of code)

How should I define gradle project(s) in order to build from the same sources 2 different apps - one for Java/Swing another one for Android?

I tried different approaches but in the end failed...

Update

If one'd consider 2 or more projects with independent source trees - no problem to implement it - there're number of examples.

Or if to consider 2 projects with the same source tree using the same compiler, again it works with Gradle.

Problem is in implementing gradle project utilizing different compilers on the same source tree.


回答1:


Setup 3 modules and import these modules as you want via the settings.gradle files. For more details see https://docs.gradle.org/current/userguide/multi_project_builds.html



来源:https://stackoverflow.com/questions/38760041/gradle-project-for-plain-java-and-android-with-single-source-tree

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