You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/09/27 02:37:24 UTC

[GitHub] [hudi] yanghua commented on a change in pull request #3674: [HUDI-2440] Add dependency change diff script for dependency governace

yanghua commented on a change in pull request #3674:
URL: https://github.com/apache/hudi/pull/3674#discussion_r716321234



##########
File path: scripts/dependency.sh
##########
@@ -0,0 +1,123 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# 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.
+#
+
+set -eou pipefail
+set -x
+
+export LC_ALL=C
+
+PWD=$(cd "$(dirname "$0")"/.. || exit; pwd)
+
+function printUsage() {
+  echo "Usage: $(basename "${0}") [-p <artifactId>] -r " 2>&1
+  echo '   -r   [OPTIONAL] to replace the old dependencyList file with new dependencies'
+  echo '   -p   [MUST] to generate new dependencyList file for the specified module'
+}
+
+function build_classpath() {
+  mvn dependency:build-classpath -pl :${PL} |\
+    grep -E -v "INFO|WARNING" | \
+    tr ":" "\n" | \
+    awk -F '/' '{
+      artifact_id=$(NF-2);
+      version=$(NF-1);
+      jar_name=$NF;
+      classifier_start_index=length(artifact_id"-"version"-") + 1;
+      classifier_end_index=index(jar_name, ".jar") - 1;
+      classifier=substr(jar_name, classifier_start_index, classifier_end_index - classifier_start_index + 1);
+      print artifact_id"/"version"/"classifier"/"jar_name

Review comment:
       > seeing double `/` before jar_name.
   
   It is used to extract the `classifier ` value of the maven dependency. If not configured, it's an empty string.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org