# CombiningOperationRequest

[View Source](https://cs.android.com/search?q=file:com/android/build/api/artifact/OperationRequests.kt+class:com.android.build.api.artifact.CombiningOperationRequest) Added in 4.2.0


```
interface CombiningOperationRequest<FileTypeT : FileSystemLocation>
```

<br />

*** ** * ** ***

Operations performed by a `https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html` with a single `https://docs.gradle.org/current/javadoc/org/gradle/api/file/Directory.html` or `https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html` output.

`https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html` is consuming existing version of the target `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/MultipleArtifact` and producing a new version.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `<ArtifactTypeT : https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Multiple<FileTypeT> & https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Transformable> https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/CombiningOperationRequest#toTransform(com.android.build.api.artifact.Artifact.Multiple)( type: ArtifactTypeT )` Initiates a transform request to a multiple `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Transformable` artifact type. |

## Public functions

### toTransform

Added in 7.0.0

```
fun <ArtifactTypeT : Artifact.Multiple<FileTypeT> & Artifact.Transformable> toTransform(
    type: ArtifactTypeT
): Unit
```

Initiates a transform request to a multiple `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Transformable` artifact type.

| Parameters |
|---|---|
| `type: ArtifactTypeT` | The `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact` of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/CombiningOperationRequest` identifying the artifact to transform. The artifact type must be `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Multiple` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/Artifact.Transformable`. The implementation of the task must combine all the inputs into a single output. Chained transforms will get a `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/ListProperty.html` containing the single output from the upstream transform. If some `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/index.html` calls are made on the same artifact type, the first transform will always get the complete list of artifacts irrespective of the timing of the calls. In the following example, let's take a `https://docs.gradle.org/current/javadoc/org/gradle/api/Task.html` to transform a list of `https://docs.gradle.org/current/javadoc/org/gradle/api/file/RegularFile.html` as inputs into a single output: ``` abstract class MyTask: DefaultTask() { @get:InputFiles abstract val inputFiles: ListProperty<RegularFile> @get:OutputFile abstract val outputFile: RegularFileProperty @TaskAction fun taskAction() { ... read all inputFiles and write outputFile ... } } ``` A `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/artifact/MultipleArtifact` is defined as follows: ``` sealed class ArtifactType<T: FileSystemLocation>(val kind: ArtifactKind) { object MULTIPLE_FILE_ARTIFACT: ArtifactType<RegularFile>(FILE), Multiple, Transformable } ``` You then register the task as follows: ``` val taskProvider= projects.tasks.register(MyTask::class.java, "combineTask") artifacts.use(taskProvider) .wiredWith( MyTask::inputFiles, MyTask::outputFile) .toTransform(ArtifactType.MULTIPLE_FILE_ARTIFACT) ``` |