What should I do so that the value of a property will not be changed?


(dinio.dinev) #1

Hi, in my build I add property with gradle.properties file but I don’t want it to be changed by build.gradle file. How can I catch if the value is trying to be changed and to throw exception. I don’t want to compare old and new values. If there is another way to catch this change and throw exception? Thanks,Cat.


(Luke Daley) #2

I can’t think of any other way than throwing an exception in the setter if the value is already set.


(dinio.dinev) #3

I set it from my plugin convention and there I have setter I will check there, but if some one set this property through build.gradle file will be the setter used?


(Maciek Opała) #4

You can try it out by yourself.