-
Notifications
You must be signed in to change notification settings - Fork 1k
/
forbiddenApis.txt
34 lines (24 loc) · 987 Bytes
/
forbiddenApis.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Forbidden API rules
===================
Uwe's excellent forbidden API checker is applied as part of 'check'
task. The rules for each project are sourced dynamically based on the
actual set of dependencies.
If a given project has a dependency on an artifact called "foo.bar:baz"
then all of these rule files will be applied (all paths relative
to: gradle/validation/forbidden-apis/).
defaults.all.txt
defaults.[project].txt
foo.bar.baz.all.txt
foo.bar.baz.[project].txt
Note that the "defaults" can't reference any JARs other than Java's
runtime.
Example
-------
We'd like to prevent people from using Guava's
com.google.common.base.Charsets class. The rule would be:
@defaultMessage Use java.nio.charset.StandardCharsets instead
com.google.common.base.Charsets
and we would place this rule in this file:
gradle/validation/forbidden-apis/com.google.guava.guava.all.txt
From now on, if *any* module depends on this library, it will
automatically pick up the rule and enforce it.