This directory contains the build and maintenance scripts for the Zoo Code JetBrains project. These scripts follow open source conventions and provide a unified interface for project operations.
# Initialize development environment
./scripts/setup.sh
# Build the project
./scripts/build.sh
# Build a release using the latest Zoo Code release notes
./scripts/release.sh --mode release --clean
# Run tests
./scripts/test.sh
# Clean build artifacts
./scripts/clean.sh# Initialize development environment
.\scripts\run.ps1 setup
# Build the project
.\scripts\run.ps1 build
# Run tests
.\scripts\run.ps1 test
# Clean build artifacts
.\scripts\run.ps1 clean| Script | Purpose | Description |
|---|---|---|
run.sh |
Main entry point (Unix) | Unified interface for all operations |
run.ps1 |
Main entry point (Windows) | PowerShell wrapper for Windows users |
setup.sh |
Environment setup | Initialize development environment |
build.sh |
Build system | Build VSCode extension and IDEA plugin |
release.sh |
Release build | Import the latest Zoo Code release notes and build the JetBrains plugin |
clean.sh |
Cleanup utility | Clean build artifacts and temporary files |
test.sh |
Test runner | Run tests and validations |
| Script | Purpose | Description |
|---|---|---|
lib/common.sh |
Common utilities | Shared functions for logging, file operations, etc. |
lib/build.sh |
Build utilities | Build-specific functions and configurations |
# First time setup
./scripts/setup.sh --verbose
# Build in debug mode
./scripts/build.sh --mode debug
# Build specific component
./scripts/build.sh idea
# Build with custom output directory
./scripts/build.sh --output ./dist# Run all tests
./scripts/test.sh
# Run specific test type
./scripts/test.sh lint
# Run tests with coverage
./scripts/test.sh --coverage
# Run tests in watch mode
./scripts/test.sh --watch# Clean build artifacts only
./scripts/clean.sh
# Clean everything
./scripts/clean.sh all
# Clean dependencies
./scripts/clean.sh deps
# Force clean without confirmation
./scripts/clean.sh --force allThe Publish JetBrains plugin GitHub Actions workflow checks the VS Code
Marketplace once a day and publishes a matching JetBrains plugin when it
finds a new stable Zoo Code version. For immediate releases, the source
repository can send a vscode-marketplace-released repository_dispatch event
containing this payload:
{
"event_type": "vscode-marketplace-released",
"client_payload": {
"repository": "Zoo-Code-Org/Zoo-Code",
"version": "3.78.0"
}
}The workflow independently verifies that the requested stable version exists
on the VS Code Marketplace, skips versions already uploaded to JetBrains, runs
./scripts/release.sh --mode release --clean, publishes the resulting ZIP to
JetBrains Marketplace, and creates a matching v<version> GitHub release with
the ZIP attached. Both destinations are checked independently, so a retry can
repair a missing Marketplace upload or GitHub release without duplicating the
other. The workflow can also be run manually with a version from the Actions
page to recover from a missed dispatch or retry a failed release.
Configure the jetbrains-marketplace-production GitHub environment and add its
JETBRAINS_MARKETPLACE_TOKEN secret. The token must be a permanent JetBrains
Marketplace token authorized to upload updates for plugin ID 32979 (Zoo Code).
The dispatching Zoo Code workflow needs a GitHub App token or fine-grained PAT
with permission to create repository dispatch events in
Zoo-Code-Org/Zoo-Code-Jetbrains; a source repository's default
GITHUB_TOKEN cannot dispatch to another repository.
For a local release build pinned to a particular Marketplace version:
ZOO_EXTENSION_VERSION=3.78.0 ./scripts/release.sh --mode release --clean- Optimized builds
- Production-ready artifacts
- Minimal debug information
- Development builds
- Debug symbols included
- Additional debug resources
- Source maps enabled
# Debug build
./scripts/build.sh --mode debug
# Or set environment variable
BUILD_MODE=debug ./scripts/build.sh| Variable | Description | Default |
|---|---|---|
BUILD_MODE |
Build mode (release/debug) | release |
VERBOSE |
Enable verbose output | false |
DRY_RUN |
Show what would be done | false |
SKIP_VALIDATION |
Skip environment validation | false |
VSIX_FILE |
Path to existing VSIX file | - |
SKIP_BASE_BUILD |
Skip base extension build | false |
SKIP_IDEA_BUILD |
Skip IDEA plugin build | false |
ZOO_EXTENSION_VERSION |
Pin the stable VS Code Marketplace version included in the JetBrains plugin | Latest stable version |
scripts/
├── lib/ # Shared library functions
│ ├── common.sh # Common utilities
│ └── build.sh # Build-specific functions
├── setup.sh # Environment setup
├── build.sh # Build system
├── clean.sh # Cleanup utility
├── test.sh # Test runner
├── run.sh # Main entry point (Unix)
├── run.ps1 # Main entry point (Windows)
└── README.md # This file
- Node.js: 16.0.0 or later
- Git: Any recent version
- Bash: 4.0 or later (Linux/macOS)
- PowerShell: 5.1 or later (Windows)
- npm: Included with Node.js
- pnpm: Optional, used if available
- Gradle: Required for IDEA plugin
- unzip: Required for VSIX extraction
- shellcheck: For shell script linting
- WSL: For Windows users (recommended)
Full native support with bash scripts.
- PowerShell wrapper:
run.ps1provides Windows-friendly interface - WSL support: Automatically detects and uses WSL if available
- Git Bash support: Falls back to Git Bash if WSL not available
- Native PowerShell: Limited functionality, bash recommended
# Make scripts executable
chmod +x scripts/*.sh
# Check PATH
echo $PATH# Check Node.js version
node --version
# Update Node.js if needed
# Use nvm, n, or download from nodejs.org# Reinitialize submodules
git submodule deinit --all -f
git submodule init
git submodule update --recursive# Clean and rebuild
./scripts/clean.sh all
./scripts/setup.sh --force
./scripts/build.sh --verboseEnable verbose output for debugging:
# Verbose mode
./scripts/build.sh --verbose
# Dry run mode (show what would be done)
./scripts/build.sh --dry-run
# Debug environment
VERBOSE=true ./scripts/build.shBuild logs are stored in:
logs/directory (if created)test-results/directory for test reports- Console output (use
--verbosefor detailed logs)
- Follow the existing naming convention
- Use the common utility functions from
lib/common.sh - Include proper help documentation
- Add error handling and logging
- Test on multiple platforms
- Use
set -euo pipefailfor bash scripts - Source common utilities:
source "$SCRIPT_DIR/lib/common.sh" - Implement
--help,--verbose, and--dry-runoptions - Use consistent logging functions
- Handle errors gracefully
- Provide meaningful exit codes
# Test script syntax
bash -n scripts/script-name.sh
# Test with shellcheck (if available)
shellcheck scripts/*.sh
# Test functionality
./scripts/test.shThis project follows the same license as the main Zoo Code JetBrains project.
For issues with the build scripts:
- Check this README
- Run with
--verboseflag for detailed output - Check the troubleshooting section
- Create an issue with detailed error information
Generated by Zoo Code JetBrains build system v1.0.0