Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 2.45 KB

File metadata and controls

42 lines (29 loc) · 2.45 KB

Repository Guidelines

Project Structure & Module Organization

  • This project is a code generator which generates swift code, but the codebase is written in C++. The code for the code generator is in the swiftwinrt subdirectory
    • file_writers.h dictates how each code file is written that is produced by the generator
    • code_writers directory contains all the different methods which generate various parts of the code. These are broken up into different types (Classes/Structs/Enums/Delegates/Interfaces)
    • everything else is helpers
  • Tests are in the tests subfolder. There is a test_app subfolder which contains code for all the test cases and the executable which runs them. There is also a test_component folder, this houses the c++ code which the swiftwinrt project generates swift bindings code for.
  • Code in the tests/test_component/Sources subfolder is generated by swiftwinrt as part of the build. These files should not be hand-edited. When you make changes to swiftwinrt and re-build, these should be automatically updated.

Build, Test, and Development Commands

  • If you need to setup a machine after first cloning the repository, you need to run these commands:

git submodule init git submodule update --recursive winget install --id Microsoft.WindowsSDK.10.0.26011

  • To build run the following three commands: cmake --preset release cmake --build --preset release cmake --build --preset --release --target install
  • The first command configures the project for cmake (this is only needed if you modify a cmake file)
  • The second command builds the project
  • The third command installs the project so that we can run tests

Coding Style & Naming Conventions

  • For C++ guidelines, names are generally foo_bar rather than fooBar.
  • For Swift, just standard swift naming of camelCase
  • All code uses 4 spaces for indentation

Testing Guidelines

  • Tests use XCTest, but are run as part of an executable and don't use XCTest directly. Due to this, test cases have to be manually added to the list. Follow existing patterns to add new tests.
  • To run tests, execute the out/release/bin/test_app.exe if it exits with a non-zero exit code, a test failed.

Commit & Pull Request Guidelines

  • there are no guidelines on PR summary, just explain the reason for the change and what the change does. include bullet points for the main changes.