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
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.
These scripts are written in Bash and 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.py) - 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)