ScopedArtifact.CLASSES

Added in 7.4.0

object ScopedArtifact.CLASSES : ScopedArtifact, Artifact.Appendable, Artifact.Transformable, Artifact.Replaceable


.class files, result of sources compilation and/or external dependencies depending on the scope; includes users' transformation, but does not include Jacoco instrumentation

content of POST_COMPILATION_CLASSES plus anything added to CLASSES after compilation.

You should use this if you just need to consume all the classes that will be packaged in the project.

If you need to generate bytecodes post compilation and also need to have access to the compiled classes, you cannot directly consume CLASSES and append to it as it would create a circular dependency.

Instead, consume POST_COMPILATION_CLASSES and use CLASSES to append your bytecodes to.

extension.onVariants(extension.selector().withBuildType("debug")) {>
variant - val generatorTask = project.tasks
.register( "postCompilation${variant.name.capitalizeFir
stChar
()}Task", AddPostCompilationCodeGeneratorTask::>
class.java) { task - //
configure

your task } // consume the r
esult of compilation variant.artifacts.for
Scope(Scope.PROJECT)
.use(generatorT
ask) .toGet( ScopedArtifact.POST_
COMPILATION_CLASSES, AddPostCompilationCode
GeneratorTask::jars, AddPostCompilationCod
eGene

ratorTask::dirs ) // and produc
e the new bytecodes. variant.artifacts.for
Scope(Scope.PROJECT)
.use(generatorTask) .toAppend(ScopedArtifact.CLASSES, AddPostCompilationCodeGener
atorTask::outputDir)}

Summary

Inherited functions

From com.android.build.api.artifact.Artifact
open String
open String
String

Provide a unique name for the artifact type.