Skip to content

Commit

Permalink
Remove Apple specific code from Swift
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Feb 5, 2024
1 parent 390b915 commit 7055573
Show file tree
Hide file tree
Showing 3 changed files with 787 additions and 50 deletions.
190 changes: 188 additions & 2 deletions src/SDK/Language/Apple.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,193 @@ public function getName(): string

public function getFiles(): array
{
return \array_merge(parent::getFiles(), [
return [
[
'scope' => 'default',
'destination' => 'README.md',
'template' => 'swift/README.md.twig',
],
[
'scope' => 'default',
'destination' => 'CHANGELOG.md',
'template' => 'swift/CHANGELOG.md.twig',
],
[
'scope' => 'default',
'destination' => 'LICENSE',
'template' => 'swift/LICENSE.twig',
],
[
'scope' => 'default',
'destination' => 'Package.swift',
'template' => 'swift/Package.swift.twig',
],
[
'scope' => 'method',
'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md',
'template' => 'swift/docs/example.md.twig',
],
[
'scope' => 'default',
'destination' => '/Tests/{{ spec.title | caseUcfirst}}Tests/Tests.swift',
'template' => 'swift/Tests/Tests.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/{{ spec.title | caseUcfirst}}Error.swift',
'template' => '/swift/Sources/Models/Error.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/InputFile.swift',
'template' => 'swift/Sources/Models/InputFile.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Permission.swift',
'template' => 'swift/Sources/Permission.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Role.swift',
'template' => 'swift/Sources/Role.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/ID.swift',
'template' => 'swift/Sources/ID.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Query.swift',
'template' => 'swift/Sources/Query.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Models/UploadProgress.swift',
'template' => 'swift/Sources/Models/UploadProgress.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/JSONCodable/Codable+JSON.swift',
'template' => 'swift/Sources/JSONCodable/Codable+JSON.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/Cookie+Codable.swift',
'template' => 'swift/Sources/Extensions/Cookie+Codable.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/HTTPClientRequest+Cookies.swift',
'template' => 'swift/Sources/Extensions/HTTPClientRequest+Cookies.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Extensions/String+MimeTypes.swift',
'template' => 'swift/Sources/Extensions/String+MimeTypes.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/StreamingDelegate.swift',
'template' => 'swift/Sources/StreamingDelegate.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Services/Service.swift',
'template' => 'swift/Sources/Service.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/IOSDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/iOS/IOSDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/iOS/UIDevice+ModelName.swift',
'template' => 'swift/Sources/DeviceInfo/iOS/UIDevice+ModelName.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/Linux/LinuxDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/Linux/LinuxDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/macOS/MacOSDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/macOS/MacOSDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/watchOS/WatchOSDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/watchOS/WatchOSDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/watchOS/WKInterfaceDevice+ModelName.swift',
'template' => 'swift/Sources/DeviceInfo/watchOS/WKInterfaceDevice+ModelName.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/macOS/CwlSysCtl.swift',
'template' => 'swift/Sources/DeviceInfo/macOS/CwlSysCtl.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/Windows/WindowsDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/Windows/WindowsDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/DeviceInfo/OSDeviceInfo.swift',
'template' => 'swift/Sources/DeviceInfo/OSDeviceInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Apple/PackageInfo+Apple.swift',
'template' => 'swift/Sources/PackageInfo/Apple/PackageInfo+Apple.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Linux/PackageInfo+Linux.swift',
'template' => 'swift/Sources/PackageInfo/Linux/PackageInfo+Linux.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/Windows/PackageInfo+Windows.swift',
'template' => 'swift/Sources/PackageInfo/Windows/PackageInfo+Windows.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/OSPackageInfo.swift',
'template' => 'swift/Sources/PackageInfo/OSPackageInfo.swift',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/PackageInfo/PackageInfo.swift',
'template' => 'swift/Sources/PackageInfo/PackageInfo.swift',
],
[
'scope' => 'service',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Services/{{service.name | caseUcfirst}}.swift',
'template' => 'swift/Sources/Services/Service.swift.twig',
],
[
'scope' => 'definition',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}Models/{{ definition.name | caseUcfirst }}.swift',
'template' => '/swift/Sources/Models/Model.swift.twig',
],
[
'scope' => 'enum',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}Enums/{{ enum.name | caseUcfirst }}.swift',
'template' => '/swift/Sources/Enums/Enum.swift.twig',
],
// Apple specific
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/Client.swift',
'template' => '/apple/Sources/Client.swift.twig',
],
[
'scope' => 'default',
'destination' => '/Sources/{{ spec.title | caseUcfirst}}/OAuth/WebAuthComponent.swift',
Expand Down Expand Up @@ -292,6 +478,6 @@ public function getFiles(): array
'destination' => '/example-uikit/UIKitExampleUITests/UIKitExampleUITests.swift',
'template' => '/swift/example-uikit/UIKitExampleUITests/UIKitExampleUITests.swift',
],
]);
];
}
}
Loading

0 comments on commit 7055573

Please sign in to comment.