Development Setup
Guide for contributors who want to work on the Wings project itself.
Prerequisites
Required Dependencies
- Nim: Programming language and compiler
- Nimble: Nim package manager (usually comes with Nim)
- Git: For version control
Cross-Compilation Dependencies
Some additional packages might be needed for cross-compilation:
- gcc-multilib
- gcc-arm-linux-gnueabihf
- mingw-w64
- libevent-dev
Note: The exact installation varies by platform.
Repository Setup
Clone and Initialize
git clone https://github.com/binhonglee/wings.git
cd wings/
Nim Environment Setup
# Install Nim dependencies
nimble install -d
# Verify setup
nim --version
nimble --version
Development Scripts
Documentation Development
nim src/main/scripts/docs.nims
docs/
folder- Requires
mkdocs
to be installed
Release Build
# Build for current environment
nim src/main/scripts/release.nims
# Cross-compile for other environments
nim src/main/scripts/release.nims --all
Language Template Generation
nim c -r -d:ssl src/main/staticlang/main.nim
lang
folder based on files in src/main/wingspkg/lang
and examples/input/templates
.
Testing
./scripts/test.sh
Development Workflow
Making Changes
-
Basic Development Cycle
# Make changes to source code # Test basic compilation nim c src/main/wings.nim # Test with example files ./wings examples/input/student.wings # Run the basic test suite ./scripts/test.sh
-
Working with Templates
# After modifying template files in examples/input/templates/ nim c -r -d:ssl src/main/staticlang/main.nim # Test the updated templates ./wings examples/input/student.wings
-
Documentation Changes
# Start documentation server nim src/main/scripts/docs.nims # Edit documentation in docs/ folder # Changes should auto-reload
Repository Structure
wings/
├── src/main/
│ ├── wings.nim # Main entry point
│ ├── wingspkg/ # Core package code
│ └── scripts/ # Development scripts
├── examples/
│ ├── input/ # Example Wings files
│ └── output/ # Generated example outputs
├── docs/ # Documentation source
└── scripts/ # Build and test scripts
Testing Your Changes
Basic Testing
# Test with provided examples
find examples/input -name "*.wings" -exec ./wings {} \;
Cross-Platform Testing
Adding New Language Support
- Create Template Configuration
- Add your language configuration to
examples/input/templates/
-
Follow the templating system documentation on wings.sh
-
Test Your Template
wings -c:examples/input/templates/your_lang.json examples/input/student.wings
-
Add to Built-in Support (Optional)
# After adding to src/main/wingspkg/lang/ nim c -r -d:ssl src/main/staticlang/main.nim
Contributing Guidelines
Before Submitting
- Ensure your changes compile:
nim c src/main/wings.nim
- Run the test suite:
./scripts/test.sh
- Test with example files to ensure nothing breaks
- Check that documentation builds if you made doc changes
Useful Resources
- Example Wings files in
examples/input/
show expected syntax and features - Template examples in
examples/input/templates/
demonstrate language support