There is an Android application using Grandle for build. It uses a "library" stated in build.gradle file:
dependencies {
api project(path: ':specialproject.speciallibrary', configuration: 'default')
It is configured in settings.gradle:
include ':specialproject.speciallibrary'
project(':specialproject.speciallibrary').projectDir = new File('../specialprojectlibrary')
Developers currently have the main project and specialprojectlibrary projects side-by-side on their computers. So when they build it, Gradle fetches specialprojectlibrary and builds it when building the main app (APK.
Now, when would like to have GitLab CI/CD for the app. Main app and library app are in separe Git repositories and under separate projects inside a group in GitLab.
After creating CI/CD it occured it throws error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':something:xyz'.
> Could not resolve all task dependencies for configuration ':something:xyz'.
> **Could not resolve project :specialproject.speciallibrary.**
Required by:
project :mainproject
> Project :mainproject declares a dependency from configuration 'api' to configuration 'default' which is not declared in the descriptor for project :specialproject.speciallibrary.
I assume it is because it canon CI/CD Gradle of the main app does not have access to library code under .//specialprojectlibrary.
So my question is:
How to copy library source code from other Git repo to an Android Gradle application GitLab build process?