Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,18 @@ nbactions.xml
.classpath
.project
.settings
.vscode
.vscode

# macOS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# macOS app build artifacts
distribution/macos/Digital.app/
distribution/macos/icon.icns
distribution/macos/jpackage-input/
106 changes: 106 additions & 0 deletions distribution/macos/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Makefile for macOS distribution automation of Digital Circuit Simulator

.PHONY: all clean icon input app help install test

# Default target
all: app

# Help
help:
@echo "🚀 Digital Circuit Simulator - macOS Automation"
@echo "==============================================="
@echo ""
@echo "Available targets:"
@echo " all - Create complete app (default)"
@echo " app - Create Digital.app"
@echo " icon - Generate only .icns icon"
@echo " input - Prepare only input directory"
@echo " clean - Clean all generated files"
@echo " install - Install app in /Applications"
@echo " test - Test created app"
@echo " help - Show this help"
@echo ""
@echo "Examples:"
@echo " make app # Create complete app"
@echo " make clean app # Clean and recreate app"
@echo " make install # Install app in /Applications"

# Cleanup
clean:
@echo "🧹 Cleaning generated files..."
@rm -rf Digital.app
@rm -rf jpackage-input
@rm -f icon.icns
@echo "✅ Cleanup completed"

# Icon generation
icon:
@echo "🎨 Generating macOS icon..."
@./generate-icon.sh

# Input preparation
input:
@echo "📁 Preparing input directory..."
@./prepare-input.sh

# Complete app creation
app:
@echo "🚀 Creating Digital.app..."
@./create-digital-app.sh

# Installation in /Applications
install: app
@echo "📱 Installing in /Applications..."
@if [ -d "/Applications/Digital.app" ]; then \
echo " 🗑️ Removing existing version..."; \
rm -rf "/Applications/Digital.app"; \
fi
@cp -r Digital.app /Applications/
@echo "✅ Digital.app installed in /Applications"

# App testing
test: app
@echo "🧪 Testing created app..."
@if [ -d "Digital.app" ]; then \
echo " ✅ Digital.app found"; \
echo " 📊 Size: $$(du -sh Digital.app | cut -f1)"; \
echo " 🔍 Verifying structure..."; \
if [ -f "Digital.app/Contents/Info.plist" ]; then \
echo " ✅ Info.plist present"; \
else \
echo " ❌ Info.plist missing"; \
exit 1; \
fi; \
if [ -f "Digital.app/Contents/MacOS/Digital" ]; then \
echo " ✅ Executable present"; \
else \
echo " ❌ Executable missing"; \
exit 1; \
fi; \
if [ -f "Digital.app/Contents/app/Digital.jar" ]; then \
echo " ✅ Main JAR present"; \
else \
echo " ❌ Main JAR missing"; \
exit 1; \
fi; \
echo " 🚀 Starting app test..."; \
open Digital.app; \
echo " ✅ App started successfully"; \
else \
echo " ❌ Digital.app not found"; \
exit 1; \
fi

# Developer targets
dev-clean: clean
@echo "🧹 Complete cleanup for developers..."
@cd ../.. && mvn clean
@echo "✅ Maven cleanup completed"

dev-build:
@echo "🔨 Complete build for developers..."
@cd ../.. && mvn package
@echo "✅ Maven build completed"

dev-all: dev-clean dev-build app
@echo "✅ Complete build and app created"
84 changes: 84 additions & 0 deletions distribution/macos/QUICK_START.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# 🚀 Quick Start Guide - Digital.app for macOS

## ⚡ Quick Creation

### 1. Prerequisites
```bash
# Check Java 17+
java --version

# If needed, install Java
brew install openjdk@17
```

**Note**: No additional tools required! This automation uses only native macOS tools (`sips` and `iconutil`).

### 2. Build Project
```bash
# From Digital project root
mvn clean package
```

### 3. Create macOS App
```bash
# Navigate to macOS directory
cd distribution/macos

# Create the app
./create-digital-app.sh
```

### 4. Result
- ✅ **Digital.app** created and ready to use
- ✅ **~200-300 MB** with integrated Java runtime
- ✅ **All libraries** and examples included

## 🎯 Alternative Usage

### With Makefile
```bash
cd distribution/macos
make app # Create the app
make install # Install to /Applications
make test # Test the app
```

### With Maven
```bash
# From project root
mvn clean package install # On macOS automatically creates the app
```

## 📱 Installation

### Method 1: Drag & Drop
1. Open **Finder**
2. Drag **Digital.app** to **Applications**

### Method 2: Command
```bash
cp -r Digital.app /Applications/
```

### Method 3: Makefile
```bash
make install
```

## 🔗 File Association

The app is configured to handle `.dig` files automatically:

### Opening .dig files
```bash
# From command line
open circuit.dig

# Or double-click .dig files in Finder
```

### File Association Features
- ✅ **Automatic recognition** of `.dig` files
- ✅ **Custom icon** for Digital circuit files
- ✅ **Direct opening** from Finder or command line
- ✅ **MIME type** support (`application/x-digital-circuit`)
Loading