# ScopedArtifactsOperation

# ScopedArtifactsOperation

<br />

```
interface ScopedArtifactsOperation<T : Task>
```

<br />

*** ** * ** ***

Defines all possible operations on a[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)artifact type.

Depending on the scope, inputs may contain a mix of[org.gradle.api.file.FileCollection](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileCollection.html),[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)or[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)so all[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)consuming the current value of the artifact must provide two input fields that will contain the list of[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)and[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [toAppend](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toAppend(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))`(to: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)`, with: (T) `->` `[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)`<`[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)`>)` Append a new[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)(basically, either a[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)or a[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)) to the artifact type referenced by[to](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toAppend(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [toGet](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toGet(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1))`(` ` type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)`,` ` inputJars: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>,` ` inputDirectories: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)`>` `)` Set the final version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toGet(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1))artifact to the input fields of the[Task](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation).                                                         |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [toReplace](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toReplace(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))`(type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)`, into: (T) `->` `[RegularFileProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html)`)` Transform the current version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toReplace(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))artifact into a new version.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [toTransform](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toTransform(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1,kotlin.Function1))`(` ` type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)`,` ` inputJars: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>,` ` inputDirectories: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)`>,` ` into: (T) `->` `[RegularFileProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html) `)` Transform the current version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toTransform(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1,kotlin.Function1))artifact into a new version. |

## Public functions

### toAppend

```
fun toAppend(to: ScopedArtifact, with: (T) -> Property<FileSystemLocation>): Unit
```

Append a new[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)(basically, either a[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)or a[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)) to the artifact type referenced by[to](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toAppend(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))  

|                                                                                                                                                                                                                                                                                                                                                  Parameters                                                                                                                                                                                                                                                                                                                                                  ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `to: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)                                                                                        | the[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)to add the[with](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toAppend(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))to.                                                                                                                                  |
| `with: (T) `->` `[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)`<`[FileSystemLocation](https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileSystemLocation.html)`>` | lambda that returns the[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)used by the[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)to save the appended element. The[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future. |

### toGet

```
fun toGet(
    type: ScopedArtifact,
    inputJars: (T) -> ListProperty<RegularFile>,
    inputDirectories: (T) -> ListProperty<Directory>
): Unit
```

Set the final version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toGet(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1))artifact to the input fields of the[Task](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation). Those input fields should be annotated with[org.gradle.api.tasks.InputFiles](https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/InputFiles.html)for Gradle to property set the task dependency.  

|                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                       ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)                                                                                        | the[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)to obtain the final value of.                                                                                                                             |
| `inputJars: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>`    | lambda that returns a[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)or[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)that will be used to set all incoming files for this artifact type.   |
| `inputDirectories: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)`>` | lambda that returns a[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)or[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)that will be used to set all incoming directories for this artifact type. |

### toReplace

```
fun toReplace(type: ScopedArtifact, into: (T) -> RegularFileProperty): Unit
```

Transform the current version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toReplace(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1))artifact into a new version. The order in which the replace[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)s are applied is directly set by the order of this method call. Last one wins and none of the previously set append/transform/replace registered[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)s will be invoked since this[Task](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation)replace the final version.  

|                                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                                        ||
|--------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact) | the[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)to replace.                                                                                                                                                                                                                                                                                                                                        |
| `into: (T) `->` `[RegularFileProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html)         | lambda that returns the[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)used by the[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)to save the replaced element. The[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future. |

### toTransform

```
fun toTransform(
    type: ScopedArtifact,
    inputJars: (T) -> ListProperty<RegularFile>,
    inputDirectories: (T) -> ListProperty<Directory>,
    into: (T) -> RegularFileProperty
): Unit
```

Transform the current version of the[type](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/variant/ScopedArtifactsOperation#toTransform(com.android.build.api.artifact.ScopedArtifact,kotlin.Function1,kotlin.Function1,kotlin.Function1))artifact into a new version. The order in which the transforms are applied is directly set by the order of this method call. First come, first served, last one provides the final version of the artifacts.  

|                                                                                                                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                                                                                                                     ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `type: `[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)                                                                                        | the[ScopedArtifact](https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/artifact/ScopedArtifact)to transform.                                                                                                                                                                                                                                                                                                                                         |
| `inputJars: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)`>`    | lambda that returns a[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)or[RegularFile](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html)that will be used to set all incoming files for this artifact type.                                                                                                                                                                                               |
| `inputDirectories: (T) `->` `[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)`<`[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)`>` | lambda that returns a[ListProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html)or[Directory](https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html)that will be used to set all incoming directories for this artifact type.                                                                                                                                                                                             |
| `into: (T) `->` `[RegularFileProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFileProperty.html)                                                                                                | lambda that returns the[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)used by the[Task](https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html)to save the transformed element. The[Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)value will be automatically set by the Android Gradle Plugin and its location should not be considered part of the API and can change in the future. |