leventunver
leventunver

Reputation: 3399

Is it possible to get properties of properties by command-line in Gradle

In my build.gradle, I have a property like this:

   sourceSets {
      mtp {
        resources {
          exclude '**/*.html'
        }
      }
    }

Is it possible to get the properties of mtp via command-line? I can get root project properties:

gradle properties
sourceSets: [source set 'main', source set 'mtp', source set 'test']

But when I try below, it fails:

gradle sourceSets:properties
Project 'sourceSets' not found in root project.

My solution is always creating a specific new task for that purpose:

task mtp {
    sourceSets.mtp.properties.each {println it}
}  

However I demand an easier and practical solution. Any opinions?

Thanks.

Upvotes: 2

Views: 1110

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123900

There isn't currently a built-in feature for discovering nested properties from the command line. Better discoverability of the build language/model is a planned feature on the way to 3.0. Until then, the Gradle Build Language Reference is the best source of information to answer such questions.

Upvotes: 2

Related Questions