GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-sdk/.utility/generate-api-diff.sh at master · morristech/java-sdk

Expand file tree

/

generate-api-diff.sh

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
executable file
·
49 lines (42 loc) · 2.28 KB
/

generate-api-diff.sh

Copy path

File metadata and controls

executable file
·
49 lines (42 loc) · 2.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Author: Hanbin Cho ([email protected])
# 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.
# Assumptions
# 1. This script is placed in .utility folder of the java-sdk.
# 2. Version format is [0-9].[0-9].[0-9]
# Step 1: Download the latest release of java-sdk published in Maven Repository.
mvn dependency:get \
-DgroupId=com.ibm.watson.developer_cloud \
-DartifactId=java-sdk \
-Dversion=LATEST \
-Dpackaging=jar \
-Dclassifier=jar-with-dependencies \
-Dtransitive=false
# Step 2: Construct the filepath to the latest release of java-sdk.
LOCAL_MAVEN_REPO_PATH="${HOME}/.m2/repository"
RELEASE_JAR_BASEPATH="${LOCAL_MAVEN_REPO_PATH}/com/ibm/watson/developer_cloud/java-sdk"
pushd $RELEASE_JAR_BASEPATH
LATEST_RELEASE_VERSION=$(ls | grep -d read "[0-9]\.[0-9]\.[0-9]" | sort | tail -n 1)
LATEST_RELEASE_JAR_FILENAME="java-sdk-${LATEST_RELEASE_VERSION}-jar-with-dependencies.jar"
LATEST_RELEASE_JAR_PATH="${RELEASE_JAR_BASEPATH}/${LATEST_RELEASE_VERSION}/${LATEST_RELEASE_JAR_FILENAME}"
# Step 3: Validate the filepath to the latest release of java-sdk.
if [ ! -f $LATEST_RELEASE_JAR_PATH ]; then
echo "apidiff.sh: Latest release jar was not at its expected location at: $LATEST_RELEASE_JAR_PATH"
popd
exit 1
fi
popd
# Step 4: Generate a stand-alone jar of the current version of java-sdk.
./gradlew shadowJar
# Step 5: Construct the filepath to the current version of java-sdk.
CURRENT_VERSION=$(< ../gradle.properties grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2)
CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar"
CURRENT_JAR_BASEPATH="java-sdk/build/libs"
CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}"
# Step 6: Validate the filepath to the current version of java-sdk.
if [ ! -f $CURRENT_JAR_PATH ]; then
echo "apidiff.sh: Current jar was not at its expected location at: $CURRENT_JAR_PATH"
exit 1
fi
# Step 7: Produce an API diff between the latest release and the current version using japicmp module.
./gradlew japicmp -PoldJarPath="${LATEST_RELEASE_JAR_PATH}" -PnewJarPath="${CURRENT_JAR_PATH}" -PoldJarVersion="${LATEST_RELEASE_VERSION}" -PnewJarVersion="${CURRENT_VERSION}"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.