Git Product home page Git Product logo

xcodeserversdk's Introduction

Xcode Server SDK

satellite badge Latest XcodeServerSDK Release CocoaPods

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.
To see how easy it is to integrate XcodeServerSDK into an iOS app, check out the XCSDemo project created by @cojoj.

📶 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'

🔧 Usage

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

do {
    let config = XcodeServerConfig(host: "https://127.0.0.1", user: "IRuleBots", password: "superSecr3t")
} catch ConfigurationErrors.NoHostProvided {
    fatalError("You haven't provided any host")
} catch ConfigurationErrors.InvalidHostProvided(let host){
    fatalError("You've provided invalid host: \(host)")
} catch ConfigurationErrors.InvalidSchemeProvided(let scheme) {
    fatalError("You've provided invalid scheme: \(scheme)")
} catch {
    fatalError("Error, not related to XcodeServerConfig; \(error)")
}

Instantiate XcodeServer.

let server = XcodeServerFactory.server(config: config)

Go wild!

server.getBots { bots, error in
    guard error == nil else {
        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

Apple has finally shipped the official docs for Xcode Server. They're slightly different from what has been presented on WWDC (slide 69). Below is the table with features described in docs - divided into categories. Last category, unofficial, is the cluster of features reverse engineered while working on XcodesServerSDK, so you won't find them in docs, but they're definitely in code! 😃

Category Description XcodeServerSDK support
Bots
Creates a new bot
Retrieve a list of bots
Retrieve a single bot
Update a single bot
Delete a single bot
Duplicate an existing bot
Integrations
Begin an integration for the specified bot
Retrieve a single integration
Delete an integration
Cancel a integration currently being executed
Retrieve options to perform filters, selections and calculations on all integrations for the specified bot partially
Retrieve options to perform filters, selections and calculations on all integrations partially
Retrieve the tests for an integration partially
Retrieve the test information list for a given integration and device identifier partially
Retrieve the test information list of issues for a given integration and device identifier
Retrieve the list of files for a given integration
Assets
Retrieve an asset given its relative path
Code Coverage
Retrieve the Code Coverage information for a given integration
Unofficial
Check if user can create bots
List hosted repositories on server
Create a new hosted repository
Get supported platforms
Get SCM branches from Blueprint
Verify user can manage server

🌇 Supported Platforms

Currently XcodeServerSDK provides support for the following platforms:

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

🎉 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.

💙 Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

✏️ 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, go to this website 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

xcodeserversdk's People

Contributors

cojoj avatar czechboy0 avatar drewcrawford avatar esttorhe avatar krausefx avatar lgaches avatar maxdesiatov avatar pmkowal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodeserversdk's Issues

Xcode 7: tested device format

The way we create bot testing devices has changed its format - adopt the one for Xcode 7.

  • Parsing
  • Export format for bot creation

Different amount of tests on different platform

@esttorhe, while you were creating targets you told us that both OS X and iOS will use the same test target. Could you explain something to me? (I have no idea how it works)

Right now, when I run tests on iOS I get:
screen shot 2015-06-25 at 13 01 50
Which was fine until I switched to OS X and run tests again which produced something different:
screen shot 2015-06-25 at 13 00 03


I wonder if it's normal that different targets shows us different test coverage? If you'll tell me that this is totally normal I'm fine... I just have no experience in this matter and that made me thinking 😉

Xcode 7: add new keys

Xcode 7 added new keys to the bot configuration json e.g. exportsProductFromArchive, codeCoveragePreference and more. Add them in the appropriate objects (both parsing and exporting)

A couple at random:

BotConfiguration

  • codeCoveragePreference
  • exportsProductFromArchive
  • deviceSpecification (WIP: #21).

SourceControlBlueprint (WIP: #22)

  • DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustSelfSignedCertKey
  • DVTSourceControlWorkspaceBlueprintRemoteRepositoryTrustedCertFingerprintKey

Using third-party libraries

@czechboy0 I cleary see that you're trying to do everything using built-in tools. Are there any specific arguments why?

I'm now struggling with Swift 2.0 conversion and the most problematic classes are eg. JSON.

Why doing it manually while we have some great tools like Argo?

Dependency management support

It would be nice to have a dependency management for this SDK and allow users to easily use it in they projects. I think that support for cocoapods and Carthage is required to create a whole new range of possibilities for developers.

Date from array

@czechboy0 I can't find this anywhere in code so I'll simply ask.
In some responses we're getting date but in form of array of components. Didiyou write a method or extension for handling this?
I only found dateForKey() and optionalDateForKey() but they work with Strings.

We need something to get this array by calling arrayForKey() and return NSDateComponents or date formatted String.

Got any hints how you want it to be implemented? Here are my ideas:

  • add new method to JSON which will return NSDate
  • add extension to NSArray which will create NSDate or NSDateComponents or String

In any case we'll have to manually take fields fromArray and put them in NSDateComponents like:

let components = NSDateComponents()

components.year = array[0]
components.month = array[1]
components.day = array[2]
components.hour = array[3]
components.minute = array[4]
components.second = array[5]

Which kind of sucks...
What's more, Array of components we get from XCS has 7 fields and I wonder what is the 7th one... It doesn't look like a timezone... Nanoseconds?

XcodeServerConfig refactoring

While writing tests for this class I've noticed that it may be struggling in some cases.

First of all, when you create object using public init(var host: String, user: String?, password: String?) we're checking if host has https scheme and so on but if we go through the second init?() we can see that it won't check if scheme was provided - it only checks existence of host.

I think we should extract method for checking and creating host eg.


funct validateHost(var host: String) -> String{
    if let url = NSURL(string: host) {
        if url.scheme.isEmpty {
            // exted host with https scheme
            host = "https://" + host
        } else if url.scheme != "https" {
            Log.error("Xcode Server generally uses https, please double check your hostname")
        }
    }

    return host
}

But I think in this case we can make some use of throws and guard...

Playground

I've investigated some projects which follows the pattern of having .xcworkspace in which they have Framework itself, sample project and also a Playground (using framework) and after digging I can confirm that we have everything to run this pattern!

Here's a proof:
screen shot 2015-06-20 at 00 05 00
As you can see I can import XcodeServerSDK and use it in Playground with code completion etc.

Earlier the problem was with wrong configuration of Playground (was targeting iOS while framework support OS X only). I think we have solution to this issue in #24 and also this matter was explained in by @esttorhe in #25.

I'll check this PR tomorrow and if everything will work fine I will strongly suggest to merge it.

Move API calls to separate files

At the moment, all API calls are stored in XcodeServer.swift. It'd be advisable to move the to separate files and make extensions from them as the number of API calls may increase in the future.

I suggest separating them by type eg. XcodeServer+Bots will store all Bot related API calls, XcodeServer+Integrations will handle Integration and so on...

I don't know what's the proper naming convention and used well know convention from Objective-C. We can stick to this or decide on different style.


This issue is blocked until #44 is completed as this one may introduce some merge conflicts.

Testing public/internal/private methods

I assume that public is in every XcodeServerSDK class because of Swift 1.2 leftovers? I mean from testing point of view. But now, with Swift 2 we were blessed with this beautiful @testable annotation, so why not Zoidberg?

IMHO, classes like JSON, HTTPUtils and some more are not meant to be used out of internal scope, so we definitely can remove public access. Why do you think?

Podfile parsing error

I've pulled new things from repo and wanted to call pod install and there's some kind of parsing error. I haven't investigated it yet but here's the output, so feel free to have a look:

[!] ERROR: Parsing unable to continue due to parsing error:
contained in the file located at /Users/cojoj/Developer/XcodeServerSDK/Podfile.lock
PODS:
  - BuildaUtils (0.0.4)
  - DVR (0.0.2-czechboy0)

DEPENDENCIES:
  - BuildaUtils (= 0.0.4)
  - DVR (from `https://github.com/czechboy0/DVR.git`, tag `v0.0.2-czechboy0`)

EXTERNAL SOURCES:
  DVR:
    :git: https://github.com/czechboy0/DVR.git
    :tag: v0.0.2-czechboy0

CHECKOUT OPTIONS:
  DVR:
    :git: https://github.com/czechboy0/DVR.git
    :tag: v0.0.2-czechboy0

SPEC CHECKSUMS:
  BuildaUtils: 88917cac8b0248c792c8d0ff269b24870d36903f
  DVR: c252cd3f4a88f6a3a49f0d66305335951a0aa133

COCOAPODS: 0.38.0.beta.2

Tidying the directory

To keep everything clean I suggest dividing all files to separate directories eg. Bot is a big object with smaller pieces like Trigger and so on.

It would be nice to have the grouped in the proper way. I think this can be achieved only by laborious JSON analysis but IMHO it'll pay off in future.

Add missing functionalities to support API

Apple has left as with a table of supported endpoint in Xcode 7. It shows up that they're only providing some basic stuff but it's necessary for us to cover them all!
We're on a good way and already cover most but some of them are missing - not because we don't have code to support them but because a nice, convenience method hasn't beed written yet (you can do it).

In README you can see a table of features, so if you're planning to implement some of those missing methods, plase update README as well


Here's the list of all official endpoints:

  • List bots on server
  • Create a new bot
  • Retrieve a bot by ID
  • Update a bot’s configuration (will be tricky)
  • Get the most recent integrations for a bot
  • Enqueue a new integration
  • List integrations on server
  • Retrieve an integration by ID
  • 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

Should be an easy one for anyone with 20mins on their hands.
-- @czechboy0 in #39


If you're wondering how to determine what endpoint will be used in official API, here's the list:

Type Path Description
GET /bots List bots on server
POST /bots Create a new bot
GET /bots/(id) Retrieve a bot by ID
PATCH /bots/(id) Update a bot’s configuration
GET /bots/(id)/integrations Get the most recent integrations for a bot
POST /bots/(id)/integrations Enqueue a new integration
GET /integrations List integrations on server
GET /integrations/(id) Retrieve an integration by ID
GET /integrations/(id)/commits List the commits included in an integration
GET /integrations/(id)/issues List the build issues produced by an integration
GET /devices List devices connected to server
GET /repositories List hosted repositories on server
POST /repositories Create a new hosted repository

If you need some motivation to start doing this task, please refer to #2 😉

iOS target missing

I noticed on the podspec that there's support for iOS (which makes sense because the files are architecture independent as far as I could see) but the project lacks an iOS target which makes it impossible to use on an iOS project using Carthage because it will only build the OS X framework.

Hopefully I'll be able to easily create an iOS target and will issue a PR with said fix later today but wanted to leave this issue to easily track it down.

🙇

XcodeServerEndpoints refactoring proposition

Hi guys, recently I was playing a little bit with Xcode Server and I would be glad to help you i.e. increasing test coverage.

After look at the project, I thought it would be good to test e.g. endpointURL method in the XcodeServerEndpoints class. But since it is a private method, I would suggest to move this method to a seperate class and make this method internal. What do you think?

Carthage support

In #1 @cojoj mentioned Carthage support. Let's look into how much would be required to properly support it, test out that our framework works both in iOS and OS X projects and if everything works, let's add the proper badge into our readme: Carthage compatible

@cojoj, do you want to take care of this?

Testing

I'll start writing test suit but I think that it's a good idea to start this from swift-2 branch and take advantage of test coverage.

I think we can stick to XCTest as it works pretty great right now.

One think I want to ask you @czechboy0. Do you think I should create PR after I finish everything/most of the work or create new PR at the beginning of the whole process and allow anyone (with focus on you) to track changes, comment them and suggest changes to keep people more involved into the process?

Detect XCS API version in server responses

We might need to drop support for old API versions in the future, so we need a way to verify that we're not attempting to talk to an incompatible version of the API.

Will be useful when user upgrades their XCS and we can throw and error telling them to upgrade their XcodeServerSDK version as well.

Add platforms for tvOS and tvOS simulator

In DeviceSpecification.swift, so that we support tvOS targets. We'll need to put a beta Xcode on Xcode Server and then just GET https://SERVER:20343/api/platforms and find out what the codes for those platforms are and add them in DeviceSpecification.swift.

Automatically detect API version

Responses from Xcode Server return in their headers the API version, so instead of having to initialize the Config file with the API version, we should make one call in the beginning to find out which version we're talking to and save that in memory inside of XcodeServer.

Don't send `rev` when deleting a Bot

  • - routes_bot.js - app.delete(k.XCSAPIBasePath + '/bots/:id/:rev?', prepareRequest, verifyIfServiceIsEnabledAllowCertificate, enforceBotCreatorRole, botClass.remove.bind(botClass));
    Seems like we might not need to send the rev any more when deleting a bot. Try and remove the rev if it works.
  • - up the compatibility version from 5 to 6

Wait for integration results

Right now the available API allow you to postIntegration but it returns immediately. It'd be nice if callback could wait for integration to finish, but also a protocol informing about this fact would be nice.

carthage doesn't actually work

$ cat Cartfile
github "czechboy0/XcodeServerSDK"
$ carthage update
*** Fetching XcodeServerSDK
*** Checking out XcodeServerSDK at "v0.1.8"
*** xcodebuild output can be found in /var/folders/vv/z02zhgz508g99fs34mhrkw6c0000gp/T/carthage-xcodebuild.giIC0L.log
*** Building scheme "XcodeServerSDK - iOS" in XcodeServerSDK.xcworkspace
2015-08-10 00:17:54.990 xcodebuild[13533:896741] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:17:54.991 xcodebuild[13533:896741] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/XcodeServerSDK.build/Release-iphoneos/XcodeServerSDK\ -\ iOS.build/Script-E4E84B0D84D059B3B424AD1F.sh
(1 failure)
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
A shell task failed with exit code 65:
2015-08-10 00:17:54.990 xcodebuild[13533:896741] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:17:54.991 xcodebuild[13533:896741] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/XcodeServerSDK.build/Release-iphoneos/XcodeServerSDK\ -\ iOS.build/Script-E4E84B0D84D059B3B424AD1F.sh
(1 failure)
DEVE

One can work around this issue with

$ cd Carthage/Checkouts/XcodeServerSDK/
$ pod install

However it then fails with a new error

carthage update
*** Fetching XcodeServerSDK
*** Checking out XcodeServerSDK at "v0.1.8"
*** xcodebuild output can be found in /var/folders/vv/z02zhgz508g99fs34mhrkw6c0000gp/T/carthage-xcodebuild.RVZz0S.log
*** Building scheme "XcodeServerSDK - iOS" in XcodeServerSDK.xcworkspace
2015-08-10 00:19:08.901 xcodebuild[13655:898925] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:19:08.902 xcodebuild[13655:898925] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:19:12.090 xcodebuild[13655:898960]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-7709/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:77
Details:  Failed to load dependencies output contents from ``/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “TimeUtils.d” couldn’t be opened because there is no such file." UserInfo=0x7ffda053f280 {NSFilePath=/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d, NSUnderlyingError=0x7ffda06492d0 "The operation couldn’t be completed. No such file or directory"}. User info: {
    NSFilePath = "/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, void (^__strong)(NSString *__strong))
Thread:   <NSThread: 0x7ffda05648b0>{number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/ContainerExtensions.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Errors.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Extensions.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/HTTPUtils.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/JSON.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Logging.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Script.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Server.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(9 failures)
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
/Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/Target Support Files/BuildaUtils/BuildaUtils-umbrella.h:1:9: error: 'Cocoa/Cocoa.h' file not found
<unknown>:0: error: could not build Objective-C module 'BuildaUtils'
A shell task failed with exit code 65:
2015-08-10 00:19:08.901 xcodebuild[13655:898925] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SparkInspectorXcodePlugin.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:19:08.902 xcodebuild[13655:898925] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2015-08-10 00:19:12.090 xcodebuild[13655:898960]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-7709/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:77
Details:  Failed to load dependencies output contents from ``/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “TimeUtils.d” couldn’t be opened because there is no such file." UserInfo=0x7ffda053f280 {NSFilePath=/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d, NSUnderlyingError=0x7ffda06492d0 "The operation couldn’t be completed. No such file or directory"}. User info: {
    NSFilePath = "/Users/drew/Library/Developer/Xcode/DerivedData/XcodeServerSDK-awbzscrzexqjxfdtrpkyknwtbkbp/Build/Intermediates/Pods.build/Release-iphoneos/BuildaUtils.build/Objects-normal/arm64/TimeUtils.d";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, void (^__strong)(NSString *__strong))
Thread:   <NSThread: 0x7ffda05648b0>{number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/ContainerExtensions.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Errors.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Extensions.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/HTTPUtils.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/JSON.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Logging.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Script.swift
    CompileSwift normal arm64 /Users/drew/Code/CaveJohnson2/Carthage/Checkouts/XcodeServerSDK/Pods/BuildaUtils/BuildaUtils/Server.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(9 failures)

To work around this, I had to remove iOS/watch targets as you can see in my fork. I don't need them, so that wasn't a big deal.

Change API call signatures to use ErrorType instead of NSError

Right now most of our API endpoint methods (these located in XcodeServer extensions) are constructed in non-swifty way - they return optional NSError pointers.

How about gradually changing them to throwing methods?
There are some benefits of doing this:

  1. Swifty way (most important argument... 😜)
  2. Reduce amount of Optionals
  3. More descriptive errors, as they'll be enums

I know, I know, I may be overreacting... Maybe that's because I have too much free time? 😝

Xcode 7: server fingerprint verification

  • Understand what the hell is going on
  • Add example JSON payloads that I got from hacking XCS
  • Add keys into Blueprint for certificate fingerprint etc.
  • Test bot creation on the new API works
  • Investigate whether forced preflight (to verify the bot will be valid) makes sense
  • Add parsing tests for all the various cases (will be moved to another PR)
  • Add a way to not automatically trust new servers, instead failing gracefully

Support for ᴡᴀᴛᴄʜ

Right now the project only supports OS X and iOS.

If someone would like to use the framework on an ᴡᴀᴛᴄʜ application there would be no framework support for the ⌚ app.

Commits request

I'm working on another point from #40 and I want to consult some matters before implementing anything.

It's obvious that List the commits included in an integration will consist of Commit model but... Response JSON is strange in some way and I'd like to clarify naming convention.
Basically integration/id/commits response JSON looks like:

{
    "count": 1,
    "results": [{
        "_id": "62395864c6d0b1fc6536c0ab3a0d2b2d",
        "_rev": "3-ced1cebb3b420512ee66e7a1927e32f2",
        "commits": {
                  []
                },
                "integration": "62395864c6d0b1fc6536c0ab3a0d0733",
        "botID": "38a6d8e59f34d59c810e98f5c6030e02",
        "botTinyID": "23530A6",
        "endedTimeDate": [2015, 7, 7, 14, 15, 20],
        "doc_type": "commit",
        "tinyID": "127FDC7"
    }]
}

IMHO, main object should be called something like IntegrationCommits because there's Commits array inside of it but Commit, itself, doesn't containt fields to be XcodeServerEntity.
What's more, commits array contains an array of repositories which holds actual commits - so another model?
Actual Commit looks like:

{
    "XCSCommitCommitChangeFilePaths": [{
        "status": 4,
        "filePath": "cells/NewProductCell.m"
    }, {
        "status": 4,
        "filePath": "GreetingTextViewController.m"
    }, {
        "status": 4,
        "filePath": "ViewControllers/NewChooseProductViewController.m"
    }],
    "XCSCommitMessage": "Fixed ios7 bug",
    "XCSBlueprintRepositoryID": "715A78DA7313BF688CEE0585F44D4F0B2EAEE4B8",
    "XCSCommitContributor": {
        "XCSContributorEmails": ["[email protected]"],
        "XCSContributorName": "Foo Bar",
        "XCSContributorDisplayName": "Foo Bar"
    },
    "XCSCommitHash": "aeb85aed37e633b6c9776cb863a39f922cb464d9",
    "XCSCommitTimestamp": "2015-07-07T14:14:29.000Z",
    "XCSCommitTimestampDate": [2015, 7, 7, 14, 14, 29]
}

I have a feeling I'm complicating everything but what do you think - should those models be separated or treated like one big, nested model and inherit from XcodeServerEntity?

New name for this project! [POLL]

I created an organization Buildasaurs for all these little monsters. Maybe a more appropriate name for this project might be in order?

  • Xcodesaur?
  • XcodeServersaur?
  • XCsaur?
  • XCSaur?
  • XcodeServo?
  • ?
  • profit

Vote with your comments.

Crash - no available platforms on Xcode Server

Happens on certain instances of Xcode Server

Application Specific Information:
fatal error: Couldn't find intended platform in list of platforms: []!: file /Users/honzadvorsky/Documents/Buildasaur/Pods/XcodeServerSDK/XcodeServerSDK/API Routes/XcodeServer+Bot.swift, line 172

Originally reported by @valeriomazzeo in buildasaurs/Buildasaur#143.


Solution:

  • instead of crashing, just generate an error describing this issue and fail the bot-creation process
  • make sure Buildasaur shows this error in the UI

BuildaUtils for iOS target

I've tried to run today XcodeServerSDK's iOS target I get this rather strange error:

screen shot 2015-07-29 at 10 43 52

It looks like our Podfile is linking wrong BuildaUtils target. Any idea what's wrong?

New Xcode API

While watching Platforms state of the union I've heard that from the new versions there'll be official JavaScript API for interacting with Xcode. I haven't watched new session about server (will do ASAP).

If this is true, how will it impact existing code? Maybe no more reverse engineering will be needed to develop this project? 😏

I'm more interested in adding missing functionalities and provide support for all endpoints included in Xcode.

Use `final` to aid compiler optimizations

I know I've been fighting like a lot for changing classes into structs but @czechboy0 persuaded me that there is sense in making XcodeServerEntity as class. My main argument was:

Let's make compiler happy...

So today, I've came with solution how to marry class with my happy compiler thing - let's mark some methods, properties, classes as final as they probably won't be inherited more times. Let me know if that make sense to you.

Protocol Oriented Programming

As you know, Apple has presented new way of programming - which will make Crusty happy.

I know it's all about personal taste... But I really like the idea and I think it can release the great power of Swift.

This whole XcodeServerEntity-subclass model in existing SDK is a great candidate to redesign it with Protocol Oriented Programming. This will allow to drop this big inheritance tree and implement only necessary stuff. What's more it can allow to replace classes with structs which will also have a great impact on performance.

@czechboy0 what do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.