diff --git a/BUILD b/java/BUILD similarity index 79% rename from BUILD rename to java/BUILD index 994b62e63..7e2531570 100644 --- a/BUILD +++ b/java/BUILD @@ -13,3 +13,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +sh_test( + name = "evilurl", + srcs = ["evilurl.bash"], + # TODO How to make this work despite the presence of **/BUILD files?! + data = glob(["**/*.java"]), +) diff --git a/tools/evilurl/test.bash b/java/evilurl.bash similarity index 98% rename from tools/evilurl/test.bash rename to java/evilurl.bash index 74d83e653..bf959f377 100755 --- a/tools/evilurl/test.bash +++ b/java/evilurl.bash @@ -26,11 +26,14 @@ set -euo pipefail + allow_list=("java/dev/enola/common/io/resource/UrlResource.java" "java/dev/enola/common/io/resource/ClasspathResource.java") # TODO Also grep for .toURL() invocations, and fail for any (new) ones. +echo -n "CDW = " +pwd found_files=$(find . -name "*.java" -print0 | xargs -0 grep -lE "(^|[^a-zA-Z0-9_.])java\.net\.URL($|[^a-zA-Z0-9_#}])" | while IFS= read -r file; do file_name=$(basename "$file") allow_path="${file//.\//}" diff --git a/test.bash b/test.bash index 0c080b465..9c6757983 100755 --- a/test.bash +++ b/test.bash @@ -39,9 +39,6 @@ fi tools/version/version.bash -# TODO Remove this once evilurl is Bazel test BUILD integrated... -tools/evilurl/test.bash - # https://github.com/bazelbuild/bazel/issues/4257 echo $ Bazel testing... if [ -z "${CI:-""}" ]; then