keyValue pair in


Is it possible to give as keyValue pair in If so, how to access them from build.gradle.


In build.gradle, if i give as test,it should return 1.0. Is it possible to do that?

Thanks Smurf

Why, i need this functionality is:

I am working on a multi module project and each project will be having differnt version. I am planning to have the project name and the version in and iterate that in build.gradle.

Or is there a a different way of doing this Please let me know

I have resolved this in another way.


  1. If it is project specific, then it doesn’t have to be in, and you might want it to be saved by your version control system as well. 2. If it is for a multi-project, then maybe you can have this information inside the root build file.

ok. thanks … Also, one more question.

Is it possible to add a project dependency based on some property?

For example: In build.gradle, can i do as below:

if(testProject) { compile “com.test:testComponent:1.0” }

I don’t see any reason why you couldn’t.