This is an automated email from the ASF dual-hosted git repository.

ifesdjeen pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2355c37  Make relocate dependencies script less manual
2355c37 is described below

commit 2355c3769472eb8d6542d8cb3838e4f5536f0430
Author: Alex Petrov <oleksandr.pet...@gmail.com>
AuthorDate: Thu Nov 19 17:09:51 2020 +0100

    Make relocate dependencies script less manual
    
    Patch by Alex Petrov; reviewed by Ekaterina Dimitrova and David Capwell for 
CASSANDRA-16287
---
 build-shaded-dtest-jar.sh | 12 +++++++-----
 relocate-dependencies.pom |  3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/build-shaded-dtest-jar.sh b/build-shaded-dtest-jar.sh
index efedcaa..b35ec47 100755
--- a/build-shaded-dtest-jar.sh
+++ b/build-shaded-dtest-jar.sh
@@ -2,12 +2,14 @@
 
 set -xe
 
-# Cassandra version that is specified in build.xml
-CASSANDRA_VERSION=$1
-# In-JVM dtest version that is specified in relocate-dependencies.pom
-DTEST_VERSION=$2
 ARTIFACT_NAME=cassandra-dtest
 REPO_DIR=~/.m2/repository
+CASSANDRA_VERSION=$(cat build.xml | grep 'property name="base.version"' | awk 
-F "\"" '{print $4}')
+DTEST_VERSION=$(cat relocate-dependencies.pom | grep "dtest-local.version>" | 
awk -F "\>|\<" '{print $3}')
+SHADED_DTEST_VERSION=$(cat relocate-dependencies.pom | grep -m 1 "<version>" | 
awk -F "\>|\<" '{print $3}')
+
+echo $CASSANDRA_VERSION
+echo $DTEST_VERSION
 
 ant clean
 ant dtest-jar
@@ -27,7 +29,7 @@ mvn -f relocate-dependencies.pom package -DskipTests -nsu
 
 # Deploy shaded artifact
 mvn install:install-file                 \
-   -Dfile=./target/${ARTIFACT_NAME}-shaded-${DTEST_VERSION}.jar \
+   -Dfile=./target/${ARTIFACT_NAME}-shaded-${SHADED_DTEST_VERSION}.jar \
    -DgroupId=org.apache.cassandra        \
    -DartifactId=${ARTIFACT_NAME}-shaded  \
    -Dversion=${DTEST_VERSION}            \
diff --git a/relocate-dependencies.pom b/relocate-dependencies.pom
index 0e5eabc..d6b4265 100644
--- a/relocate-dependencies.pom
+++ b/relocate-dependencies.pom
@@ -19,6 +19,7 @@
         <junit.version>4.12</junit.version>
         <maven.compiler.source>${java.version}</maven.compiler.source>
         <maven.compiler.target>${java.version}</maven.compiler.target>
+        <dtest-local.version>4.0.0-SNAPSHOT</dtest-local.version>
     </properties>
 
     <dependencies>
@@ -26,7 +27,7 @@
         <dependency>
             <groupId>org.apache.cassandra</groupId>
             <artifactId>cassandra-dtest-local</artifactId>
-            <version>4.0.0-SNAPSHOT</version>
+            <version>${dtest-local.version}</version>
         </dependency>
 
         <dependency>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to