Can I get the properties defined in “gradle. Properties” in Java state?
•
Java
I'm in gradle A property is defined in the properties file, as follows:
user.password=mypassword
Can I use it as a variable value in a Java statement?
Solution
Yes, you can, but it's not a good idea or a good practice gradle. The properties file is intended to preserve the properties of gradle itself, such as the JVM args used at build time
If you need to store user / pass through pairs in the properties file, you should put them under Src / main / resources or other corresponding folders and compare them with gradle Separate properties
Note: it is uncertain whether it is usually safe to retain property files in mobile applications
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码