1

I have a library project (module somelibrary) that will be used both in an Android project and a desktop app project in /Projects/SomeLibrary.

The Android project (module app) is in /Projects/AndroidApp
and the desktop app (module desktop) project is in /Projects/DesktopApp.

There are two answers for this case in SO.

Sync shared library projects/modules with its source

Android studio add external project to build.gradle

The first approach generates settings.gradle in the Android project

include ':app', ':somelibrary'
project(':somelibrary').projectDir = new File(settingsDir, '../SomeLibrary')

and settings.gradle in the desktop project

include ':desktop', ':somelibrary'
project(':somelibrary').projectDir = new File(settingsDir, '../SomeLibrary')

The second approach generates settings.gradle in the Android project

include ':somelibrary'
project(':somelibrary').projectDir = new File(settingsDir, '../SomeLibrary')

and settings.gradle in the desktop project (the same)

include ':somelibrary'
project(':somelibrary').projectDir = new File(settingsDir, '../SomeLibrary')

What is the difference between them?

Naetmul
  • 14,544
  • 8
  • 57
  • 81

1 Answers1

-1

It's the same approach, except that you have an additonal module in each build, desktop and app respectively.

Vampire
  • 35,631
  • 4
  • 76
  • 102