How to configure subprojects as Java and Android at the same time with gradle -


i try correctly configure multi project build gradle.

the difficulty have 3 projects , want build android application normal java8 application (runnable jar). therefore, have android project, java8 application project , plain java project common code both applications share.

with following setup, can compile both applications.

  • the android project applies "com.android.application" plugin , has dependency on common project
  • the java application project applies "application" plugin , has dependency on common project
  • the common project applies "java" plugin

in order use lambda expressions, i'm using retrolambda in android project , java 8 in java application. obviously, cannot use full java8 in common project, break android application.

to able use lambda expressions in common project, have set sourcecompatibility java 1.8. makes possible use e.g. java8 stream apis in common project. when compile android project, not compile error. obviously, android app crash @ runtime.

so question is: how can configure common project able use in standard java8 application in android application compile errors when use stuff cannot use on android.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -