summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--build/docker/ubuntu-bionic/Dockerfile7
-rwxr-xr-xconfigure.ac21
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/swift/Makefile.am46
-rw-r--r--lib/swift/README.md1
6 files changed, 79 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index b7f7b454b..b3a5920f2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -285,6 +285,7 @@ project.lock.json
/lib/rs/test/src/ultimate.rs
/lib/rs/*.iml
/lib/rs/**/*.iml
+/lib/swift/.build
/libtool
/ltmain.sh
/missing
diff --git a/build/docker/ubuntu-bionic/Dockerfile b/build/docker/ubuntu-bionic/Dockerfile
index 4f53ca4cd..5ad4c845e 100644
--- a/build/docker/ubuntu-bionic/Dockerfile
+++ b/build/docker/ubuntu-bionic/Dockerfile
@@ -250,6 +250,13 @@ RUN apt-get install -y --no-install-recommends \
cargo \
rustc
+# Swift on Linux for cross tests
+RUN cd / && \
+ wget --quiet https://swift.org/builds/swift-4.2.1-release/ubuntu1804/swift-4.2.1-RELEASE/swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
+ tar xf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz --strip-components=1 && \
+ rm swift-4.2.1-RELEASE-ubuntu18.04.tar.gz && \
+ swift --version
+
# cppcheck-1.82 has a nasty cpp parser bug, so we're using something newer
RUN apt-get install -y --no-install-recommends \
`# Static Code Analysis dependencies` \
diff --git a/configure.ac b/configure.ac
index f53fc3f47..4a5fb3925 100755
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,7 @@ if test "$enable_libs" = "no"; then
with_nodets="no"
with_lua="no"
with_rs="no"
+ with_swift="no"
fi
AX_THRIFT_LIB(cpp, [C++], yes)
@@ -445,6 +446,16 @@ fi
AM_CONDITIONAL(WITH_GO, [test "$have_go" = "yes"])
AM_CONDITIONAL([GOVERSION_LT_17], [test "$go_version_lt_17" = "yes"])
+AX_THRIFT_LIB(swift, [Swift], yes)
+have_swift="no"
+if test "$with_swift" = "yes"; then
+ AC_PATH_PROG([SWIFT], [swift])
+ if test "x$SWIFT" != "x" -a "x$SWIFT" != "x"; then
+ have_swift="yes"
+ fi
+fi
+AM_CONDITIONAL([WITH_SWIFT], [test "$have_swift" = "yes"])
+
AX_THRIFT_LIB(rs, [Rust], yes)
have_rs="no"
if test "$with_rs" = "yes"; then
@@ -851,6 +862,7 @@ AC_CONFIG_FILES([
lib/rs/Makefile
lib/rs/test/Makefile
lib/lua/Makefile
+ lib/swift/Makefile
lib/xml/Makefile
lib/xml/test/Makefile
test/Makefile
@@ -929,6 +941,8 @@ if test "$have_lua" = "yes" ; then MAYBE_LUA="lua" ; else MAYBE_LUA="" ; fi
AC_SUBST([MAYBE_LUA])
if test "$have_rs" = "yes" ; then MAYBE_RS="rs" ; else MAYBE_RS="" ; fi
AC_SUBST([MAYBE_RS])
+if test "$have_swift" = "yes" ; then MAYBE_SWIFT="swift" ; else MAYBE_SWIFT="" ; fi
+AC_SUBST([MAYBE_SWIFT])
if test "$have_dotnetcore" = "yes" ; then MAYBE_DOTNETCORE="netcore" ; else MAYBE_DOTNETCORE="" ; fi
AC_SUBST([MAYBE_DOTNETCORE])
if test "$have_cl" = "yes" ; then MAYBE_CL="cl" ; else MAYBE_CL="" ; fi
@@ -961,6 +975,7 @@ echo "Building Python Library ...... : $have_python"
echo "Building Py3 Library ......... : $have_py3"
echo "Building Ruby Library ........ : $have_ruby"
echo "Building Rust Library ........ : $have_rs"
+echo "Building Swift Library ....... : $have_swift"
if test "$have_csharp" = "yes" ; then
echo
@@ -1090,6 +1105,12 @@ if test "$have_rs" = "yes" ; then
echo " Using rustc................ : $RUSTC"
echo " Using Rust version......... : $($RUSTC --version)"
fi
+if test "$have_swift" = "yes" ; then
+ echo
+ echo "Swift Library:"
+ echo " Using Swift ............... : $SWIFT"
+ echo " Using Swift version ....... : $($SWIFT --version | head -1)"
+fi
echo
echo "If something is missing that you think should be present,"
echo "please skim the output of configure to find the missing"
diff --git a/lib/Makefile.am b/lib/Makefile.am
index b31560915..b6ce20e3c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -102,6 +102,10 @@ if WITH_CL
SUBDIRS += cl
endif
+if WITH_SWIFT
+SUBDIRS += swift
+endif
+
# All of the libs that don't use Automake need to go in here
# so they will end up in our release tarballs.
EXTRA_DIST = \
diff --git a/lib/swift/Makefile.am b/lib/swift/Makefile.am
new file mode 100644
index 000000000..6b88b06a7
--- /dev/null
+++ b/lib/swift/Makefile.am
@@ -0,0 +1,46 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+SUBDIRS = .
+
+all-local:
+ swift build --configuration release
+
+install-exec-hook:
+ swift install
+
+clean-local:
+ swift package clean
+ rm -rf .build
+
+precross:
+ swift
+
+check-local:
+ swift test
+
+EXTRA_DIST = \
+ Package.swift \
+ Sources \
+ Tests \
+ README.md
+
+MAINTAINERCLEANFILES = \
+ Makefile \
+ Makefile.in
diff --git a/lib/swift/README.md b/lib/swift/README.md
index 4fdeacfa8..6f1096184 100644
--- a/lib/swift/README.md
+++ b/lib/swift/README.md
@@ -22,7 +22,6 @@ under the License.
## Build
-
swift build
## Test