proguard.gradle.plugin.android.transforms.AndroidConsumerRulesTransform.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proguard-gradle Show documentation
Show all versions of proguard-gradle Show documentation
Gradle plugin for ProGuard, the free shrinker, optimizer, obfuscator, and preverifier for Java bytecode
/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2020 Guardsquare NV
*/
package proguard.gradle.plugin.android.transforms
import java.io.File
import org.gradle.api.artifacts.transform.InputArtifact
import org.gradle.api.artifacts.transform.TransformAction
import org.gradle.api.artifacts.transform.TransformOutputs
import org.gradle.api.artifacts.transform.TransformParameters
import org.gradle.api.file.FileSystemLocation
import org.gradle.api.provider.Provider
/**
* Class that defines the transformation from 'android-consumer-proguard-rules'
* artifacts to 'proguard-consumer-rule' artifacts. This is done by simply
* copying the files over.
*/
abstract class AndroidConsumerRulesTransform : TransformAction {
@get:InputArtifact
abstract val inputArtifact: Provider
override fun transform(outputs: TransformOutputs) {
val inputFile = inputArtifact.get().asFile
val outputDir = outputs.dir(inputFile.name)
for (file in inputFile.listFiles() ?: emptyArray()) {
val outputFile = File(outputDir, file.name)
file.copyRecursively(outputFile)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy