From 546f8615273087985fc3e3d2eb03347abaed33b0 Mon Sep 17 00:00:00 2001 From: Abraham Elmahrek Date: Thu, 11 Dec 2014 22:45:07 -0600 Subject: [PATCH] SQOOP-1857: Sqoop2: Add rat check to pre-commit hook (Jarek Jarcec Cecho via Abraham Elmahrek) --- dev-support/test-patch.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dev-support/test-patch.py b/dev-support/test-patch.py index a98dce4f..4aa9af1e 100755 --- a/dev-support/test-patch.py +++ b/dev-support/test-patch.py @@ -214,6 +214,13 @@ def mvn_clean(result, output_dir): else: result.fatal("failed to clean project (exit code %d)" % (rc)) +def mvn_rat(result, output_dir): + rc = execute("mvn apache-rat:check 1>%s/rat.txt 2>&1" % output_dir) + if rc == 0: + result.success("License check passed") + else: + result.fatal("Failed to run license check (exit code %d)" % (rc)) + def mvn_install(result, output_dir): rc = execute("mvn install -DskipTests 1>%s/install.txt 2>&1" % output_dir) if rc == 0: @@ -417,6 +424,7 @@ def post_jira_comment_and_exit(): git_checkout(result, branch) git_apply(result, patch_cmd, patch_file, strip, output_dir) static_test(result, patch_file, output_dir) +mvn_rat(result, output_dir) mvn_install(result, output_dir) if run_tests: mvn_test(result, output_dir)