-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(bindings/swift): add CONTRIBUTING.md (#2540)
* doc(bindings/swift): add CONTRIBUTING.md * doc(bindings/swift): remove dev container section
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Contributing | ||
|
||
- [Contributing](#contributing) | ||
- [Setup](#setup) | ||
- [Build](#build) | ||
- [Test](#test) | ||
|
||
## Setup | ||
|
||
To build OpenDAL Swift binding, the Swift toolchain is required to be installed. | ||
|
||
For Ubuntu and CentOS, you may follow the instructions in [this documentation](https://www.swift.org/download) to install it. Make sure that `swift` binary is added to your path: | ||
|
||
```shell | ||
export PATH=/path/to/swift-toolchain/usr/bin:"${PATH}" | ||
``` | ||
|
||
For macOS, you can install Xcode or Xcode command line tools to get your environment all set. | ||
|
||
Then you can validate your Swift installation by executing `swift --version`. | ||
|
||
```text | ||
$ swift --version | ||
Swift version 5.8.1 (swift-5.8.1-RELEASE) | ||
Target: x86_64-unknown-linux-gnu | ||
``` | ||
|
||
For better development experience, we recommend you to configure your editors to use SourceKit-LSP (the LSP for Swift). Visit SourceKit-LSP [repository](https://github.com/apple/sourcekit-lsp) for more details. | ||
|
||
## Build | ||
|
||
To build the binding package: | ||
|
||
```shell | ||
$ make | ||
``` | ||
|
||
Swift packages are not released via binary artifacts typically. However, you can still build the package locally to check whether there are compilation errors. | ||
|
||
To clean the build results: | ||
|
||
```shell | ||
$ make clean | ||
``` | ||
|
||
## Test | ||
|
||
To build and run the tests: | ||
|
||
```text | ||
$ make test | ||
Test Suite 'All tests' started at xxx. | ||
Test Suite 'OpenDALPackageTests.xctest' started at xxx. | ||
Test Suite 'OpenDALTests' started at xxx. | ||
Test Case '-[OpenDALTests.OpenDALTests testSimple]' started. | ||
Test Case '-[OpenDALTests.OpenDALTests testSimple]' passed (xx seconds). | ||
Test Suite 'OpenDALTests' passed at xxx. | ||
Executed 1 test, with 0 failures (0 unexpected) in xx (xx) seconds | ||
Test Suite 'OpenDALPackageTests.xctest' passed at xxx. | ||
Executed 1 test, with 0 failures (0 unexpected) in xx (xx) seconds | ||
Test Suite 'All tests' passed at xxx. | ||
Executed 1 test, with 0 failures (0 unexpected) in xx (xx) seconds | ||
``` |