GeezerVison is showing github.com — fix(utility): Fix shebang and script filepath when generating API diff · morristech/java-sdk@111d75f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .utility/generate-api-diff.sh +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -#!/bin/bash |
| 1 | +#!/usr/bin/env bash |
2 | 2 | |
3 | 3 | # 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. |
4 | 4 | # 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. |
6 | 6 | # 2. Version format is [0-9].[0-9].[0-9] |
7 | 7 |
|
8 | 8 | # Step 1: Download the latest release of java-sdk published in Maven Repository. |
|
34 | 34 | ./gradlew shadowJar |
35 | 35 |
|
36 | 36 | # 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` |
38 | 38 | CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar" |
39 | 39 | CURRENT_JAR_BASEPATH="java-sdk/build/libs" |
40 | 40 | CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}" |
@@ -46,5 +46,4 @@ if [ ! -f $CURRENT_JAR_PATH ]; then |
46 | 46 | fi |
47 | 47 |
|
48 | 48 | # 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. |
50 | 49 | ./gradlew japicmp -PoldJarPath="${LATEST_RELEASE_JAR_PATH}" -PnewJarPath="${CURRENT_JAR_PATH}" -PoldJarVersion="${LATEST_RELEASE_VERSION}" -PnewJarVersion="${CURRENT_VERSION}" |