to swift/tools/CMakeLists.txt 3. create new .cpp file with main function 4. create new CMakeLists.txt for your tool 5. add add_swift_host_tool function to swift/tools/<your-tool>/CMakeLists.txt and define the source files, executable name and dependencies How to add new command line tool?
your .h interfaces to swift/include/swift/<your-library> 3. add your .cpp implementations to swift/lib/<your-library> 4. create CMakeLists.txt for your library at swift/lib/<your-library>/CMakeLists.txt with add_swift_library function that defines the source files, library name and dependencies 5. add add_subdirectory function to swift/lib/CMakeLists.txt How to add new library?
test source code to swift/unittests/<your-library> 3. create CMakeLists.txt for your unit tests at swift/unittests/<your-library>/CMakeLists.txt with add_swift_unittest function that defines the source files, executable name and dependencies 4. add add_subdirectory call to swift/unittests/CMakeLists.txt How to add unit tests?
good idea) create library for the underlying logic in swift/include/swift/<your-library> and swift/lib/<your-library> 3. add unit tests to swift/unittests/<your-library> 4. add integration tests to swift/tests/<your-tool> How to create new compiler-based tool?
(works really well!) 3. Keep Swift compiler in sync with Xcode version 4. Don’t let the lack of compiler knowledge scare you away! Few last practical tips
Compiler libs are designed for compilation, not for your tool So many tools are available! No stable API, breaking changes all the time You can leverage the existing infrastructure
Compiler libs are designed for compilation, not for your tool So many tools are available! No stable API, breaking changes all the time You can leverage the existing infrastructure You must fit into the existing infrastructure
Compiler libs are designed for compilation, not for your tool So many tools are available! No stable API, breaking changes all the time You can leverage the existing infrastructure You must fit into the existing infrastructure Support for both Swift and Objective-C
Compiler libs are designed for compilation, not for your tool So many tools are available! No stable API, breaking changes all the time You can leverage the existing infrastructure You must fit into the existing infrastructure Support for both Swift and Objective-C There might be better alternatives