Skip to content

Commit

Permalink
feat: swift package setup and OSRM models
Browse files Browse the repository at this point in the history
  • Loading branch information
Archdoog committed Mar 13, 2024
1 parent e906ef4 commit 4a24019
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.build
.build

## User settings
xcuserdata/
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ let package = Package(
targets: ["OSRM"]
)
],
dependencies: [
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.1"),
],
targets: [
.target(
name: "OSRM",
dependencies: [
"AnyCodable"
]
],
path: "apple/Sources/OSRM"
)
]
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions generate_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ fi
if [ "$language" = "swift" ]; then
# Clean the Generated Swift Models
if $clean; then
if [ -d "./Sources/OSRM/Models" ]; then
rm -r ./Sources/OSRM/Models
if [ -d "./apple/Sources/OSRM/Models" ]; then
rm -r ./apple/Sources/OSRM/Models
fi
mkdir -p ./Sources/OSRM/Models
mkdir -p ./apple/Sources/OSRM/Models
fi

openapi-generator generate -i ./openapi.yaml -g swift5 --strict-spec=true \
Expand All @@ -44,7 +44,7 @@ if [ "$language" = "swift" ]; then

swiftformat .build/OpenAPIClient/Classes/OpenAPIsModels

cp .build/OpenAPIClient/Classes/OpenAPIsModels/* ./Sources/OSRM/Models
cp .build/OpenAPIClient/Classes/OpenAPIsModels/* ./apple/Sources/OSRM/Models
else
echo "Language not supported"
exit 1
Expand Down

0 comments on commit 4a24019

Please sign in to comment.