The static library dependencies are built by external scripts, and do not use the naming settings specified here. However, Xcode uses the PRODUCT_NAME setting to generate the name of the placeholder product reference it creates automatically for each target.Specifying the base names of each static library in the build settings causes Xcode to generate names for its placeholder products which match the products that are actually built by the scripts.
This old build setting (like its replacement, ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES) is only needed for a target which does not contain any Swift code, but which embeds or tests another target which does contain Swift.
As of https://github.com/SwiftGit2/SwiftGit2/pull/60, the git2.h header no longer needs to be public.
This change silences a warning that "Umbrella header for module 'SwiftGit2' does not include header '.../git2.h'".
Setting the iOS deployment target at the project level ensures the IPHONEOS_DEPLOYMENT_TARGET environment variable is available to the scripts which build the external libraries.
Before this change, linking the external libraries with SwiftGit2-iOS resulted in hundreds of warnings that "object file (...) was built for newer iOS version (10.1) than being linked (9.2)".
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).
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.
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
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.