diff --git a/dev-containers/swift-container/.vscode/devContainer.json b/dev-containers/swift-container/.vscode/devContainer.json new file mode 100644 index 0000000000..fb1f2edd28 --- /dev/null +++ b/dev-containers/swift-container/.vscode/devContainer.json @@ -0,0 +1,6 @@ +{ + "dockerFile": "dev-container.dockerfile", + "extensions": [ + "vknabel.vscode-swift-development-environment" + ] +} \ No newline at end of file diff --git a/dev-containers/swift-container/.vscode/settings.json b/dev-containers/swift-container/.vscode/settings.json new file mode 100644 index 0000000000..044baa2c4e --- /dev/null +++ b/dev-containers/swift-container/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "swift.path.sourcekite": "/sourcekite/.build/x86_64-unknown-linux/release/sourcekite" +} \ No newline at end of file diff --git a/dev-containers/swift-container/dev-container.dockerfile b/dev-containers/swift-container/dev-container.dockerfile new file mode 100644 index 0000000000..e01ddc70a8 --- /dev/null +++ b/dev-containers/swift-container/dev-container.dockerfile @@ -0,0 +1,13 @@ +FROM swift:4.2.1 + +# Install git +RUN apt-get update && apt-get -y install git + +# Install SourceKite, see https://github.com/vknabel/vscode-swift-development-environment/blob/master/README.md#installation +RUN git clone https://github.com/jinmingjian/sourcekite.git +RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/swift:/usr/lib +RUN ln -s /usr/lib/libsourcekitdInProc.so /usr/lib/sourcekitdInProc +RUN cd sourcekite && swift build -Xlinker -l:sourcekitdInProc -c release + +# cleanup +RUN rm -rf /var/lib/apt/lists/* diff --git a/dev-containers/swift-container/main.swift b/dev-containers/swift-container/main.swift new file mode 100644 index 0000000000..55c3db6869 --- /dev/null +++ b/dev-containers/swift-container/main.swift @@ -0,0 +1,6 @@ + +func say() { + print("Hello, world!"); +} + +say(); \ No newline at end of file