Current location - Quotes Website - Signature design - Where is the $ {} global variable defined in the gradle file in Android?
Where is the $ {} global variable defined in the gradle file in Android?
In order to set configuration information such as version number in different modules, global variables can be configured to unify the common configuration information of all modules.

Setting methods are generally divided into two types:

I. Independent file configuration

1. 1. Create a new config.gradle file at the root of the project.

1.2. Write the public information in gradle to config.gradle file:

1.3. In the build.gradle of the main project, it is stated that:

1.4. Quote our path configuration in the project. As shown in the figure below:

Second, configure it in the gradle.properties or local.properties file.

The following is the signature configuration:

I feel quite convenient after reading it, but! It should be noted that because all string variables are used, it will be a bit troublesome when integer variables are needed:

You need to use integer.parseint (); Method to convert string types!