Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions configs/android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: false # Not needed for Android
depot_tools: false

# Snippets runtime flags
android: true # Android development tools
Expand Down
1 change: 1 addition & 0 deletions configs/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: false
depot_tools: false

# Snippets runtime flags
android: false
Expand Down
1 change: 1 addition & 0 deletions configs/everything.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: true # iOS and React Native
depot_tools: true
Comment thread
FrederickEngelhardt marked this conversation as resolved.

# All snippets runtime flags enabled
android: true
Expand Down
1 change: 1 addition & 0 deletions configs/example-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: false
depot_tools: false

# Snippets runtime flags
android: false
Expand Down
1 change: 1 addition & 0 deletions configs/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: true # Required for iOS development
depot_tools: false

# Snippets runtime flags
android: false
Expand Down
1 change: 1 addition & 0 deletions configs/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: false # Not needed for general macOS dev
depot_tools: false

# Snippets runtime flags
android: false
Expand Down
1 change: 1 addition & 0 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: false
git: false
cocoapods: false
depot_tools: false

# Snippets runtime flags (control what loads from entry.zsh)
android: false
Expand Down
1 change: 1 addition & 0 deletions configs/react-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: true # Required for React Native iOS
depot_tools: false

# Snippets runtime flags
android: true # React Native Android support
Expand Down
1 change: 1 addition & 0 deletions configs/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ components:
mise: true
git: true
cocoapods: false
depot_tools: false

# Snippets runtime flags
android: false
Expand Down
7 changes: 4 additions & 3 deletions osa-cli.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ load_json_config() {

# For backward compatibility during installation, also set OSA_SETUP_* variables
# These are used by run_component() to determine what to install
local -a component_keys=(symlinks oh_my_zsh zsh_plugins homebrew mise osa_snippets git android iterm2 vscode cocoapods)
local -a component_keys=(symlinks oh_my_zsh zsh_plugins homebrew mise osa_snippets git android iterm2 vscode cocoapods depot_tools)

for key in "${component_keys[@]}"; do
local enabled=$(yq eval ".components.${key} // false" "$resolved_path" 2>/dev/null)
Expand Down Expand Up @@ -356,6 +356,7 @@ init_components() {
# Development tools with install scripts
register_component "git" "Configure Git (version control)" "all" "src/setup/git.zsh"
register_component "cocoapods" "Install CocoaPods for iOS development" "macos" "src/setup/install-cocoapods.zsh"
register_component "depot-tools" "Install depot_tools (Chromium development utilities)" "all" "src/setup/install-depot-tools.zsh"
Comment thread
FrederickEngelhardt marked this conversation as resolved.
Outdated
}

# Check if component is available for current platform
Expand Down Expand Up @@ -435,7 +436,7 @@ save_config() {
# If no OSA_CONFIG_* variables exist (interactive mode), convert OSA_SETUP_* to OSA_CONFIG_*
if [[ -z "$(echo $all_vars | grep '^OSA_CONFIG_')" ]]; then
# Convert OSA_SETUP_* component flags to OSA_CONFIG_COMPONENTS_*
local -a component_keys=(symlinks homebrew oh_my_zsh zsh_plugins mise osa_snippets git android iterm2 vscode cocoapods)
local -a component_keys=(symlinks homebrew oh_my_zsh zsh_plugins mise osa_snippets git android iterm2 vscode cocoapods depot_tools)
for key in "${component_keys[@]}"; do
local var_name="OSA_SETUP_$(echo $key | tr a-z A-Z | tr '-' '_')"
local value="${(P)var_name}"
Expand Down Expand Up @@ -708,7 +709,7 @@ validate_config() {

# Show enabled components
echo -e "${COLOR_BOLD}Setup Components (to be installed):${COLOR_RESET}"
local -a component_keys=(symlinks oh_my_zsh zsh_plugins homebrew mise osa_snippets git cocoapods)
local -a component_keys=(symlinks oh_my_zsh zsh_plugins homebrew mise osa_snippets git cocoapods depot_tools)
for key in "${component_keys[@]}"; do
local enabled=$(yq eval ".components.${key} // false" "$resolved_path" 2>/dev/null)
if [[ "$enabled" == "true" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions src/setup/install-cmake.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install cmake for building C/C++ projects
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing shebang at the beginning of the file. All zsh script files must start with #!/usr/bin/env zsh according to the project's coding guidelines.

Copilot generated this review using guidance from repository custom instructions.
echo "Installing cmake "
Comment thread
FrederickEngelhardt marked this conversation as resolved.
brew install cmake
Comment thread
FrederickEngelhardt marked this conversation as resolved.
47 changes: 47 additions & 0 deletions src/setup/install-depot-tools.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env zsh
# Install/update depot_tools - Chromium development utilities
# https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html

echo "Installing depot_tools (Chromium development utilities)..."

# Configuration
DEPOT_TOOLS_REPO="${DEPOT_TOOLS_REPO:-https://chromium.googlesource.com/chromium/tools/depot_tools.git}"
DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$HOME/.depot_tools}"

# Create parent directory if needed
mkdir -p "$(dirname "$DEPOT_TOOLS_DIR")"

# Check if depot_tools is already installed
if [[ -d "$DEPOT_TOOLS_DIR/.git" ]]; then
echo "Updating depot_tools..."
cd "$DEPOT_TOOLS_DIR"
if ! git pull --rebase; then
echo "βœ— Failed to update depot_tools via git pull"
return 1
fi
cd - > /dev/null
else
# Clone depot_tools if not already present
echo "Cloning depot_tools from $DEPOT_TOOLS_REPO..."

if ! git clone "$DEPOT_TOOLS_REPO" "$DEPOT_TOOLS_DIR"; then
echo "βœ— Failed to clone depot_tools from $DEPOT_TOOLS_REPO"
echo "Ensure git is installed and you have internet access"
return 1
fi
fi

# Add depot_tools to PATH via shell configuration
# This should be sourced during shell initialization
export PATH="$DEPOT_TOOLS_DIR:$PATH"

echo "βœ“ depot_tools installed at: $DEPOT_TOOLS_DIR"
echo ""
echo "To complete setup:"
echo " 1. Restart your shell or run: source ~/.zshrc"
echo " 2. Verify installation: gclient --version"
echo ""
echo "For Chromium development, run:"
echo " cd ~/chromium_workspace"
echo " fetch chromium"
echo ""
3 changes: 3 additions & 0 deletions src/setup/install-tree.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Install tree which is a useful utility for displaying directory structures
Comment thread
FrederickEngelhardt marked this conversation as resolved.
echo "Installing tree utility..."
brew install tree
Comment thread
FrederickEngelhardt marked this conversation as resolved.
18 changes: 18 additions & 0 deletions src/zsh/plugin-init/depot-tools.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env zsh
# depot_tools plugin initialization
# Add depot_tools to PATH if installed
# https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html

DEPOT_TOOLS_HOME="${DEPOT_TOOLS_HOME:-$HOME/.depot_tools}"

if [[ -d "$DEPOT_TOOLS_HOME" ]]; then
export PATH="$DEPOT_TOOLS_HOME:$PATH"
else
# Inform user depot_tools is not installed
if [[ -z "$DEPOT_TOOLS_SKIP_INIT_MESSAGE" ]]; then
echo "Note: depot_tools not found at: $DEPOT_TOOLS_HOME"
Comment thread
FrederickEngelhardt marked this conversation as resolved.
Outdated
echo "Install with: ./osa-cli.zsh --enable depot-tools"
echo "Or manually: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ~/.depot_tools"
export DEPOT_TOOLS_SKIP_INIT_MESSAGE=1
Comment thread
FrederickEngelhardt marked this conversation as resolved.
Outdated
fi
fi
Comment thread
FrederickEngelhardt marked this conversation as resolved.
1 change: 0 additions & 1 deletion src/zsh/snippets

This file was deleted.