michaelsembwever commented on code in PR #4853:
URL: https://github.com/apache/cassandra/pull/4853#discussion_r3330291000


##########
.build/docker/_prepopulate_maven_deps.sh:
##########
@@ -0,0 +1,94 @@
+#!/bin/bash
+#
+# Licensed 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 -e
+
+# Script to prepopulate Maven repository with dependencies from multiple 
Cassandra branches
+# This will download all dependencies to a custom Maven repository directory
+
+# pre-conditions
+command -v ant >/dev/null 2>&1 || { error 1 "ant needs to be installed"; }
+command -v git >/dev/null 2>&1 || { error 1 "git needs to be installed"; }
+
+# Function to download dependencies for a branch
+download_deps_for_branch() {
+    local branch=$1
+    local branch_name=$(echo "$branch" | sed 's|origin/||')
+    
+    # Check if branch exists
+    if ! git rev-parse --verify "$branch" >/dev/null 2>&1; then
+        echo "WARNING: Branch $branch does not exist, skipping..."
+        return
+    fi
+    
+    git checkout "$branch"
+    
+    echo ""
+    echo "Downloading dependencies for $branch to $CUSTOM_M2_REPO..."
+    echo ""
+
+    # ensure git modules are initialised
+    ant init
+    # HACK
+    if [ -d "modules/accord" ]; then
+    local version=$(grep '<property name="base.version"' build.xml | sed 
's/.*value="\([^"]*\)".*/\1/')
+        cd modules/accord
+        ./gradlew clean publishToMavenLocal 
-Dmaven.repo.local="$CUSTOM_M2_REPO" -Paccord_group=org.apache.cassandra 
-Paccord_artifactId=cassandra-accord -Paccord_version="${version}-SNAPSHOT" -x 
test -x rat -x checkstyleMain -x checkstyleTest -x javadoc
+        cd -
+    fi
+    # download all dependencies
+    ant -Dmaven.repo.local="$CUSTOM_M2_REPO" 
-Dlocal.repository="$CUSTOM_M2_REPO" resolver-dist-lib
+}
+
+CUSTOM_M2_REPO="${1:-$HOME/.m2/repository}"

Review Comment:
   no.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to