- Tap the Fork button of this repo
git clone https://github.com/YourGitHubUsername/GistHub.git
Just open the GistHub.xcodeproj
and waiting for dependencies load.
You'll need to register new OAuth application.
Make sure the Authorization callback URL is set to gisthub://
. The others can be filled in as you wish.
You will be redirected to the application page where you can access your Client ID and Client Secret.
To add the Client ID and Client Secret to the App, follow these steps:
- Open the GistHub/GistHub.xcodeproj file.
- Go to Product > Scheme > Manage Schemes...
- Select GistHub and click the cog.
- Click on Duplicate.
- Select Copy of GistHub and uncheck "Shared" checkbox, you can rename it as you want.
- With 'Copy of GistHub' selected, click on Edit...
- Go to Run > Arguments
- Add your Client ID (
GITHUB_CLIENT_ID
as key) and Client Secret (GITHUB_CLIENT_SECRET
) to the Environment Variables.
🎉 The project is officially set up! 🎉
GistHub is modular via SPM (Swift Package Manager). This means that the app is divided into smaller modules or packages that can be developed and tested independently. Here's how you can add a new module to GistHub:
- Create the new module by
sh Scripts/generate_package.sh <Package Name>
. Replace with the name of your new package. For example, sh Scripts/generate_package.sh MyNewPackage. - Drag the new module to
GistHub.xcodeproj
to add it to the Xcode project.
After adding a new module and its dependencies, you need to resolve all the modules to update their dependencies and ensure that they can be built. To do this, run the following command in the terminal:
cd GistHub/
sh Scripts/resolve_packages.sh
Open the GistHub/GistHub.xcodeproj file. Then select gpl_api_generator
scheme with macOS target My Mac
.
Generating code from *.graphql
- Go to Product > Scheme > Edit Scheme...
- Go to Run > Arguments.
- Make sure
generate
argument is checked. - Hit run to generate.
To download the new GitHub schema
- Go to Product > Scheme > Edit Scheme...
- Go to Run > Arguments.
- Make sure
download
argument is checked. - Hit run to download.
Generating code from *.graphql
cd graphql/generator/
swift run gpl_api_generator generate
Dowloading the new GitHub schema
cd graphql/generator/
swift run gpl_api_generator download --token <github access token>