问题
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