# flatDir

abstract fun flatDir(args: Map<String, out Any>): 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:

`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 files

Examples:

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

Content copied to clipboard

#### Return

the added resolver

#### Parameters

args

The arguments used to configure the repository.

#### Throws

InvalidUserDataException

In the case neither rootDir nor rootDirs is specified of if both are specified.

abstract fun flatDir(@DelegatesTo(value = FlatDirectoryArtifactRepository::class) configureClosure: Closure): FlatDirectoryArtifactRepository

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

#### Return

The repository.

#### Parameters

configureClosure

The closure to execute to configure the repository.

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

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

#### Return

The repository.

#### Parameters

action

The action to execute to configure the repository.