$ show eclipse-tycho/tycho
Eclipse Tycho is a Maven-based build tool for Eclipse plug-ins, OSGi bundles, features, p2 repositories, and RCP applications. It integrates with the Eclipse p2 provisioning system to resolve dependencies, generate metadata, and package artifacts. The architecture is a collection of Maven plugins (mojos) that extend the standard Maven lifecycle with OSGi-specific phases. Key entry points include the compiler plugin (tycho-compiler-plugin), packaging plugin (tycho-packaging-plugin), p2 metadata plugin (tycho-p2-plugin), surefire test runner (tycho-surefire), and version management plugin (tycho-versions-plugin). Data flows involve reading OSGi manifests, feature.xml, product files, and target definitions, resolving dependencies from p2 repositories and Maven artifacts, compiling with JDT, generating p2 metadata, and producing deployable artifacts. External dependencies include Eclipse Equinox/p2, bnd, ASM, JDT, and Maven core. The codebase is large and mature, with extensive integration tests and demo projects, but contains some copied p2 internals and deprecated APIs.
The LLM identified 5 files worth highlighting for reuse:
A self-contained utility that reads, updates, and writes Eclipse JDT cleanup preferences (.prefs files). It implements AutoCloseable for safe write-back, uses a KV record to parse key=value lines, supports prefix-based updates (e.g., sp_ for save actions), and only writes to disk if changes are detected. This pattern is reusable for any build-time configuration file manipulation where idempotent updates are needed.
An abstract base class for discovering Maven projects without a pom.xml by scanning for XML files (e.g., feature.xml, product files). It provides a generic pattern for mapping file extensions to Maven packaging types and artifact coordinates. The implementation handles file filtering, XML parsing, and model creation, and can be extended for custom file types. This is reusable for any build system that needs to auto-discover projects based on file presence.
A comparator that performs line-ending-insensitive text comparison by scanning bytes directly, avoiding readLine() overhead. It normalizes line endings (CR, LF, CRLF) and compares lines without loading the entire file into memory. This is reusable for any artifact comparison or diff tool where text files may have inconsistent line endings.
A file locking service that uses FileChannel.tryLock() with configurable timeout and retry logic. It supports both VM-level and file-level locks, with a LockTimeoutException for deadlock detection. The implementation is thread-safe and can be extracted for any application needing distributed or inter-process file locking with timeout.
A utility class for building Markdown-formatted strings programmatically. It provides methods for headings, lists, code blocks, tables, and links, with proper escaping. This is a lightweight, dependency-free alternative to full Markdown libraries, suitable for generating build reports or documentation snippets.