From c82b0271a3c16992275e2d6ba420400d1fb6797a Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Mon, 11 Dec 2023 17:07:29 -0800 Subject: [PATCH] infra changes --- .gitignore | 87 +++++++++++++++++--------------------------- LICENSE | 3 +- docs/CONTRIBUTING.md | 2 +- docs/DEVELOPING.md | 26 ++++++++----- 4 files changed, 53 insertions(+), 65 deletions(-) diff --git a/.gitignore b/.gitignore index 16039ed..4ec6c36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,57 +1,38 @@ -# Created by https://www.toptal.com/developers/gitignore/api/macos,xcode -# Edit at https://www.toptal.com/developers/gitignore?templates=macos,xcode - -### macOS ### -# General +# OS X .DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -### macOS Patch ### -# iCloud generated files -*.icloud - -### Xcode ### -## User settings +# Xcode +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 xcuserdata/ - -## Xcode 8 and earlier -*.xcscmblueprint *.xccheckout - -### Xcode Patch ### -*.xcodeproj/* -!*.xcodeproj/project.pbxproj -!*.xcodeproj/xcshareddata/ -!*.xcodeproj/project.xcworkspace/ -!*.xcworkspace/contents.xcworkspacedata -/*.gcno -**/xcshareddata/WorkspaceSettings.xcsettings - -# End of https://www.toptal.com/developers/gitignore/api/macos,xcode - -# This file contains the PaLM API key - don't check it in -PaLM-Info.plist +profile +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcworkspace + +# Swift Package Manager +Package.resolved +**/.build +**/.swiftpm +.netrc + +# Bad sorts get generated if the package .xcscheme is not regenerated. +# Anything committed to xcshareddata gets propagated to clients. (#8167) +.swiftpm/xcode/xcshareddata/ + +# Mint package manager +Mint + +# CLI Tool +Apps/GoogleAICLI/GoogleAICLI.xcodeproj/xcshareddata/xcschemes/* +GenerativeAI-Info.plist diff --git a/LICENSE b/LICENSE index 7a4a3ea..261eeb9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -199,4 +198,4 @@ 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. \ No newline at end of file + limitations under the License. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index e635be7..8956a61 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -27,6 +27,6 @@ Guidelines](https://opensource.google/conduct/). ### Code Reviews -All submissions, including submissions by project members, require review. We +All submissions, including submissions by project members, require review. We use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) for this purpose. diff --git a/docs/DEVELOPING.md b/docs/DEVELOPING.md index a078c87..ed6fe82 100644 --- a/docs/DEVELOPING.md +++ b/docs/DEVELOPING.md @@ -1,13 +1,21 @@ # Developing -## Re-generating the API -All code in the [OpenAPI](../Sources/OpenAPI) is generated based on the API specification in [generativelanguage-v1beta3.json](../Sources/generativelanguage-v1beta3.json). +## Prerequisites -To re-generate the API based on any changes to the API, follow these steps: +* Xcode 15 or newer -* Obtain the API discovery document from https://generativelanguage.googleapis.com/$discovery/rest?version=v1beta3&key=$YOUR_API_KEY -* Convert the discovery document to OpenAPI 3.0 (Swagger) format - * https://github.com/APIs-guru/google-discovery-to-swagger - * https://github.com/LucyBot-Inc/api-spec-converter -* Use [CreateAPI](https://github.com/CreateAPI/CreateAPI) to generate helper classes for accessing the API -* Manually write the API surface ([protocol](../Sources/GoogleGenerativeAI/GenerativeLanguageProtocol.swift) / [implementation)](../Sources/GoogleGenerativeAI/GenerativeLanguage.swift) and [REST routes for the API client](../Sources/GoogleGenerativeAI/Endpoints.swift) to access the API using the generated helper classes +## Setting up your development environment + +* `git clone git@github.com:google/generative-ai-swift.git` +* `open Package.swift` +* Command-u to build and run the library and unit tests +* `open Examples/GenerativeAISample/GenerativeAISample.xcodeproj` to build and run the Examples + +## Checking in code + +Before submitting a pull request, make sure to check your code against the +style guide by running the following command: + +```bash +$ ./scripts/style.sh +```