Skip to content

Commit 39e540a

Browse files
committed
Add standalone MAT CLI package and release workflow
1 parent dfbf1a0 commit 39e540a

44 files changed

Lines changed: 2665 additions & 105 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release-cli.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release MAT CLI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
env:
13+
MAVEN_VERSION: 3.9.12
14+
15+
jobs:
16+
release_cli:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Java
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
architecture: x64
28+
29+
- name: Install Apache Maven 3.9
30+
run: |
31+
curl -s -L https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz | tar xzf - -C /opt/
32+
echo "/opt/apache-maven-${MAVEN_VERSION}/bin/" >> $GITHUB_PATH
33+
echo "MAVEN_HOME=/opt/apache-maven-${MAVEN_VERSION}/bin/" >> $GITHUB_ENV
34+
35+
- name: Build standalone MAT CLI zip
36+
run: |
37+
cd parent
38+
mvn --version
39+
mvn clean package -DskipTests -Dmat-product=mat-cli -Dmaven.repo.local="${RUNNER_TEMP}/m2"
40+
41+
- name: Prepare release asset
42+
run: |
43+
mkdir -p release-assets
44+
cp org.eclipse.mat.product/target/extraArtifacts/mat-cli.zip "release-assets/mat-cli-${GITHUB_REF_NAME}.zip"
45+
46+
- name: Upload release asset
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: mat-cli-${{ github.ref_name }}
50+
path: release-assets/mat-cli-${{ github.ref_name }}.zip
51+
52+
- name: Publish GitHub release
53+
if: github.event_name == 'push'
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
files: release-assets/mat-cli-${{ github.ref_name }}.zip
57+
generate_release_notes: true
58+
name: MAT CLI ${{ github.ref_name }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
bin.includes = feature.xml,\
2+
build.properties
3+
4+
root=file:rootfiles/notice.html,\
5+
file:rootfiles/.eclipseproduct
6+
7+
root.win32.win32.x86_64=file:rootfiles/win32/mat-cli.bat
8+
9+
root.linux.gtk.x86_64=file:rootfiles/linux/mat-cli
10+
root.linux.gtk.x86_64.permissions.755=mat-cli
11+
12+
root.linux.gtk.ppc64le=file:rootfiles/linux/mat-cli
13+
root.linux.gtk.ppc64le.permissions.755=mat-cli
14+
15+
root.linux.gtk.aarch64=file:rootfiles/linux/mat-cli
16+
root.linux.gtk.aarch64.permissions.755=mat-cli
17+
18+
root.macosx.cocoa.x86_64=file:rootfiles/macosx/mat-cli
19+
root.macosx.cocoa.x86_64.permissions.755=mat-cli
20+
21+
root.macosx.cocoa.aarch64=file:rootfiles/macosx/mat-cli
22+
root.macosx.cocoa.aarch64.permissions.755=mat-cli
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2026 Eclipse Memory Analyzer Project.
4+
All rights reserved. This program and the accompanying materials
5+
are made available under the terms of the Eclipse Public License 2.0
6+
which accompanies this distribution, and is available at
7+
https://www.eclipse.org/legal/epl-2.0/
8+
9+
SPDX-License-Identifier: EPL-2.0
10+
-->
11+
<feature
12+
id="org.eclipse.mat.cli.feature"
13+
label="Memory Analyzer CLI"
14+
version="1.17.0.qualifier"
15+
provider-name="Eclipse Memory Analyzer Project"
16+
plugin="org.eclipse.mat.cli">
17+
18+
<description>
19+
Headless command line distribution for Eclipse Memory Analyzer.
20+
</description>
21+
22+
<copyright>
23+
Copyright (c) 2026 Eclipse Memory Analyzer Project.
24+
</copyright>
25+
26+
<license url="https://www.eclipse.org/legal/epl-2.0/">
27+
Eclipse Public License 2.0
28+
</license>
29+
30+
<plugin
31+
id="org.eclipse.mat.cli"
32+
version="0.0.0"
33+
unpack="false"/>
34+
35+
<plugin
36+
id="org.eclipse.mat.report"
37+
version="0.0.0"
38+
unpack="false"/>
39+
40+
<plugin
41+
id="org.eclipse.mat.api"
42+
version="0.0.0"
43+
unpack="false"/>
44+
45+
<plugin
46+
id="org.eclipse.mat.parser"
47+
version="0.0.0"
48+
unpack="false"/>
49+
50+
<plugin
51+
id="org.eclipse.mat.hprof"
52+
version="0.0.0"
53+
unpack="false"/>
54+
55+
</feature>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2026 Eclipse Memory Analyzer Project.
4+
All rights reserved. This program and the accompanying materials
5+
are made available under the terms of the Eclipse Public License 2.0
6+
which accompanies this distribution, and is available at
7+
https://www.eclipse.org/legal/epl-2.0/
8+
9+
SPDX-License-Identifier: EPL-2.0
10+
-->
11+
<project xmlns="http://maven.apache.org/POM/4.0.0"
12+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
14+
<modelVersion>4.0.0</modelVersion>
15+
16+
<parent>
17+
<groupId>org.eclipse.mat</groupId>
18+
<artifactId>parent</artifactId>
19+
<relativePath>../../parent</relativePath>
20+
<version>1.17.0-SNAPSHOT</version>
21+
</parent>
22+
23+
<artifactId>org.eclipse.mat.cli.feature</artifactId>
24+
<packaging>eclipse-feature</packaging>
25+
</project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name=Eclipse Memory Analyzer CLI
2+
id=org.eclipse.mat.cli
3+
version=1.17.0
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Run the Eclipse Memory Analyzer CLI application.
4+
#
5+
6+
DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
7+
JAVA_CMD=java
8+
LAUNCHER_JAR=
9+
10+
if [ -n "$JAVA_HOME" ]; then
11+
JAVA_CMD="$JAVA_HOME/bin/java"
12+
fi
13+
14+
for candidate in "$DIR"/plugins/org.eclipse.equinox.launcher_*.jar
15+
do
16+
if [ -f "$candidate" ]; then
17+
LAUNCHER_JAR="$candidate"
18+
break
19+
fi
20+
done
21+
22+
if [ -z "$LAUNCHER_JAR" ]; then
23+
echo "Unable to locate org.eclipse.equinox.launcher_*.jar under $DIR/plugins" >&2
24+
exit 1
25+
fi
26+
27+
if [ -n "$MAT_CLI_VMARGS" ]; then
28+
exec "$JAVA_CMD" $MAT_CLI_VMARGS -jar "$LAUNCHER_JAR" -configuration "$DIR/configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app "$@"
29+
fi
30+
31+
exec "$JAVA_CMD" -Xmx1024m -jar "$LAUNCHER_JAR" -configuration "$DIR/configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app "$@"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
#
3+
# Run the Eclipse Memory Analyzer CLI application.
4+
#
5+
6+
DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
7+
JAVA_CMD=java
8+
LAUNCHER_JAR=
9+
10+
if [ -n "$JAVA_HOME" ]; then
11+
JAVA_CMD="$JAVA_HOME/bin/java"
12+
fi
13+
14+
for candidate in "$DIR"/plugins/org.eclipse.equinox.launcher_*.jar
15+
do
16+
if [ -f "$candidate" ]; then
17+
LAUNCHER_JAR="$candidate"
18+
break
19+
fi
20+
done
21+
22+
if [ -z "$LAUNCHER_JAR" ]; then
23+
echo "Unable to locate org.eclipse.equinox.launcher_*.jar under $DIR/plugins" >&2
24+
exit 1
25+
fi
26+
27+
if [ -n "$MAT_CLI_VMARGS" ]; then
28+
exec "$JAVA_CMD" $MAT_CLI_VMARGS -jar "$LAUNCHER_JAR" -configuration "$DIR/configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app "$@"
29+
fi
30+
31+
exec "$JAVA_CMD" -Xmx1024m -jar "$LAUNCHER_JAR" -configuration "$DIR/configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app "$@"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Memory Analyzer CLI</title>
6+
</head>
7+
<body>
8+
<p>Eclipse Memory Analyzer CLI distribution.</p>
9+
</body>
10+
</html>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@echo off
2+
REM
3+
REM Run the Eclipse Memory Analyzer CLI application.
4+
REM
5+
6+
setlocal
7+
set _DIRNAME=.\
8+
if "%OS%" == "Windows_NT" set _DIRNAME=%~dp0%
9+
set _JAVA=java
10+
set _LAUNCHER=
11+
12+
if defined JAVA_HOME set _JAVA=%JAVA_HOME%\bin\java.exe
13+
14+
for %%I in ("%_DIRNAME%plugins\org.eclipse.equinox.launcher_*.jar") do (
15+
if exist "%%~fI" (
16+
set _LAUNCHER=%%~fI
17+
goto launcher_found
18+
)
19+
)
20+
21+
>&2 echo Unable to locate org.eclipse.equinox.launcher_*.jar under "%_DIRNAME%plugins"
22+
exit /b 1
23+
24+
:launcher_found
25+
26+
if defined MAT_CLI_VMARGS (
27+
"%_JAVA%" %MAT_CLI_VMARGS% -jar "%_LAUNCHER%" -configuration "%_DIRNAME%configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app %*
28+
) else (
29+
"%_JAVA%" -Xmx1024m -jar "%_LAUNCHER%" -configuration "%_DIRNAME%configuration" -nosplash -product org.eclipse.mat.cli.product -application org.eclipse.mat.cli.app %*
30+
)
31+
32+
endlocal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
properties.0.name = org.eclipse.equinox.p2.description
2+
properties.0.value = Eclipse Memory Analyzer CLI is a headless Java heap analyzer package for command line use.
3+
properties.1.name = org.eclipse.equinox.p2.provider
4+
properties.1.value = Eclipse Memory Analyzer
5+
instructions.configure=\
6+
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/readme);\
7+
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/artifacts.xml);\
8+
setProgramProperty(propName:osgi.requiredJavaVersion,propValue:17);

0 commit comments

Comments
 (0)