Skip to content

pmkowal/XcodeServerSDK

 
 

Repository files navigation

Xcode Server SDK

satellite badge Latest XcodeServerSDK Release Cocoapods Carthage compatible

License Blog Twitter Czechboy0

Use Xcode Server's API with native Swift objects.

First brought to you in Buildasaur, now in an independent project. This is an unofficial, community-maintained project and is not associated with Apple. We also maintain the unofficial documentation of Xcode Server in case you'd like to integrate using a different programming language! 😉

🎓 Getting Started With Xcode Server

To find out how to set up Xcode Server on your Mac in minutes (and more), check out my series of tutorials.

📶 Xcode Server API Versions

| Xcode Server API | Supported? | | :-- | :--: | :--: | | Xcode 7 and newer | ✅ from 0.1 | | Xcode 6 and older | ✅ up to 0.0.4 |

You'll need OS X Server of version >= 4. For Xcode 7 you need OS X >= 10.10.4.

The latest version supporting the old, undocumented Xcode 6 version of the Xcode Server API is 0.0.4. All newer versions only support the new, first publicly documented Xcode 7 version of the API.

:octocat: Sources

One way to integrate XcodeServerSDK into your project is with Cocoapods. Add this to your Podfile (with the version being the latest released pod version: Cocoapods:

pod 'XcodeServerSDK'

If you're using Carthage add this to your Cartfile:

github "czechboy0/XcodeServerSDK"

🔧 Usage

Create the server config object with the server's URL, username and password.

let config = XcodeServerConfig(host: "https://127.0.0.1", user: "IRuleBots", password: "superSecr3t")
let server = XcodeServerFactory.server(config)

Go wild!

server.getBots { (bots, error) -> () in
    if let error = error {
        Log.error("Oh no! \(error.description)")
        return
    }
    
    // go crazy with bots
    if let firstBot = bots?.first {
        // use the first bot...
    }
}

📶 Swift Versions

The latest Swift 1.2 compatible version is 0.0.4, so put this exact version in your Podfile if you're targeting Swift 1.2. All newer releases will be targeting Swift 2, because we're all just so forward-thinking.

🎪 Play with Playground

We're providing a Plaground in which you can easily interact with XcodeServerSDK and test it's functionalities without any need to create a new app. Playground target is set to be OS X (so don't use UIKit inside).

🚀 Features

Name Official  support XcodeServerSDK
Check if user can create bots
List bots on server
Create a new bot
Retrieve a bot
Update a bot’s configuration
Delete a bot
Get bot's most recent integrations
Enqueue a new integration
List integrations on server
Retrieve an integration by ID
Cancel integration
List the commits included in an integration
List the build issues produced by an integration
List devices connected to server
List hosted repositories on server
Create a new hosted repository
Get supported platforms
Get SCM branches from Blueprint
Verify user can manage server

Opertions listed in table above in italics are those provided by  in Xcode. Rest of operations are just a product of reverse engineering.

🌇 Supported Platforms

Currently XcodeServerSDK provides frameworks for the following platforms:

Platform Minimum Version Carthage CocoaPods
OS X 10.10
iOS 8.0
watchOS 2.0
tvOS ? ? ?

🎉 Projects using XcodeServerSDK

  • Buildasaur - connect Xcode Server with GitHub Pull Requests.
  • (using XcodeServerSDK too? Send a PR with a link to your project added here!)

Want to create yours but need some inspiration? Watch this WWDC 2015 session on Xcode Server! Using hardware buttons to start integrations? Why not! The sky is the limit.

✌️ License

MIT

🚢 Building & Testing

We use CocoaPods for dependency management. When you clone the repo, you'll need to run pod install to download the necessary dependencies.

✏️ Contributing

Create an issue or (preferably) send a pull request. Do you just want to get involved and help out? See the issues marked as up-for-grabs. These are the ones just waiting for some beautiful soul like you to build/fix it. We just don't have enough bandwidth and any help is welcome :) (You'll be in the contributors list of the release if you send a PR! 🎆)

💬 Get in touch

For things like general problems/ideas please report an issue, so anyone can see them and relate to them in the future. It's realy important for Open Source projects like this! If your problem requires a deep discussion or you have a great idea and you really want to share it with someone before opening an issue you can join the official Buildasaurs Slack team! (To do so, ping @czechboy0 on Twitter and have your e-mail address ready 📧)

🎅 Origin Story

This code has been pulled out of Buildasaur, bringing you integration of GitHub Pull Requests to Xcode Bots.

👽 Author

Honza Dvorsky honzadvorsky.com @czechboy0

About

Access Xcode Server API with native Swift objects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.1%
  • Ruby 2.2%
  • C++ 0.7%