Repository navigation
Expand file tree
/
Copy pathcreate-api-diff.sh
More file actions
executable file
·139 lines (115 loc) · 5.37 KB
/
Copy pathcreate-api-diff.sh
File metadata and controls
executable file
·139 lines (115 loc) · 5.37 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# Use the build container for testing to avoid OS specific interpretation:
# docker run -it -v $(pwd):/xtext -w /xtext eclipsecbi/jiro-agent-centos-8 bash
set -Eeuo pipefail
LOG_DIR=${LOG_DIR:-logs}
mkdir -p "$LOG_DIR"
VERSIONS=(2.44.0 2.43.0 2.42.0 2.41.0)
if [ -z "${DEV_VERSION:-}" ]; then
echo "Using fallback to retrieve DEV_VERSION"
DEV_VERSION=$(curl -sS https://raw.githubusercontent.com/eclipse/xtext/main/pom.xml|grep -Po "([0-9]+\.[0-9]+\.[0-9]+)-SNAPSHOT" |sed 's/-SNAPSHOT//')
fi
# The Eclipse release to use
# https://archive.eclipse.org/eclipse/downloads/drops4/R-4.38-202512010920/download.php?dropFile=eclipse-SDK-4.38-linux-gtk-x86_64.tar.gz
ECLIPSE_RELEASE=2025-12
ECLIPSE_TARGZ_FILE=eclipse-SDK-4.38-linux-gtk-x86_64.tar.gz
ECLIPSE_TARGZ_DOWNLOAD_URL=https://archive.eclipse.org/eclipse/downloads/drops4/R-4.38-202512010920/$ECLIPSE_TARGZ_FILE
ECLIPSE_XTEXT_VERSION=${VERSIONS[0]}
if [ -z "${NEW_VERSION:-}" ]; then
# if not set in environment use default
NEW_VERSION=$DEV_VERSION
fi
if [ -z "${OLD_VERSION:-}" ]; then
# if not set in environment use default
OLD_VERSION=${VERSIONS[0]}
fi
echo "Diffing $NEW_VERSION against $OLD_VERSION"
echo ""
echo "Current Xtext dev version is $DEV_VERSION"
if [ ! -d eclipse ]; then
echo "Downloading Eclipse"
# Get basic Eclipse SDK
curl -m 1200 -sL $ECLIPSE_TARGZ_DOWNLOAD_URL --output $ECLIPSE_TARGZ_FILE && tar -zxf $ECLIPSE_TARGZ_FILE
rm $ECLIPSE_TARGZ_FILE
echo "Installing additional features: Xtext and dependent"
eclipse/eclipse -data eclipse/.director-ws -consolelog -noSplash -clean \
-application org.eclipse.equinox.p2.director \
-metadataRepository https://download.eclipse.org/modeling/tmf/xtext/updates/releases/$ECLIPSE_XTEXT_VERSION,https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.27.0,https://download.eclipse.org/releases/$ECLIPSE_RELEASE,https://download.eclipse.org/lsp4j/updates/releases/1.0.0/,https://download.eclipse.org/tools/orbit/downloads/$ECLIPSE_RELEASE \
-artifactRepository https://download.eclipse.org/modeling/tmf/xtext/updates/releases/$ECLIPSE_XTEXT_VERSION,https://download.eclipse.org/modeling/emft/mwe/updates/releases/2.27.0,https://download.eclipse.org/releases/$ECLIPSE_RELEASE,https://download.eclipse.org/lsp4j/updates/releases/1.0.0/,https://download.eclipse.org/tools/orbit/downloads/$ECLIPSE_RELEASE \
-installIU org.eclipse.xtext.sdk.feature.group,org.eclipse.lsp4j.sdk.feature.group,org.eclipse.m2e.core,org.eclipse.buildship.core,org.kohsuke.args4j,org.eclipse.draw2d \
-destination eclipse
fi
download () {
local XTEXT_VERSION=$1
local DOWNLOAD_URL=$2
local ZIP_FILE=tmf-xtext-Update-$XTEXT_VERSION.zip
# For DEV version, check if already copied by Jenkins copyartifact plugin
if [[ "$XTEXT_VERSION" == "$DEV_VERSION" ]]; then
local pre_copied="org.eclipse.xtext.p2repository-${XTEXT_VERSION}-SNAPSHOT.zip"
if [ -f "$pre_copied" ]; then
echo "Using pre-copied artifact: $pre_copied"
unzip -oq "$pre_copied" -d "tmf-xtext-Update-${XTEXT_VERSION}"
return 0
fi
fi
if [ ! -d tmf-xtext-Update-$XTEXT_VERSION ]; then
echo "Downloading Xtext $XTEXT_VERSION from $DOWNLOAD_URL"
local DOWNLOAD_LOG_PREFIX="$LOG_DIR/download-$XTEXT_VERSION"
local HTTP_CODE=$(curl -m 1200 -sS -L \
-D "$DOWNLOAD_LOG_PREFIX.headers" \
-o "$ZIP_FILE" \
-w '%{http_code}' \
"$DOWNLOAD_URL")
{
echo "url=$DOWNLOAD_URL"
echo "http_code=$HTTP_CODE"
} > "$DOWNLOAD_LOG_PREFIX.meta"
if [ "$HTTP_CODE" != "200" ]; then
echo "Unexpected HTTP $HTTP_CODE: $DOWNLOAD_URL"
echo "Response headers were written to $DOWNLOAD_LOG_PREFIX.headers"
echo "Response body starts with:"
sed -n '1,40p' "$ZIP_FILE"
exit 1
fi
if ! unzip -t $ZIP_FILE > /dev/null 2>&1; then
echo "Downloaded file is not a valid zip: $DOWNLOAD_URL"
rm -f $ZIP_FILE
exit 1
fi
unzip -oq $ZIP_FILE -d tmf-xtext-Update-$XTEXT_VERSION
rm $ZIP_FILE
fi
}
# Download latest Xtext build
if [ -d tmf-xtext-Update-$DEV_VERSION ]; then
rm -r tmf-xtext-Update-$DEV_VERSION
fi
DOWNLOAD_URL=https://ci.eclipse.org/xtext/job/xtext/job/main/lastStableBuild/artifact/build/org.eclipse.xtext.p2repository-$DEV_VERSION-SNAPSHOT.zip
download $DEV_VERSION $DOWNLOAD_URL
# download NEW_VERSION and OLD_VERSION if not present
for VERSION in "${VERSIONS[@]}"; do
# only download relevant versions
if [ "$VERSION" == "$NEW_VERSION" ] || [ "$VERSION" == "$OLD_VERSION" ]; then
# Skip DEV_VERSION as it's handled above
if [ "$VERSION" == "$DEV_VERSION" ]; then
continue
fi
download "$VERSION" "https://download.eclipse.org/modeling/tmf/xtext/downloads/drops/$VERSION/tmf-xtext-Update-$VERSION.zip"
fi
done
echo ""
echo "Creating the actual diff"
# update apicmp.properties
{
echo "old.version=${OLD_VERSION}"
echo "new.version=${NEW_VERSION}"
echo "old.location=tmf-xtext-Update-${OLD_VERSION}/plugins/"
echo "new.location=tmf-xtext-Update-${NEW_VERSION}/plugins/"
echo "cpLocation=eclipse/plugins"
} > japicmp.properties
echo "using japicmp.properties"
cat japicmp.properties
echo ""
echo "calling java -Xmx2G -jar japicmp-ext.jar"
rm -rf output
java -Xmx2G -jar japicmp-ext.jar