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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,10 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

# Editor and IDE specific
.vscode/
.claude/

# Demo project
demo_project/
64 changes: 64 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Makefile for Jungle

PREFIX ?= $(HOME)/.local
INSTALL_PATH = $(PREFIX)/bin
BUILD_PATH = .build/release
EXECUTABLE_NAME = jungle

.PHONY: all build install uninstall clean test help

# Default target
all: build

# Build the executable in release mode
build:
@echo "Building $(EXECUTABLE_NAME) in release mode..."
swift build -c release --disable-sandbox

# Install the executable to user directory
install: build
@echo "Installing $(EXECUTABLE_NAME) to $(INSTALL_PATH)..."
@mkdir -p $(INSTALL_PATH)
@install -m 755 $(BUILD_PATH)/$(EXECUTABLE_NAME) $(INSTALL_PATH)/$(EXECUTABLE_NAME)
@echo "✓ $(EXECUTABLE_NAME) installed successfully at $(INSTALL_PATH)/$(EXECUTABLE_NAME)"
@if ! echo "$$PATH" | grep -q "$(INSTALL_PATH)"; then \
echo ""; \
echo "⚠️ Note: $(INSTALL_PATH) is not in your PATH"; \
echo " Add this to your shell profile (~/.zshrc or ~/.bashrc):"; \
echo " export PATH=\"$(INSTALL_PATH):\$$PATH\""; \
fi

# Uninstall the executable from user directory
uninstall:
@echo "Uninstalling $(EXECUTABLE_NAME) from $(INSTALL_PATH)..."
@rm -f $(INSTALL_PATH)/$(EXECUTABLE_NAME)
@echo "✓ $(EXECUTABLE_NAME) uninstalled successfully"

# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@rm -rf .build
@echo "✓ Build artifacts cleaned"

# Run tests
test:
@echo "Running tests..."
swift test

# Show help
help:
@echo "Jungle Makefile Commands:"
@echo ""
@echo " make build - Build the executable in release mode"
@echo " make install - Build and install to $(INSTALL_PATH) (default: ~/.local/bin)"
@echo " make uninstall - Remove the executable from $(INSTALL_PATH)"
@echo " make clean - Remove build artifacts"
@echo " make test - Run tests"
@echo " make help - Show this help message"
@echo ""
@echo "Custom Installation Path:"
@echo " make install PREFIX=/custom/path"
@echo " This will install to /custom/path/bin/jungle"
@echo ""
@echo "Note: The default installation uses ~/.local/bin"
@echo " Make sure this directory is in your PATH"
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.7
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down Expand Up @@ -79,5 +79,6 @@ let package = Package(
.target(
name: "Shell"
)
]
],
swiftLanguageModes: [.v6]
)
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ You can read more information about dependency complexity in our Technical artic
- [Installation](#installation)
* [Mint](#mint)
* [Manual](#manual)
- [Sample Projects](#sample-projects)
- [Usage](#usage)
* [Fetch Historic Complexities](#fetch-historic-complexities)
* [Compare Complexity Graphs](#compare-complexity-graphs)
Expand All @@ -35,6 +36,27 @@ mint install xing/jungle
mint run jungle help
```

### Makefile (Recommended)

```bash
git clone https://github.com/xing/jungle
cd jungle
make install
```

This will install jungle to `~/.local/bin`. Make sure this directory is in your `PATH`:

```bash
# Add to your ~/.zshrc or ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
```

Other available commands:
- `make build` - Build the executable
- `make clean` - Clean build artifacts
- `make uninstall` - Remove the installed executable
- `make help` - Show all available commands

### Manual

```bash
Expand All @@ -44,6 +66,31 @@ swift build -c release
.build/release/jungle help
```

## Sample Projects

The `Samples/` directory contains example projects to help you get started with Jungle:

### SPMSample
A Swift Package Manager project with popular dependencies (Alamofire, RealmSwift, SwiftyJSON, Kingfisher).

**Try it:**
```bash
cd Samples/SPMSample
jungle modules --target SPMSample
```

### CocoaPodsSample
An iOS project using CocoaPods with dependencies like Moya, RxSwift, and SnapKit.

**Setup and try:**
```bash
cd Samples/CocoaPodsSample
pod install
jungle modules --target CocoaPodsSample
```

See [Samples/README.md](Samples/README.md) for more details about each sample project.

## Usage

### Fetch Historic Complexities
Expand Down
6 changes: 6 additions & 0 deletions Samples/CocoaPodsSample/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CocoaPods
Pods/
*.xcworkspace

# Xcode
xcuserdata/
Loading
Loading