Skip to content

Commit 111d75f

Browse files
committed
fix(utility): Fix shebang and script filepath when generating API diff
1 parent 4e8a930 commit 111d75f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.utility/generate-api-diff.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Author: Hanbin Cho ([email protected])
33
# Description: This script 1) downloads the latest java-sdk jar published in Maven Repo 2) builds the jar of current java-sdk version, then 3) generate an API diff report of the two versions.
44
# Assumptions
5-
# 1. This script is placed in the project root of java-sdk.
5+
# 1. This script is placed in .utility folder of the java-sdk.
66
# 2. Version format is [0-9].[0-9].[0-9]
77

88
# Step 1: Download the latest release of java-sdk published in Maven Repository.
@@ -34,7 +34,7 @@ popd
3434
./gradlew shadowJar
3535

3636
# Step 5: Construct the filepath to the current version of java-sdk.
37-
CURRENT_VERSION=`cat gradle.properties | grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2`
37+
CURRENT_VERSION=`cat ../gradle.properties | grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2`
3838
CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar"
3939
CURRENT_JAR_BASEPATH="java-sdk/build/libs"
4040
CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}"
@@ -46,5 +46,4 @@ if [ ! -f $CURRENT_JAR_PATH ]; then
4646
fi
4747

4848
# Step 7: Produce an API diff between the latest release and the current version using japicmp module.
49-
# TODO: Figure out how to set japicmp task's properties (oldClasspath and newClasspath) through command-line invocation.
5049
./gradlew japicmp -PoldJarPath="${LATEST_RELEASE_JAR_PATH}" -PnewJarPath="${CURRENT_JAR_PATH}" -PoldJarVersion="${LATEST_RELEASE_VERSION}" -PnewJarVersion="${CURRENT_VERSION}"

0 commit comments

Comments
 (0)