简体   繁体   中英

Gradle: Building different jars for Java and Android

I recently completed the initial work on a Firebase library . This library is currently implemented for use with Firebase-server (Java), but I would also like to build a version for use with Firebase-android. Making the Android version should be a simple matter of changing the Firebase SDK being used and implementing the Android version of my Firebase wrapper interfaces.

When building the project, I would like it to create a separate artifact for both Java servers and Android. I imagine this is something that could be done using Gradle. How would I go about doing this?

As a followup question, would it be necessary or a good idea to include the respective Firebase SDK dependencies in my build artifacts?

I believe the process I was looking for is known as creating a multi-project Gradle build .

I created three modules: core , server , and android . The core module contains the code required by the two derivative modules, while the derivative modules import the Firebase SDKs they need and implement the core interfaces in the way they require.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM