diff --git a/Dockerfile b/Dockerfile index 2ce57e6b5bb..c448ea71b1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,18 @@ FROM openjdk:15-buster RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates ssh bash -ENV GOLANG_VERSION 1.17 +RUN apt-get -y install libncurses5 clang libcurl4 libpython2.7 libpython2.7-dev + +RUN \ + curl https://download.swift.org/swift-5.8.1-release/ubuntu1804/swift-5.8.1-RELEASE/swift-5.8.1-RELEASE-ubuntu18.04.tar.gz -o swift.tar.gz &&\ + tar xzf swift.tar.gz && \ + mv swift-5.8.1-RELEASE-ubuntu18.04 /usr/share/swift && \ + export PATH=/usr/share/swift/usr/bin:$PATH && \ + swift -v + +ENV PATH /usr/share/swift/usr/bin:$PATH +ENV GOLANG_VERSION 1.17 RUN set -eux; \ apt-get install -y --no-install-recommends bash build-essential openssl golang-go curl wget; \ rm -rf /var/lib/apt/lists/*; \ @@ -126,6 +136,8 @@ RUN gem install bundler -v 2.3.26 && \ apt-get update && \ apt-get install -y --no-install-recommends ruby-dev + + ADD go.mod go.mod ADD go.sum go.sum RUN go build -o /usr/local/bin/ory github.com/ory/cli diff --git a/config/client/swift.yml b/config/client/swift.yml new file mode 100644 index 00000000000..99c308a7b11 --- /dev/null +++ b/config/client/swift.yml @@ -0,0 +1,8 @@ +podAuthors: ORY GmbH +podHomepage: https://www.ory.sh +podDescription: Ory Swift Client (TODO) +podSource: "${SWIFT_POD_SOURCE}" +podVersion: $RAW_VERSION +projectName: ${SWIFT_PROJECT_NAME} + +disallowAdditionalPropertiesIfNotPresent: false diff --git a/scripts/generate.sh b/scripts/generate.sh index b55a13d03aa..9ce573abf0c 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -321,15 +321,41 @@ elixir () { cp "LICENSE" "clients/${PROJECT}/elixir" } -elixir -typescript -rust -golang -java -php -python -ruby -dotnet -dart + +swift () { + echo "Generating Swift..." + + dir="clients/${PROJECT}/swift" + rm -rf "$dir" || true + mkdir -p "$dir" + + # file="${dir}/mix.exs" + + openapi-generator-cli version-manager set 7.1.0 + openapi-generator-cli generate -i "${SPEC_FILE}" \ + -g swift5 \ + -o "$dir" \ + --git-user-id ory \ + --git-repo-id sdk \ + --git-host github.com \ + -c ./config/client/swift.yml.proc.yml + + # (sed "s/licenses:.*$/licenses: [\"Apache-2.0\"],\n links: %{\n \"GitHub\" => \"https:\/\/github.com\/ory\/sdk\",\n \"Website\" => \"https:\/\/www.ory.sh\",\n \"Documentation\" => \"https:\/\/www.ory.sh\/docs\",\n \"Product\" => \"https:\/\/console.ory.sh\"\n }/g" < "${file}") > tmp.$$.exs && mv tmp.$$.exs "${file}" + # (sed "s/${VERSION}/${RAW_VERSION}/g" < "${file}") > tmp.$$.exs && mv tmp.$$.exs "${file}" + + cp "LICENSE" "clients/${PROJECT}/swift" +} + +# elixir +# typescript +# rust +# golang +# java +# php +# python +# ruby +# dotnet +# dart +swift cleanup diff --git a/scripts/prep.sh b/scripts/prep.sh index 88af300b499..efcb18cdcc4 100755 --- a/scripts/prep.sh +++ b/scripts/prep.sh @@ -86,6 +86,9 @@ export NPM_NAME="@ory/$PROJECT-client" export ELIXIR_PACKAGE_NAME="ory_${PROJECT}" +export SWIFT_PROJECT_NAME="Ory${PROJECT_UCF}Client" +export SWIFT_POD_SOURCE="https://github.com/ory/sdk/tree/master/clients/${PROJECT}/swift" + export GIT_REPO="${PROJECT}-client" if [ $project == "client" ]; then @@ -110,5 +113,7 @@ if [ $project == "client" ]; then export ELIXIR_PACKAGE_NAME="ory_client" + export SWIFT_PROJECT_NAME="OryClient" + export GIT_REPO="client" fi diff --git a/scripts/test.sh b/scripts/test.sh index 1081f213ab8..3d4e737dbb6 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -94,13 +94,22 @@ elixir () { (cd "${dir}"; mix test) } -elixir -typescript -rust -golang -java -php -python -ruby -dart -csharp +swift() { + echo "Testing Swift..." + + dir="clients/${PROJECT}/swift" + (cd "$dir" && command swift build) + (cd "$dir" && command swift test) +} + +# elixir +# typescript +# rust +# golang +# java +# php +# python +# ruby +# dart +# csharp +swift