For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

componentFilter

Specify a filter for the components that should be included in this view. Only artifacts from components matching the supplied filter will be returned by getFiles or getArtifacts. This method cannot be called multiple times for a view.

A component filter can be used to select artifacts from components of a certain type:


     configuration.incoming.artifactView {
         componentFilter { it instanceof ProjectComponentIdentifier }
         // or
         componentFilter { it instanceof ModuleComponentIdentifier }
     }

Alternatively, a component filter can be used to select artifacts from specific components:


     configuration.incoming.artifactView {
         componentFilter {
             it instanceof ProjectComponentIdentifier &&
             it.projectPath == ":myProject"
         }
         // or
         componentFilter {
             it instanceof ModuleComponentIdentifier &&
                 it.group == "com.example" &&
                 it.module == "foo"
         }
     }

Since

3.4