forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a whitelist to jvm dependency analyzer
The whitelist allows big repos to reduce dependency issues while stopping any new from being introduced. You can whitelist the projects that currently have issues and make the dependency checks fatal. All projects with current issues will still be able to build but new issues will result in breaking builds. Also it seems like the direct dependency check would always fatal if set to fatal, fixed that. Testing Done: Added two integration tests. Reviewed at https://rbcommons.com/s/twitter/r/888/
- Loading branch information
1 parent
c196ac7
commit 069cbb3
Showing
12 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
testprojects/src/java/com/pants/testproject/missingdepswhitelist/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
java_library(name='missingdepswhitelist', | ||
sources=rglobs('*.java'), | ||
dependencies=[ | ||
'examples/src/java/com/pants/examples/hello/greet', | ||
'testprojects/src/java/com/pants/testproject/missingdepswhitelist2' | ||
] | ||
) |
11 changes: 11 additions & 0 deletions
11
testprojects/src/java/com/pants/testproject/missingdepswhitelist/MissingDepsWhitelist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.pants.testproject.missingdepswhitelist; | ||
|
||
import com.pants.examples.hello.greet.Greeting; | ||
import com.pants.testproject.missingdepswhitelist2.MissingDepsWhitelist2; | ||
|
||
public class MissingDepsWhitelist { | ||
public String doStuff() { | ||
MissingDepsWhitelist2 scala = new MissingDepsWhitelist2(); | ||
return Greeting.greet("woop"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
testprojects/src/java/com/pants/testproject/missingdepswhitelist/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The JVM dependency analyzer will tell users if a target a is using classes it does not correctly depend on. | ||
|
||
However, in some cases (such as catching up on fixing these dependency issues) it is useful to have a | ||
whitelist of targets to not report or fail builds on. | ||
|
||
This project will generate a missing dep warning, but it is whitelisted so in the end it will not. |
6 changes: 6 additions & 0 deletions
6
testprojects/src/java/com/pants/testproject/missingdepswhitelist2/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
java_library(name='missingdepswhitelist2', | ||
sources=rglobs('*.java'), | ||
) |
9 changes: 9 additions & 0 deletions
9
testprojects/src/java/com/pants/testproject/missingdepswhitelist2/MissingDepsWhitelist2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.pants.testproject.missingdepswhitelist2; | ||
|
||
import com.pants.examples.hello.greet.Greeting; | ||
|
||
public class MissingDepsWhitelist2 { | ||
public String doStuff() { | ||
return Greeting.greet("weep"); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
testprojects/src/java/com/pants/testproject/missingdirectdepswhitelist/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
java_library(name='missingdirectdepswhitelist', | ||
sources=rglobs('*.java'), | ||
dependencies=[ | ||
'testprojects/src/java/com/pants/testproject/missingdirectdepswhitelist2' | ||
] | ||
) |
11 changes: 11 additions & 0 deletions
11
...src/java/com/pants/testproject/missingdirectdepswhitelist/MissingDirectDepsWhitelist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.pants.testproject.missingdirectdepswhitelist; | ||
|
||
import com.pants.examples.hello.greet.Greeting; | ||
import com.pants.testproject.missingdirectdepswhitelist2.MissingDirectDepsWhitelist2; | ||
|
||
public class MissingDirectDepsWhitelist { | ||
public String doStuff() { | ||
MissingDirectDepsWhitelist2 scala = new MissingDirectDepsWhitelist2(); | ||
return Greeting.greet("woop"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
testprojects/src/java/com/pants/testproject/missingdirectdepswhitelist2/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
java_library(name='missingdirectdepswhitelist2', | ||
sources=rglobs('*.java'), | ||
dependencies=['examples/src/java/com/pants/examples/hello/greet'] | ||
) |
9 changes: 9 additions & 0 deletions
9
...c/java/com/pants/testproject/missingdirectdepswhitelist2/MissingDirectDepsWhitelist2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.pants.testproject.missingdirectdepswhitelist2; | ||
|
||
import com.pants.examples.hello.greet.Greeting; | ||
|
||
public class MissingDirectDepsWhitelist2 { | ||
public String doStuff() { | ||
return Greeting.greet("weep"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters