api / org.gradle.api.artifacts.dsl / RepositoryHandler / flatDir

flatDir

abstract fun flatDir(args: MutableMap<String, *>): FlatDirectoryArtifactRepository

Adds a resolver that looks into a number of directories for artifacts. The artifacts are expected to be located in the root of the specified directories. The resolver ignores any group/organization information specified in the dependency section of your build script. If you only use this kind of resolver you might specify your dependencies like ":junit:4.4" instead of "junit:junit:4.4". The following parameter are accepted as keys for the map: Key Description of Associated Value name (optional) The name of the repository. The default is a Hash value of the rootdir paths. The name is used in the console output, to point to information related to a particular repository. A name must be unique amongst a repository group. dirs Specifies a list of rootDirs where to look for dependencies. These are evaluated as per org.gradle.api.Project#files(Object...)

Examples:

 repositories { flatDir name: 'libs', dirs: "$projectDir/libs" flatDir dirs: ["$projectDir/libs1", "$projectDir/libs2"] } 

Parameters

args - The arguments used to configure the repository.

Exceptions

org.gradle.api.InvalidUserDataException - In the case neither rootDir nor rootDirs is specified of if both are specified.

Return
the added resolver

abstract fun flatDir(configureClosure: Closure<Any>): FlatDirectoryArtifactRepository

Adds an configures a repository which will look for dependencies in a number of local directories.

Parameters

configureClosure - The closure to execute to configure the repository.

Return
The repository.

abstract fun flatDir(action: Action<in FlatDirectoryArtifactRepository>): FlatDirectoryArtifactRepository

Adds an configures a repository which will look for dependencies in a number of local directories.

Parameters

action - The action to execute to configure the repository.

Return
The repository.