This repository contains a collection of shell scripts designed to assist in analyzing, maintaining, and optimizing Eclipse RCP (Rich Client Platform) applications and Maven-based builds.
Visualizes the dependency tree of Eclipse Products and Features. It builds a graph showing how products include features, and how features include/require other features.
- Purpose: To understand the structure of your application, identify deep dependencies, and detect cycles.
- Usage:
./feature-dependency-graph.sh [directory] - Key Features:
- Scans
.productandfeature.xmlfiles. - Visualizes
includesandrequiresrelationships. - Aggregates plugin counts per feature.
- Detects and flags external (missing) dependencies.
- Supports targeting a specific root feature ID.
- Scans
Compares entries in an Eclipse Target Platform file (.target) against the actual Maven dependency tree.
- Purpose: To identify unused or extraneous entries in your Target Platform definition that are not actually being pulled in by the Maven build.
- Usage:
./target-platform-analysis.sh <target-file.target> [maven-tree-output.txt] - Key Features:
- Parses standard Eclipse
.targetfiles. - Can automatically generate a Maven dependency tree (requires
mvnin path). - Highlights target entries missing from the build dependencies.
- Parses standard Eclipse
Extracts entries from a Target Platform file and searches for their usage directly within the MANIFEST.MF files of your workspace bundles.
- Purpose: To identify "potentially unnecessary" target entries by checking if any local bundle actually imports packages or bundles provided by the target entries.
- Usage:
./target-platform-manifest-search.sh <target-file.target> [search-directory] - Key Features:
- Deep scan of
MANIFEST.MFfiles (Require-Bundle, Import-Package). - Reports target entries that appear to be unused by any local source code.
- Deep scan of
Identifies bundles that appear in the resolved Tycho target platform under more than one version, by parsing the output of mvn dependency:tree in a Tycho reactor.
- Purpose: To detect version conflicts in the target platform (same symbolic name resolved to multiple versions), which typically cause hard-to-diagnose runtime issues.
- Usage:
./target-platform-duplicates.sh [options] [dependency-tree-file] - Key Features:
- With no arguments, runs
mvn -B dependency:treeand parses its output. - Alternatively accepts a captured log (
mvn -B dependency:tree | tee deptree.log), so Maven can be run once and reused across invocations. - Extracts
p2.eclipse-plugin:<bsn>:...:<version>:systemlines (andp2.eclipse-feature:...with-f), groups them by symbolic name, and reports any id resolved to more than one version. -f/--featuresincludes feature IUs; by default only plug-ins are considered.-a/--alladditionally prints the full symbolic-name inventory.- Works on Linux and Windows (Git Bash, WSL, Cygwin).
- With no arguments, runs
Scans the codebase for binary artifacts such as images, documents, archives, and compiled binaries.
- Purpose: To audit the repository for large or unwanted binary files, counting them and calculating their total size.
- Usage:
./scan_for_binary_artifacts.sh [directory] - Key Features:
- Categorizes files (Images, Docs, Archives, Binaries).
- Calculates counts and total size per category.
- Useful for repo cleanup and size optimization.
Recursively finds pom.xml files and comments out modules ending in .feature.
- Purpose: To quickly disable feature modules from a Maven build, typically for creating stripped-down builds or debugging build issues.
- Usage:
./remove-features-from-build.sh [directory] [--apply] - Key Features:
- Dry Run: By default, it only lists what it would change.
- Apply Mode: Use
--applyto actually modify thepom.xmlfiles. - Comments out
<module>...feature</module>lines.
Analyzes build times from a build output file.
- Purpose: To extract and analyze timing information from build logs to identify performance bottlenecks.
- Usage:
python3 analyze_build_times.py <file_path> - Key Features:
- Parses various time formats (e.g., "5.990 s", "01:50 min", "1.5 min").
- Takes a build output file as input.
Recursively analyzes Eclipse RCP projects (plugins, features, products) within a given workspace path and generates a Markdown report.
- Purpose: To get a comprehensive overview of an Eclipse RCP workspace, including project types, versions, and code statistics.
- Usage:
./eclipse-project-analyser.sh <workspace-path> [output-file] - Key Features:
- Identifies plugin projects (
META-INF/MANIFEST.MF,plugin.xml). - Identifies feature projects (
feature.xml). - Identifies product definitions (
.productfiles). - Extracts names, versions, and counts Java files.
- Generates a detailed Markdown report with summaries, project lists, statistics, and a directory structure.
- Ignores common build/version control directories (
.git,target,bin, etc.).
- Identifies plugin projects (
Counts lines of Java code, separating production code from test code, and provides statistics per project and overall.
- Purpose: To get a detailed breakdown of Java code lines, distinguishing between production and test code, and identifying code size per project.
- Usage:
./java-class-counter.sh [directory] - Key Features:
- Distinguishes between production and test code based on file path (e.g.,
test/,tests/). - Counts total lines, code lines, blank lines, and comment lines.
- Provides statistics for each detected project.
- Calculates a "Test-Code-Ratio" (Test-Lines / Prod-Lines).
- Distinguishes between production and test code based on file path (e.g.,
Scans for .jar files within lib or libs directories and generates a Markdown report.
- Purpose: To audit third-party dependencies packaged as JARs within projects, identify their locations, and get a global overview of unique JARs and their usage frequency.
- Usage:
./scan_jars.sh [directory] - Key Features:
- Recursively searches for
liborlibsdirectories, excluding common build/version control directories. - Generates a Markdown report (
jar_dependencies_report.md). - Lists JAR files found within each identified plugin's
lib/libsdirectory. - Provides a global summary of unique JARs and their occurrence count.
- Recursively searches for
Recursively searches all MANIFEST.MF files for the usage of a certain library (e.g., riena) in Require-Bundle and Import-Package headers.
- Purpose: To find where a specific library or package is referenced across all Eclipse plugins in a repository.
- Usage:
./search_manifest_usage.sh <search-directory> <library-name> - Key Features:
- Parses multi-line
MANIFEST.MFheaders correctly. - Searches both
Require-BundleandImport-Package. - Highlights the matching entry in the output.
- Case-insensitive: The search is case-insensitive.
- Works on Linux and Windows.
- Parses multi-line
Removes ;visibility:=reexport from MANIFEST.MF files for Eclipse plug-ins and generates a report.
- Purpose: To eliminate re-exporting of bundles, promoting cleaner dependency management and reducing unnecessary classpath exposure.
- Usage:
./remove_reexports.sh [--dry-run] - Key Features:
- Recursively scans for
MANIFEST.MFfiles. - Correctly handles complex
Require-Bundleentries, including version ranges with commas. - Generates a detailed report: "Re-exported plug-in" | "Exported by:".
- Dry Run: Use
--dry-runto generate the report without modifying files. - Works on Linux and Windows (Git Bash).
- Recursively scans for
Recursively finds .classpath files and replaces the JRE container entry that has module attributes with a standard JavaSE-17 entry.
- Purpose: To standardize the JRE container configuration across Eclipse projects, ensuring they all use
JavaSE-17, and to remove specific module attributes that might cause issues or inconsistencies. - Usage:
./update_jre_container.sh [directory] [--dry-run] - Key Features:
- Configurable Search Path: Allows specifying a root directory to scan (defaults to the current directory).
- Dry Run Mode: Use
--dry-runto preview which files would be updated without modifying them. - Recursive Search: Finds all
.classpathfiles in the specified directory and subdirectories. - Multi-line Replacement: Correctly identifies and replaces JRE container entries even when split across multiple lines with indentation.
- Preserves Indentation: Maintains the original file's indentation (tabs/spaces) for the replaced entry.
Updates an Eclipse installation with locally built SWT jars and native libraries. Patches the Bundle-Version in the built jars to match the installed version so that OSGi resolution continues to work.
- Purpose: To quickly test local SWT changes in a full Eclipse installation.
- Usage:
./update-eclipse-swt.sh [ECLIPSE_DIR] - Key Features:
- Version Patching: Automatically matches the
Bundle-Versionto the installed one. - Automatic Backups: Creates
.bakfiles of original jars before replacement. - Supports GTK/Linux: Specifically targets
org.eclipse.swtandorg.eclipse.swt.gtk.linux.x86_64. - Cleanup: Provides instructions to restore original jars.
- Version Patching: Automatically matches the
A set of Python heuristics to find dead code in large Java source trees such as the Eclipse Platform.
- Purpose: To surface classes, public/protected constants, unused
imports, and dead private members that can be cleaned up, especially in
internalpackages. - Tools:
find_dead_classes.py- classes never referenced outside their own definition.find_dead_constants.py-public/protected static finalconstants never used.find_unused_imports.py- unused imports, with a--fixmode.find_dead_private.py- private methods never called and private fields never read.
- Usage:
python3 dead-code-detector/find_dead_classes.py <root> [extra_roots ...]ordead-code-detector/run_all.sh <root>. - Key Features:
- Resolves references through imports and package names, so classes
sharing a simple name (e.g.
Activator,Messages) are not confused. - Extra roots can be given so usage from other repositories is counted.
--internal-onlyfilters to packages containinginternal;--skip-testsignores test classes that JUnit runs by name pattern.- Results are candidates for review, tagged
HIGH(conclusive) orVERIFY(name collision, manual check needed), and carry the line number. - Runs the whole of
eclipse.pdein seconds;--jobsspreads the parse over worker processes and--fail-on-findingsgates a CI job.
- Resolves references through imports and package names, so classes
sharing a simple name (e.g.
A sampling profiler for Eclipse startup and UI freezes, built on repeated JVM thread dumps. Linux and Windows versions with the same options and output.
- Purpose: To turn a vague "the IDE hangs on startup" into a named method, by taking many thread dumps in a row instead of one. A call that appears in twenty consecutive samples is the freeze; a call that appears once is noise.
- Tools:
profile-eclipse-startup.sh/.ps1- start Eclipse, sample a thread while it comes up, write every dump to a file and print a summary.show-blocking-stack.sh/.ps1- print the full stack of the samples matching a regex.
- Usage:
trace-startup/profile-eclipse-startup.sh --eclipse /path/to/eclipse --data ~/workspace/platform - Key Features:
- Prints a timeline, the most frequent triggering frame, the hottest leaf
frames, and an inclusive cost ranking;
--untilrestricts all of them to the startup window so the idle event loop does not dominate. --threadmatches on a prefix, so--thread "Start Level"reaches the Equinox thread whose name carries a per run UUID. Needed because a long stall can show up as a flat idle wait onmain.- Linux samples via
kill -QUITrather thanjcmd, avoiding a JVM start per sample and allowing a 50 ms interval; both methods produce the same format. --pidattaches to an already running IDE, for freezes rather than startup.- Requires a JDK for
jcmd; seetrace-startup/README.mdfor the caveats.
- Prints a timeline, the most frequent triggering frame, the hottest leaf
frames, and an inclusive cost ranking;
Most scripts are written in Bash. trace-startup/ additionally ships PowerShell
versions for Windows, and dead-code-detector/ is Python. They are compatible with:
- Linux
- Windows (via Git Bash, WSL, or Cygwin)
- macOS (Requires Bash 4.0+ for associative array support in some scripts)
- Bash 4.0+
- Python 3 (Required for
analyze_build_times.pyanddead-code-detector/) - Perl (Required for
remove_reexports.shandupdate_jre_container.sh) - Standard GNU tools:
awk,sed,grep,find,sort - Maven (
mvn) (Required only fortarget-platform-analysis.shif generating tree automatically) - A JDK for
jcmd(Required fortrace-startup/) - PowerShell 5.1+ (Required only for the Windows scripts in
trace-startup/)