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?