You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 6, 2025. It is now read-only.
iOS allowlist dependencies consist of a set of dependencies that are available for front-ends and high-level
55
-
repositories to consume from the Mercadolibre-mobile group.
58
+
iOS allowlist dependencies consist of a set of libraries that are available for front-ends and low-level
59
+
repositories to consume from the **MercadoLibre-mobile** group. Your Frontend should not be declared here nor consumed
60
+
by any other FEnd.
56
61
57
-
This set of dependencies is parsed in the form of a JSON text. The root level property should be called `whitelist`.
62
+
These dependencies are defined in JSON format, and the root-level property is called `whitelist`.
58
63
59
64
Each of the dependencies is an object with the following properties:
60
65
@@ -66,43 +71,45 @@ Each of the dependencies is an object with the following properties:
66
71
67
72
#### Optional
68
73
74
+
-`description`: (optional) some relevant description
69
75
-`expires`: You can have expirable dependencies by adding the `expires` field. If no field is added, the dependency is
70
76
considered as non-expirable
71
-
-`description`: (optional) some relevant description
72
77
73
78
Example:
74
79
75
-
```
80
+
```json
76
81
{
77
-
"whitelist": [
78
-
# This will match with 'MeliSDK' and version '~>5.+' (version must have ~>5.x)
82
+
"whitelist": [
79
83
{
80
-
"name": "MeliSDK",
81
-
"version": "^~>5.[0-9]+$"
82
-
},
83
-
# This will match with 'MLRecommendations' for any version
84
+
"description": "# This will match with 'MeliSDK' and version '~>5.+' (version must have ~>5.x)",
85
+
"name": "MeliSDK",
86
+
"version": "^~>5.[0-9]+$"
87
+
},
84
88
{
85
-
"name": "MLRecommendations",
86
-
"version": null
87
-
}]
89
+
"description": "# This will match with 'MLRecommendations' for any version",
90
+
"name": "MLRecommendations",
91
+
"version": null
92
+
}]
88
93
}
89
94
```
90
95
91
96
## Support for Granular Dependencies:
92
97
93
-
This functionality provides a more precise management of the scope of dependencies, giving us the ability to select specific consumers for each of them.
98
+
This functionality provides a more precise management of the scope of dependencies, giving us the ability to select
99
+
specific consumers for each of them.
94
100
95
-
To activate the granularity feature, it is necessary to introduce a new block within the dependency definition, specifying which Mercado Libre projects will have access to it. This should be done as follows:
101
+
To activate the granularity feature, it is necessary to introduce a new block within the dependency definition,
102
+
specifying which Mercado Libre projects will have access to it. This should be done as follows:
96
103
104
+
### Android Platform
97
105
#### There are two types of granularity:
98
106
99
-
* GroupId : You specify the group id of the project that will have access to the dependency.
100
-
* Example: `com.mercadolibre.android.example`
107
+
* GroupId : You specify the group id of the project that will have access to the dependency.
108
+
* Example: `com.mercadolibre.android.example`
101
109
* GroupId:name : You specify the group id and the name of the project that will have access to the dependency.
@@ -123,40 +130,43 @@ To activate the granularity feature, it is necessary to introduce a new block wi
123
130
```
124
131
125
132
### iOS Platform
126
-
```
133
+
134
+
```json
127
135
{
128
136
"whitelist": [
129
137
{
138
+
"allows_granular_projects": [
139
+
"name_meli_lib",
140
+
"MLRecommendations"# Example of a Mercado Libre Dependency Lib Name.
141
+
],
130
142
"name": "MeliSDK",
131
143
"version": "^~>5.[0-9]+$"
132
-
"allows_granular_projects": [
133
-
"name_meli_lib",
134
-
"MLRecommendations" # Example of a Mercado Libre Dependency Lib Name .
135
-
]
136
144
},
137
145
...
138
146
]
139
147
}
140
148
```
141
149
142
-
143
150
## Support for Transitive Dependencies (ONLY ANDROID):
144
151
145
-
This functionality provides a more precise control over how it is possible to exclude transitive dependencies from our projects.
152
+
This functionality provides more precise control over how transitive dependencies can be excluded from projects,
153
+
allowing specific consumers to be selected for each one.
146
154
147
-
This functionality provides a more precise management of the scope of dependencies, giving us the ability to select specific consumers for each of them.
155
+
### Blocking Transitive Dependencies:
148
156
149
-
To activate the transitivity feature, it is necessary to introduce a new block within the dependency definition, specifying two new keys:
150
-
1. By default, all dependencies are enabled as transitive. To specify otherwise, it should be configured as false as follows:
151
-
` "transitivity" = false `
152
-
2. All dependencies that are not transitive should indicate the namespace of the dependency. This can be done as follows:
153
-
` "namespace": "com.name.path.path" `
157
+
To activate this feature, introduce a new block within the dependency definition with two keys:
154
158
155
-
Both keys will be found within the ` "transitive_configuration" ` enclosure. Here's an example to visualize it more clearly:
159
+
1.**namespace**: For non-transitive dependencies, you must specify the namespace:
160
+
`"namespace": "com.name.path.path"`
161
+
2.**transitivity**: By default, all dependencies are transitive. To specify otherwise, set it to `false`:
162
+
`"transitivity": "false"`
156
163
164
+
Both keys will be found within the `"transitive_configuration"` node. Here's an example to visualize it more
165
+
clearly:
157
166
158
167
### Android Platform
159
-
```
168
+
169
+
```json
160
170
{
161
171
"whitelist": [
162
172
{
@@ -165,19 +175,42 @@ Both keys will be found within the ` "transitive_configuration" ` enclosure. Her
165
175
"version": "2\\.6\\.4",
166
176
"transitive_configuration":
167
177
{
168
-
"transitivity": false,
169
-
"namespace": "retrofit2"
178
+
"namespace": "retrofit2",
179
+
"transitivity": false
170
180
}
171
181
},
172
182
...
173
183
]
174
184
}
175
185
```
176
186
177
-
It's important to mention that if non-transitive dependency imports are found within classes, they will generate a blocker through the Gradle plugin, preventing the lintAndroid() task executed in CI or locally from completing successfully.
187
+
If declared `non-transitive dependency` imports are found in your code, our plugin will **block** the build, preventing
188
+
the `lintAndroid()` task from completing successfully in CI or locally.
189
+
190
+
191
+
## Basic Continuous Integration (CI) Checks!!
192
+
We have some basic checks placed in our CI to ensure that the allowlist is being used correctly.
193
+
The checks can be found [here](https://github.com/mercadolibre/mobile-dependencies_whitelist/blob/master/scripts/checks.sh)
194
+
but basically, we are validating the following:
195
+
196
+
1.**JSON Linter**:
197
+
- Uses the cmd `jsonlint <allowlist_file>` to check if the JSON file is well-formed.
198
+
- you can install it from [here](https://www.npmjs.com/package/jsonlint)
199
+
2.**JSON Sorter Lint**:
200
+
- Uses the cmd `jsonsort <allowlist_file> --arrays` to ensure the content of the JSON file is properly sorted, including arrays.
201
+
- you can install it from [here](https://www.npmjs.com/package/json-sort-cli)
202
+
3.**Expiration Date Validator**:
203
+
- Verify that the expiration dates in the JSON file are in the correct format (YYYY-MM-DD).
204
+
- Verify that the expiration date isn't a `Wednesdays` or `Thursdays`.
205
+
4.**Key Names Validator**:
206
+
- Verify that your are using the proper key names in the JSON file.
207
+
5.**Version Pattern Validator**:
208
+
- Verify that we aren't using dynamic versions for external libs.
209
+
210
+
Some other checks could be performed, check the CI Error for more information.
178
211
212
+
## Contexts Allowlist (Deprecated)
179
213
180
-
# Contexts Allowlist [DEPRECATED]
214
+
For more information, check
215
+
the [new context allowlist](https://furydocs.io/mobile-apps/v1.5.2/guide/#/lang-en/metrics/02_crash-rate?id=contexts).
181
216
182
-
For more information consult
183
-
the [new context allowlist](https://furydocs.io/mobile-apps/v1.5.2/guide/#/lang-en/metrics/02_crash-rate?id=contexts)
0 commit comments