viktor2000
viktor2000

Reputation: 53

How to get project's implementation in gradle?

A build.gradle file represents an instance of Project in gradle. But Project is just an interface. The question is: how to get Project's implementation (kind of like *.java, *.class) that corresponds to the build.gradle script?

Upvotes: 2

Views: 468

Answers (1)

Opal
Opal

Reputation: 84756

build.gradle is not an equivalent of Project's implementation. It's executed on a passed Project instance, this is not the same. To know the implementation class of Project run the script below:

println project.getClass()

You'll get org.gradle.api.internal.project.DefaultProject_Decorated which points to this class. What is this _Decorated suffix? As pointed here and here it marks the class as preprocessed. The goal of this preprocessing is:

Generates a subclass of the target class to mix-in some DSL behaviour.

Upvotes: 3

Related Questions