I have a new project, it depends on classes at legacy project, not jar files but actual classes. How can I make these directories a dependency for gradle compile?
1- open your build. Gradle (app module) scroll to the top until you see that comment // Top-level build file where you can add configuration options common to all sub-projects/modules. builtin comment // Top-level build file where you can add configuration options common to all sub-projects/modules.
Annotation Type ClasspathMarks a property as specifying a JVM classpath for a task. This annotation should be attached to the getter method in Java or the property in Groovy. Annotations on setters or just the field in Java are ignored. For jar files, the normalized path is empty.
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file.
The Gradle dependency cache consists of two storage types located under GRADLE_USER_HOME/caches : A file-based store of downloaded artifacts, including binaries like jars as well as raw downloaded meta-data like POM files and Ivy files.
dependencies { compile files("relative/path/to/classes/dir") }
For further details, check out the Gradle User Guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With