Commit Graph

198 Commits

Author SHA1 Message Date
Matt Rubin
e735a7d4cb Update project, source, and tests to build with Swift 2.3 2016-12-06 12:43:03 -05:00
Matt Rubin
40c40c6b2d Use a fork of Guanaco which supports Swift 2.3 2016-12-06 12:36:36 -05:00
Matt Rubin
76b3c9224e Update Quick to 0.9.3
The Cartfile now specifies a dependency on Quick ~> 0.9.3, the first version of the library to support Swift 2.3 and Xcode 8:
https://github.com/Quick/Quick/releases/tag/v0.9.3
2016-12-06 11:22:29 -05:00
Matt Rubin
ac3fde8763 Update Nimble to 4.1.0
The Cartfile now specifies a dependency on Nimble ~> 4.1.0, the first version of the library to support Swift 2.3 and Xcode 8:
https://github.com/Quick/Nimble/releases/tag/v4.1.0
2016-12-06 10:25:58 -05:00
Matt Rubin
e1c8a536d1 Update libgit2 to 0.24.3
Version 0.24.3 is the latest release version of libgit2, and also includes a fix for "non-modular header" errors:
0370dae1ad
2016-12-06 09:55:23 -05:00
Matt Rubin
775c582e29 Update xcconfigs to 0.10
The Cartfile now specifies a dependency on xcconfigs >= 0.10, the version intended for use with Xcode 8:
https://github.com/jspahrsummers/xcconfigs/releases/tag/0.10
2016-12-06 09:55:06 -05:00
Matt Rubin
9ea09594d4 Update Result to 2.1.3
The Cartfile now specifies a dependency on Result ~> 2.1.1, the first version of the library to support Swift 2.3 and Xcode 8:
https://github.com/antitypical/Result/releases/tag/2.1.1
2016-12-06 09:54:47 -05:00
Matt Diephouse
f097301ed7 Merge pull request #58 from tombooth/clone
Clone
2016-04-10 18:17:11 -04:00
Tom Booth
60cb395cc6 Add cloneFromURL function
This introduces a new static function on Repository that will allow a
user to clone a local or remote repository.

At the moment only SSH in-memory, username + password and default (no
creds) are implemented.

It provides an enum wrapper around the underlying libgit2 `git_cred_t`
type to abstract it away from the user into something that is a little
more Swift-like. As much of the C callback code and struct creation has
been moved into Swift-land as well, this is now possible as of 2.*
whereas before it was not.

I had to use a wrapper class in Credentials.swift in order to convert
blocks to pointers, as blocks do not implement the AnyObject protocol
that `Unmanaged` requies.

The test requires you passing through a set of environment variables
otherwise it will not run. This is so that secret/private information
isn't leaked into the repository. The required variables are as follows:

   - SG2TestPrivateRepo - the url of the private jrepo to clone;
   - SG2TestUsername - the url of the user that will be connecting;
   - SG2TestPublicKey - the public key data to be used;
   - SG2TestPrivateKey - the private key data;
   - SG2TestPassphrase - passphrase needed to use the private key (blank
     if none).
2016-04-07 14:50:38 +01:00
Tom Booth
c3b155cfd4 Switch cibuild to xcodebuild and xcpretty
`xctool` runs the tests as logic only whereas `xcodebuild` and XCode
run them as application tests. When tests are running logic only a lot
of the subsystems that would be available on the simulator are not
there, for example keychain and networking.

https://github.com/facebook/xctool/issues/269
https://github.com/AFNetworking/AFNetworking/pull/1707
https://github.com/facebook/xctool/issues/367
https://github.com/facebook/xctool/issues/553
2016-04-07 14:40:58 +01:00
Matt Diephouse
b8885e6509 Merge pull request #60 from drkibitz/feature/remove-pub-impl-detail
Remove the implementation detail leak, implemented in swift
2016-04-01 21:03:19 -04:00
Dr. Kibitz
86fcebd10c Use fromCString 2016-03-18 23:56:44 -07:00
Dr. Kibitz
876cd3edc1 Squashed commit of the following:
commit 1f2cc37d17c534d1df30824c8c462572dbd006df
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 23:30:46 2016 -0700

    Check for progress completion to destroy/dealloc callback pointer

    - Also some general cleanup

commit 792bb9d8a587b6d83dc9fd8e6119d6c79a23a679
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 10:05:03 2016 -0700

    this is a progress callback, don't clean up anything here

commit ce3c88058716089f511c5dd64c8c40813df783e9
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 00:45:22 2016 -0700

    remove one more uneeded type

commit 21b586ac57640d605af382d2b0f57d92900ab18e
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 00:44:46 2016 -0700

    Use move instead

commit 88630c94dbcf0b91e0223f45897168736044297a
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 00:40:16 2016 -0700

    address comments, dealloc after UnsafeMutablePointer alloc

commit e0fcfb82491dda4db815554a07b4c933d48ae420
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Fri Mar 18 00:39:51 2016 -0700

    add git2.h back as public header

commit 79287c952d1e288c5426b5ee1c4b3a5f9ab4efe7
Author: Dr. Kibitz <info@drkibitz.com>
Date:   Sun Mar 13 18:00:18 2016 -0700

    Remove the implementation detail leak, implemented in swift
2016-03-18 23:34:30 -07:00
Matt Diephouse
fe02162a6a Merge pull request #59 from BasThomas/swift2-print
Update println > print in README
2016-03-08 16:18:16 -05:00
Bas Broek
393414fef6 Update println > print 2016-03-08 21:14:51 +01:00
Matt Diephouse
6268766594 Merge pull request #57 from tombooth/fix-exc-bad-access-checkout
Fix EXC_BAD_ACCESS when progress updates
2016-03-03 12:22:45 -05:00
Tom Booth
281d1aed2b Fix EXC_BAD_ACCESS when progress updates
Previously when a block was passed into checkout() it would be copied
but then the memory would be freed as nothing had retained a reference
to the copy. This meant that when block() was called in
SG2CheckoutProgressCallback() it would crash due to an attempt to
execute a random chunk of memory that previously contained the block.

This code now retains the payload after copying it.
2016-03-03 16:30:26 +00:00
Matt Diephouse
e52387ce4f Merge pull request #56 from tombooth/quick-v0.9.1
Upgrade Quick to v0.9.1
2016-03-03 10:03:46 -05:00
Tom Booth
1292c6a78f Upgrade Quick to v0.9.1
This improves the quality of the test output, as noted by @modocache in
https://github.com/SwiftGit2/SwiftGit2/pull/52

A full diff of the changes to Quick can be found here:

https://github.com/Quick/Quick/compare/v0.8.0...v0.9.1
2016-03-03 14:13:03 +00:00
Matt Diephouse
1d28313725 Merge pull request #54 from tombooth/libgit2-to-v0.23.4
Upgrade libgit2 to v0.23.4
2016-02-27 18:40:48 -05:00
Tom Booth
8ea6f56fa0 Upgrade libgit2 to v0.23.4
The main reason for the upgrade is to enable use of SecureTransport for
https transport.

You can find a full diff here:

7c63a33ffe...e8feafe320

and the changelog changes:

7c63a33ffe...e8feafe320 (diff-4ac32a78649ca5bdd8e0ba38b7006a1e)
2016-02-26 16:20:37 +00:00
Matt Diephouse
97cd921046 Merge pull request #53 from tombooth/correct-dependency-order
Correct the dependency between openssl and libssh2
2016-02-23 15:14:58 -05:00
Tom Booth
433ef719eb Correct the dependency between openssl and libssh2
Previously, libgit2 was depending on both openssl and libssh2. This was
incorrect as libssh2 requires openssl for its build phase. I have moved
the openssl dependency back to libssh2.

I was testing using the scripts/cibuild executable, which masks any
dependency issues with openssl as it prebuilds it. This prebuilding was
done to get around TravisCI timeouts and so can't be removed to stop
this being missed again.
2016-02-23 18:26:00 +00:00
Matt Diephouse
778cf2b52e Merge pull request #52 from tombooth/ios
Return of the iOS target
2016-02-22 08:08:02 -05:00
Tom Booth
1e1655e0c9 Re-enable prebuilding OpenSSL
Now that the requirements for this script exist we can switch
prebuilding OpenSSL back on.
2016-02-22 11:18:16 +00:00
Tom Booth
6c0e55f3ca Structure xcode project for iOS
The commit contains all of the reconfiguration of the XCode project to
create a new iOS target and scheme. This follows, but occasionally
deviates from, the changes made in
https://github.com/SwiftGit2/SwiftGit2/pull/44. A couple of more
specific notes:

  - Disabled bitcode on iOS framework as the builds further down the
    chain won't currently generate bitcode. Not currently an issue but
    when Apple decided App Store can only contain bitcode it will be.
  - Update .gitignore to include directories generated as part of
    building openssl, libssh2 and libgit2. These are created as part of
    the build scripts borrowed from objective-git
  - Splits iOS/Mac libraries used into different groups for clarities
    sake
  - Set the debug and release configurations for the new targets to iOS
    Framework and Application
2016-02-22 11:17:41 +00:00
Tom Booth
77e26af360 Add OpenSSL and libssh2 for compilation on iOS
We need to include the source of these two libraries so that we can
compile them for the appropriate architectures and OS version used
by iOS.
2016-02-16 16:51:49 +00:00
Tom Booth
ae91f54aa7 Vary the bundle identifier based on platform
The two different test targets will bundle up the required fixtures
under different bundle identifiers, this corrects the identifier based
on platform.
2016-02-16 16:51:49 +00:00
Tom Booth
7da9b0a084 Semanitcally import Foundation rather than Cocoa
Cocoa/Cocoa.h doesn't exist on iOS and all this header file needs is
some exports from Foundation.
2016-02-16 16:51:49 +00:00
Tom Booth
aec66f930c Use ZipArchive to extract fixtures for tests
The current method used by this library uses NSTask to spin up an
externally running task to unzip the fixtures, this will not work on iOS
as this functionality is not allowed. Switching to use ZipArchive, as
noted by @modocache, provides a portable way of extracting fixtures.
2016-02-16 16:51:49 +00:00
Tom Booth
a6cde2b1d1 Use script/cibuild for CI
This brings further parity between the way SwiftGit2 and objective-git
build.

At the moment the pre-compilation of OpenSSL is commented out as this
external library is not currently included.
2016-02-16 16:51:43 +00:00
Tom Booth
cb5daab309 Bring script/ directory up to date
These scripts were borrowed from the objective-git project and utilized
in the branch that I am taking inspiration from
(https://github.com/SwiftGit2/SwiftGit2/pull/44). Bringing these up to
date includes some fixes for working with iOS. The changelog is as
follows:

Currently unmerged PR fixing script/cibuild for iphonesimulator:

https://github.com/libgit2/objective-git/pull/552

commit 24b2a886c0b61cf1dca0d55cac900b26616e50b9
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Nov 9 21:49:13 2015 -0700

    Fix libssh2 inclusion in libgit2 iOS build script

    - Added CMAKE_PREFIX_PATH to arch-specific libssh2 root dir
    - Added PKG_CONFIG_USE_CMAKE_PREFIX_PATH so things actually make
      sense
    - Removed unused LIBSSH2_INCLUDE_DIRS

commit dca46ad12a958095aca6ee431de842ca62857b11
Author: joe DeCapo <joe@polka.cat>
Date:   Wed Sep 23 05:26:43 2015 -0500

    Disable code signing during build

    Attempting solution from:
http://stackoverflow.com/questions/27671854/travis-ci-fails-to-build-with-a-code-signing-error

commit 0dc6c60dc0c13ecb088b2a93a9ad24b9c72a9b99
Merge: 4447e70 c9da387
Author: Josh Abernathy <joshaber@gmail.com>
Date:   Wed Sep 2 09:36:05 2015 -0400

    Merge pull request #484 from phatblat/ben/ios-test-target

    iOS Test target

commit 4447e700413adf920a665b138149a20344bc9c87
Merge: b7b2549 aa6dd45
Author: Josh Abernathy <joshaber@gmail.com>
Date:   Mon Aug 31 11:53:55 2015 -0500

    Merge pull request #497 from phatblat/ben/bootstrap

    Just install any missing tools in bootstrap

commit 15f906ca2efa9d5ba67744d25a825c9bc75ad9e7
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 15:25:38 2015 -0600

    Quote sdkflag

commit 2712c2a2beb294cd81ae44f733fdc9f17eb1a259
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 14:17:33 2015 -0600

    Add specific iOS simulator destination

    Specifying the destionation works around the following issue with
xctool. Can also hard-code the architecture, but this seems more
future-proof.

    ```
    Failed to query the list of test cases in the test bundle:
2015-08-24 10:57:11.740 sim[50821:2746840]
/Applications/Xcode6.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/sim:
No simulator devices appear to be running.  Setting data directories to
/var/empty.
    2015-08-24 10:57:11.741 sim[50821:2746840] DYLD_INSERT_LIBRARIES
contains possible bad values.  Caller beware:
/usr/local/Cellar/xctool/0.2.4/libexec/lib/otest-query-lib-ios.dylib
    dlopen(/Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests,
1): Library not loaded: @rpath/ObjectiveGit.framework/ObjectiveGit
      Referenced from:
/Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests
      Reason: no suitable image found.  Did find:
        /Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit.framework/ObjectiveGit:
mach-o, but wrong architecture
    ```

    Indeed, the "wrong architecture" message is correct as the framework
was built for a different architecture than the test binary:

    ```
    lipo -info ObjectiveGit.framework/ObjectiveGit
ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests
2015-08-24 11:03
    Non-fat file: ObjectiveGit.framework/ObjectiveGit is architecture:
i386
    Non-fat file: ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests is
architecture: x86_64
    ```

commit aa6dd4531cf3380250045c3bb19839d3a40934f1
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 12:31:31 2015 -0600

    /user -> /usr

commit b8efb3224393d12d720cbbbd348c2cb4ec066d6d
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 09:51:51 2015 -0600

    Abort script if Homebrew is not installed

commit e7b8e1aa4bf6aa20de09ff4b112ec688570914d1
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 09:42:17 2015 -0600

    Move check_deps to after update_submodules

commit 27473a0e8e92a47266664271ed4513806937efda
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Aug 24 09:34:21 2015 -0600

    Wrap long git submodule command chain for readability

commit 7724e36e7ca1666f535c8967c7534e04664d457e
Author: Ben Chatelain <ben@octop.ad>
Date:   Sun Aug 9 09:12:56 2015 -0600

    Update script comments

commit 768f033f0bf95c01793a941311cdbf45a7fb975c
Author: Ben Chatelain <ben@octop.ad>
Date:   Sat Aug 8 22:51:14 2015 -0600

    Fix iPhone SDK version detection in Xcode 7

commit cb0c5c12f9865e1aa270ed523ce0aeaf72c2be21
Author: Ben Chatelain <benchatelain@gmail.com>
Date:   Tue Jul 28 22:44:01 2015 -0600

    Just install any missing tools in bootstrap

    Now REQUIRED_TOOLS is a mix of commands and libraries

commit 8dda480f788e006277767810b29d8a760028ce8b
Author: Piet Brauer <piet@nerdishbynature.com>
Date:   Wed Jul 22 17:10:45 2015 +0200

    Prebuild OpenSSL in order to workaround Travis timouts

commit 6c66e65c539e3b53db6c5531743dcfecdb116c55
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Jul 20 21:45:01 2015 -0600

    Stop letting cmake determine which clang to use

commit 2ea1bd02d33ed7fcd0604404dc98693ad89f3815
Author: joshaber <joshaber@gmail.com>
Date:   Fri Jul 10 12:39:52 2015 -0400

    Include pkg-config in our dependencies.

commit c906271f580d6901a1200fc4795df250aca47cfc
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Jul 6 20:09:34 2015 -0600

    Disable CURL in libgit2 iOS build

commit 549717d138fd4cd1828c7e67fb810523794f1ecb
Author: Ben Chatelain <ben@octop.ad>
Date:   Mon Jul 6 20:09:16 2015 -0600

    Remove obsolete OPENSSL_ defines from libgit2 iOS build

commit aed2cc39c831697102ac6aff317990729b55dd2c
Author: Ben Chatelain <ben@octop.ad>
Date:   Thu Jun 25 21:16:56 2015 -0600

    Fix LIBSSH2_INCLUDE_DIRS define

commit 5ba578ac115974f0981d49b7c79072e867ef804b
Author: Ben Chatelain <benchatelain@gmail.com>
Date:   Tue Feb 17 17:10:32 2015 -0700

    Fix libgit2 Mac build (again)

    LIBSSH2_INCLUDE_DIR = /usr/local/include/

commit b0b011a9da2c784ef25e793a638c28c3b6387fd0
Author: Ben Chatelain <benchatelain@gmail.com>
Date:   Mon Feb 16 16:25:15 2015 -0700

    Revert "Fix libgit2 (Mac) build"

    This reverts commit fd67e2bc2fc40171b06df88b627a636bdcf102cb.

commit fd67e2bc2fc40171b06df88b627a636bdcf102cb
Author: Ben Chatelain <benchatelain@gmail.com>
Date:   Tue Feb 10 07:39:25 2015 -0700

    Fix libgit2 (Mac) build

commit b817e13e4c29bea355044e316d9214fbc955ac8f
Author: Ben Chatelain <benchatelain@gmail.com>
Date:   Mon Feb 9 08:40:20 2015 -0700

    Fix libgit2-ios build

    Set LIBSSH2_INCLUDE_DIR so that libssh2.h can be found

commit da4608b8a5bb87c3c75c7acdcc453fd69c6b8672
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date:   Thu Nov 6 15:10:33 2014 -0800

    Update objc-build-scripts to stop cleaning automatically

commit f8ff8a60bd0ca6dbfa7b170658c0be8f5f589cd6
Author: Alan Rogers <alanjrogers@me.com>
Date:   Tue Oct 28 15:51:29 2014 +1100

    Don't try and link .a's in the External folder.

commit 1e02f02ddcaf946f153449d604a0d60e2197aab8
Author: Alan Rogers <alanjrogers@me.com>
Date:   Tue Oct 28 15:51:15 2014 +1100

    Remove set -e because lol.

commit c32fe343651aacf91cbe3cf7d513c612f62b235e
Author: Alan Rogers <alanjrogers@me.com>
Date:   Tue Oct 28 14:41:47 2014 +1100

    Skip installing man pages to avoid too many symlink errors.

commit 88ee2eb305d3aeb1ece99c654f12da1fe2eadc40
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date:   Wed Oct 22 11:51:32 2014 -0700

    Update to jspahrsummers/objc-build-scripts@a54782c

commit 2c337c688a2779b51e6d4178cbace23750f3fde7
Author: Justin Spahr-Summers <jspahrsummers@github.com>
Date:   Tue May 27 09:21:55 2014 -0700

    Enable libgit2 thread safety for iOS

    No idea why this was ever disabled.

    Resolves libgit2/libgit2#2384.

    /cc @carlosmn @SquaredTiki

commit 19392f8a036dc603f115b6ced0d03f580dee0f47
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date:   Mon Nov 11 11:47:33 2013 -0800

    Add cmake as a required tool

commit 5b6cc97a958caedcc4dcbda18d1a193ed58a2ad6
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date:   Mon Nov 11 11:37:54 2013 -0800

    Update objc-build-scripts
2016-02-16 16:50:36 +00:00
Matt Diephouse
2c1fb0e21f Merge pull request #50 from tombooth/remove-box-submodule
Remove Box from .gitmodules
2016-02-10 14:45:28 -08:00
Tom Booth
92582ef3e8 Remove Box from .gitmodules
During the upgrade to Swift 2.0 in `5c8a600` the dependency on the
library Box was removed, but the submodule wasn't fully.

This caused projects depending on SwiftGit2 to fail when Carthage was
recursively retrieving dependencies as it would find reference to Box
but no directory for it. The error I encountered was as below:

```
Parse error: expected submodule commit SHA in output of task (ls-tree -z ... Carthage/Checkouts/Box) but encountered:
```
2016-02-10 22:27:44 +00:00
Matt Diephouse
d6787e905d Merge pull request #49 from JrGoodle/travis-ci
Add support for Travis CI
2016-01-30 20:56:29 -05:00
joe DeCapo
b7ae8cfc9a Update .travis.yml with dependencies 2016-01-30 19:14:26 -06:00
joe DeCapo
9d837b1a40 Add Travis CI build status badge to README.md 2016-01-30 17:58:52 -06:00
joe DeCapo
46fddb0082 Add .travis.yml for running tests with scan 2016-01-25 19:05:45 -06:00
joe DeCapo
374c856484 Add fastlane to .gitignore 2016-01-25 19:04:16 -06:00
Matt Diephouse
4149f2ce5d Set a higher deployment target for the tests
Guanaco seems to require 10.11+.
2016-01-17 11:26:02 -05:00
Matt Diephouse
9ce75607bc Ignore .xcscmblueprint files 2016-01-17 11:24:34 -05:00
Matt Diephouse
d3f27174b4 Merge pull request #47 from windmill-io/swift-2.0
SwiftGit2 won't build with Xcode 7.2 that uses Swift 2.0
2016-01-17 11:21:43 -05:00
Markos Charatzas
dcc9fcfd8c NFC, code review 2016-01-17 10:39:38 +00:00
Markos Charatzas
5c8a6000c4 updated to Swift 2.0
updated to Xcode 7.2 recommended settings
integrated with Nimble (v3.0.0), Quick (v0.8.0), Result (1.0.1)
integrated with Guanaco (5031bf67297afbe61ac0f2fbf3e3e8400b3f8888) that supports Swift 2.0
2016-01-16 14:57:32 +00:00
Matt Diephouse
44fd952378 Merge pull request #45 from SwiftGit2/update-result
Update Result to 0.4.1
2015-06-11 17:12:04 -04:00
Matt Diephouse
c4737c1098 Update Result to 0.4.1 2015-05-08 15:04:43 -04:00
Matt Diephouse
f6b8483145 Merge pull request #43 from SwiftGit2/antitypical-result
Switch from LlamaKit to antitypical/Result
2015-04-20 22:45:53 -04:00
Matt Diephouse
37bdb9eb0b Actually remove these submodules 2015-04-20 19:56:31 -04:00
Matt Diephouse
6e737b1190 Update to antitypical/Result 0.3 2015-04-20 19:51:27 -04:00
Matt Diephouse
e550eea24f We just say Xcode 6.3 2015-04-19 22:47:11 -04:00