Skip to content

abraham-ny/Junkie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Junkie — Java Project Converter

Convert Java projects between IDE formats and build systems.

Eclipse ↔ NetBeans ↔ IntelliJ IDEA
Maven   ↔ Gradle   ↔ Ant

Overview

Junkie is a cross-platform desktop tool built with Java Swing that converts Java project metadata between the three major Java IDEs and the three major build systems. It scans your project directory, detects what format it's already in, then rewrites only the IDE or build configuration files — leaving your actual source code completely untouched.

The heavy file-processing work (XML generation, project file parsing) is handled by a companion Go binary (junkie-bridge) that runs as a subprocess. Java drives the UI and orchestrates tasks; Go handles the file work and streams structured JSON progress messages back to the UI in real time.


Features

Capability Details
IDE → IDE Eclipse, NetBeans, IntelliJ IDEA (any direction)
Build → Build Maven (pom.xml), Gradle (build.gradle), Ant (build.xml)
Project scanner Detects current IDE + build system, reads group/artifact/version
Real-time log Color-coded task log with progress bar, streaming from Go bridge
Dark theme UI Custom-painted Swing components, no external UI libraries
Cross-platform Windows, macOS, Linux — no hardcoded paths
Zero dependencies Pure JDK + Go stdlib — no Maven Central required to run

Requirements

Tool Minimum Version Notes
Java 17 For running the JAR
Go 1.18 For building the bridge binary
javac 17 For building the JAR

Quick Start

Linux / macOS

git clone <repo>
cd junkie

# Build everything and launch
chmod +x junkie.sh
./junkie.sh

# Or step by step:
./junkie.sh build    # compile Go bridge + Java JAR
./junkie.sh run      # run (rebuilds if needed)

Windows

junkie.bat           :: Build everything and launch
junkie.bat build     :: Compile only
junkie.bat run       :: Run (rebuilds if needed)

Project Structure

junkie/
├── src/main/java/com/vitalsoft/junkie/
│   ├── Main.java                      ← Application entry point
│   ├── model/
│   │   ├── ProjectInfo.java           ← Scanned project data model
│   │   ├── BridgeMessage.java         ← JSON IPC message model
│   │   └── TaskLogEntry.java          ← Log entry model
│   ├── bridge/
│   │   └── GoBridgeRunner.java        ← Launches + communicates with Go binary
│   ├── util/
│   │   ├── JsonParser.java            ← Lightweight JSON parser (no deps)
│   │   └── Platform.java             ← Cross-platform OS utilities
│   └── ui/
│       ├── Theme.java                 ← Dark theme color/font constants
│       ├── Components.java            ← Styled Swing component factory
│       ├── MainWindow.java            ← Main JFrame, tab layout
│       ├── ProjectScannerPanel.java   ← Directory picker + scan
│       ├── ProjectInfoCard.java       ← Displays scanned project metadata
│       ├── IDEConversionPanel.java    ← IDE format converter UI
│       ├── BuildConversionPanel.java  ← Build system converter UI
│       └── TaskLogPanel.java          ← Live log + progress bar
│
├── go-bridge/
│   ├── main.go                        ← Go bridge (scan, IDE convert, build convert)
│   └── go.mod
│
├── pom.xml                            ← Maven build (optional, for IDE users)
├── junkie.sh                          ← Linux/macOS build + run script
├── junkie.bat                         ← Windows build + run script
└── target/
    ├── junkie.jar                     ← Compiled application
    └── junkie-bridge[.exe]            ← Go binary (copied here after build)

Architecture — Java ↔ Go Bridge

The Go binary is a long-running subprocess launched per-operation. It communicates exclusively via stdout JSON lines. Each line is a single JSON object:

{"type":"progress","percent":40,"text":"Detecting build system..."}
{"type":"log","text":"Written: .project"}
{"type":"error","text":"Cannot read directory"}
{"type":"result","text":"Scan complete","payload":{...}}

GoBridgeRunner.java launches the process, reads stdout line-by-line, parses each message, and dispatches it to the UI via callbacks — all on background threads using CompletableFuture. The Swing EDT is updated via SwingUtilities.invokeLater.

Go bridge commands

Command Arguments What it does
scan <project-path> Detect IDE, build, source dirs, metadata
convert <path> <from-ide> <to-ide> Remove old IDE files, generate new ones
build-convert <path> <from-build> <to-build> Remove old build files, generate new

What Gets Converted

IDE Conversions

From/To Files Written
Eclipse .project, .classpath, .settings/org.eclipse.jdt.core.prefs
NetBeans nbproject/project.xml, nbproject/project.properties
IntelliJ .idea/misc.xml, .idea/modules.xml, .idea/.gitignore, <name>.iml

Existing IDE files are removed first. Source code is never modified.

Build System Conversions

Target Files Written Notes
Maven pom.xml Group ID, artifact ID, version, Java version preserved
Gradle build.gradle, settings.gradle Groovy DSL, mavenCentral() by default
Ant build.xml Compile/jar/dist targets, no dep mgmt

Dependencies are not migrated. After a build system conversion, you need to re-add your dependencies to the new file. The tool preserves metadata but cannot safely map between Maven coordinates, Gradle blocks, and Ant lib/ JARs.


IDE & Build Combinations

You can run an IDE conversion and a build system conversion independently or in sequence. The tool does not force you to change both at once.


Bridge Binary Location

The Java app searches for junkie-bridge (or junkie-bridge.exe on Windows) in:

  1. The current working directory
  2. A go-bridge/ subdirectory
  3. The classpath root
  4. The system PATH

If not found, a warning dialog appears on startup with build instructions.


License

MIT — see LICENSE file.

About

A Java project converter with a GUI (cross-ide, cross-build sys). Can convert NetBeans, JetBrains and Eclipse projects and also Ant, Maven and Gradle projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors