9 Commits

Author SHA1 Message Date
dependabot[bot] 064aed35b6 Bump actions/checkout from 4 to 5 (#217)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-23 11:41:49 +02:00
Hannes Achleitner 0505abce23 Fix build with XCode 16 (#216) 2025-04-29 18:39:45 +02:00
Hannes Achleitner 89b08709e4 Use an arm64 runner for CI (#212) 2024-12-06 08:19:01 +01:00
Hannes Achleitner f4ba5cd328 Shell improvement (#215)
See https://github.com/koalaman/shellcheck/wiki/SC2086
2024-11-19 13:13:13 +01:00
Hannes Achleitner 20b46e76dd Fix compilation on macOS 10.13+ and Xcode 15 (#210)
https://github.com/SwiftGit2/SwiftGit2/pull/210#discussion_r1846442039
2024-11-18 13:26:07 +01:00
Hannes Achleitner 5eb09593a0 Rename matrix in CI (#207) 2023-11-29 20:32:58 +01:00
dependabot[bot] 6836608fca Bump actions/checkout from 3 to 4 (#202)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 16:55:16 +02:00
Artur Hellmann 67b2ee52e8 Loading all commits from a base, not only branch (#188)
--------

Co-authored-by: Artur Hellmann <artur.hellmann@aboalarm.de>
2023-10-17 16:51:58 +02:00
Hannes Achleitner a5a9656732 runGitHub action on pull request (#201) 2023-10-17 16:46:26 +02:00
27 changed files with 318 additions and 279 deletions
+11
View File
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
+45
View File
@@ -0,0 +1,45 @@
name: pull request
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
xcode: [ Xcode_14.3, Xcode_15.2.0 ]
os: [ macos-13 ]
include:
- xcode: Xcode_15.4
os: macos-14
- xcode: Xcode_16.2
os: macos-14
steps:
- name: ls Xcode
run: ls -la /Applications/Xcode*
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: get architecture
run: |
echo "ARCHITECTURE=$(uname -m)" >> $GITHUB_ENV
echo $(uname -m)
- name: Set XCode Version
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}.app
- name: schemes list
run: xcodebuild -workspace SwiftGit2.xcworkspace -list
- name: update_libgit2
run: script/update_libgit2
- name: bootstrap
run: script/bootstrap
# - name: cibuild
# run: script/cibuild
- name: Build project
run: xcodebuild -workspace SwiftGit2.xcworkspace -scheme SwiftGit2-OSX -archivePath ./SwiftGit2 archive ARCHS="${{ env.ARCHITECTURE }}"
-2
View File
@@ -19,5 +19,3 @@
[submodule "External/openssl"]
path = External/openssl
url = https://github.com/openssl/openssl.git
[submodule "libgit2"]
url = https://github.com/libgit2/libgit2.git
-30
View File
@@ -1,30 +0,0 @@
language: objective-c
os: osx
osx_image: xcode11.4
sudo: false # Enable container-based builds
env:
matrix:
- SCHEME="SwiftGit2-OSX"
- SCHEME="SwiftGit2-iOS"
matrix:
fast_finish: true
before_install:
- gem update bundler # https://github.com/bundler/bundler/pull/4981
- gem install xcpretty
- gem install xcpretty-travis-formatter
install: script/bootstrap
script: script/cibuild
branches:
only: # whitelist
- master
notifications:
email: false
+2 -2
View File
@@ -1,4 +1,4 @@
github "jspahrsummers/xcconfigs" ~> 1.1
github "Quick/Quick" ~> 7.0
github "Quick/Nimble" ~> 12.0
github "Quick/Quick" ~> 2.0
github "Quick/Nimble" ~> 8.0
github "ZipArchive/ZipArchive" ~> 2.0
+3 -3
View File
@@ -1,4 +1,4 @@
github "Quick/Nimble" "v12.3.0"
github "Quick/Quick" "v7.3.0"
github "ZipArchive/ZipArchive" "2.5.5"
github "Quick/Nimble" "v8.1.2"
github "Quick/Quick" "v2.2.1"
github "ZipArchive/ZipArchive" "v2.2.3"
github "jspahrsummers/xcconfigs" "1.1"
-1
View File
@@ -1 +0,0 @@
/opt/homebrew/opt/openssl/lib/libcrypto.a
-1
View File
@@ -1 +0,0 @@
/opt/homebrew/opt/openssl/lib/libssl.a
-1
View File
@@ -1,5 +1,4 @@
# SwiftGit2
[![Build Status](https://travis-ci.org/SwiftGit2/SwiftGit2.svg)](https://travis-ci.org/SwiftGit2/SwiftGit2)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](#carthage)
[![GitHub release](https://img.shields.io/github/release/SwiftGit2/SwiftGit2.svg)](https://github.com/SwiftGit2/SwiftGit2/releases)
![Swift 5.3.x](https://img.shields.io/badge/Swift-5.3.x-orange.svg)
+93 -69
View File
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 54;
objectVersion = 46;
objects = {
/* Begin PBXAggregateTarget section */
@@ -28,8 +28,6 @@
25499D325997CAB9BEFFCA4D /* CommitIterator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25499A996CA7BD416620A397 /* CommitIterator.swift */; };
3F5181B1258FE7D10048F1EF /* StatusOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F5181B0258FE7D10048F1EF /* StatusOptions.swift */; };
3F5181B2258FE7D10048F1EF /* StatusOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F5181B0258FE7D10048F1EF /* StatusOptions.swift */; };
50A6835E2ADE7C2B00FDB557 /* libgit2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50A6835C2ADE7C2300FDB557 /* libgit2.xcframework */; };
50A6835F2ADE7C2B00FDB557 /* libgit2.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 50A6835C2ADE7C2300FDB557 /* libgit2.xcframework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
621E66A01C72958800A0F352 /* OID.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE70B3E41A1ACB1A002C3F4E /* OID.swift */; };
621E66A11C72958800A0F352 /* Remotes.swift in Sources */ = {isa = PBXBuildFile; fileRef = BECB5F6D1A57284700999413 /* Remotes.swift */; };
621E66A21C72958800A0F352 /* CheckoutStrategy.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE276B281ACCD3CF00D6DAD7 /* CheckoutStrategy.swift */; };
@@ -127,30 +125,20 @@
remoteGlobalIDString = BEB31F221A0D6F7A00F525B9;
remoteInfo = "SwiftGit2-OSX";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
50A682E52ADBF65F00FDB557 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
50A6835F2ADE7C2B00FDB557 /* libgit2.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
BEB31F941A0E56E200F525B9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BEB31F1A1A0D6F7A00F525B9 /* Project object */;
proxyType = 1;
remoteGlobalIDString = BEB31F8E1A0E563900F525B9;
remoteInfo = libgit2;
};
/* End PBXCopyFilesBuildPhase section */
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
232861421F4A3A2E00276D65 /* Diffs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Diffs.swift; sourceTree = "<group>"; };
237731C61F46542B0020A3FE /* repository-with-status.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = "repository-with-status.zip"; sourceTree = "<group>"; };
25499A996CA7BD416620A397 /* CommitIterator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommitIterator.swift; sourceTree = "<group>"; };
3F5181B0258FE7D10048F1EF /* StatusOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusOptions.swift; sourceTree = "<group>"; };
50A682D82AD9901000FDB557 /* script */ = {isa = PBXFileReference; lastKnownFileType = folder; path = script; sourceTree = "<group>"; };
50A6835A2ADD33CE00FDB557 /* libgit2-mac.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libgit2-mac.a"; path = "External/libgit2-mac/libgit2-mac.a"; sourceTree = "<group>"; };
50A6835C2ADE7C2300FDB557 /* libgit2.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = libgit2.xcframework; path = "External/libgit2-ios/libgit2.xcframework"; sourceTree = "<group>"; };
621E66B41C72958800A0F352 /* SwiftGit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftGit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
621E66CE1C72958D00A0F352 /* SwiftGit2-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftGit2-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
621E66E11C729CE500A0F352 /* libgit2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgit2.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -198,6 +186,7 @@
BEB31F571A0D75EE00F525B9 /* macOS-StaticLibrary.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "macOS-StaticLibrary.xcconfig"; sourceTree = "<group>"; };
BEB31F581A0D75EE00F525B9 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
BEB31F6C1A0D78F300F525B9 /* Repository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Repository.swift; sourceTree = "<group>"; };
BEB31F8F1A0E563900F525B9 /* libgit2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgit2.a; sourceTree = BUILT_PRODUCTS_DIR; };
BEB31F9D1A0E595100F525B9 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; };
BEB31F9F1A0E595600F525B9 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
BECB5F691A56F19900999413 /* References.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = References.swift; sourceTree = "<group>"; };
@@ -216,7 +205,6 @@
buildActionMask = 2147483647;
files = (
621E67001C72A60B00A0F352 /* libz.tbd in Frameworks */,
50A6835E2ADE7C2B00FDB557 /* libgit2.xcframework in Frameworks */,
621E66FE1C72A5FF00A0F352 /* libiconv.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -255,15 +243,6 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
50A682D92AD994C500FDB557 /* Frameworks */ = {
isa = PBXGroup;
children = (
50A6835C2ADE7C2300FDB557 /* libgit2.xcframework */,
50A6835A2ADD33CE00FDB557 /* libgit2-mac.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
621E66D41C72965C00A0F352 /* Mac */ = {
isa = PBXGroup;
children = (
@@ -297,14 +276,12 @@
BEB31F191A0D6F7A00F525B9 = {
isa = PBXGroup;
children = (
50A682D82AD9901000FDB557 /* script */,
BEB31F251A0D6F7A00F525B9 /* SwiftGit2 */,
BEB31F261A0D6F7A00F525B9 /* Supporting Files */,
BEB31F321A0D6F7A00F525B9 /* SwiftGit2Tests */,
BEB31FA11A0E63C100F525B9 /* Libraries */,
BEB31F411A0D75EE00F525B9 /* Configuration */,
BEB31F241A0D6F7A00F525B9 /* Products */,
50A682D92AD994C500FDB557 /* Frameworks */,
);
sourceTree = "<group>";
usesTabs = 1;
@@ -314,6 +291,7 @@
children = (
BEB31F231A0D6F7A00F525B9 /* SwiftGit2.framework */,
BEB31F2E1A0D6F7A00F525B9 /* SwiftGit2-OSXTests.xctest */,
BEB31F8F1A0E563900F525B9 /* libgit2.a */,
621E66B41C72958800A0F352 /* SwiftGit2.framework */,
621E66CE1C72958D00A0F352 /* SwiftGit2-iOSTests.xctest */,
621E66E11C729CE500A0F352 /* libgit2.a */,
@@ -485,7 +463,6 @@
621E669F1C72958800A0F352 /* Sources */,
621E66AA1C72958800A0F352 /* Frameworks */,
621E66AE1C72958800A0F352 /* Headers */,
50A682E52ADBF65F00FDB557 /* Embed Frameworks */,
);
buildRules = (
);
@@ -566,7 +543,6 @@
isa = PBXNativeTarget;
buildConfigurationList = BEB31F391A0D6F7A00F525B9 /* Build configuration list for PBXNativeTarget "SwiftGit2-OSX" */;
buildPhases = (
50A682DD2AD9959500FDB557 /* Update libgit2 */,
BEB31F1E1A0D6F7A00F525B9 /* Sources */,
BEB31F1F1A0D6F7A00F525B9 /* Frameworks */,
BEB31F201A0D6F7A00F525B9 /* Headers */,
@@ -574,6 +550,7 @@
buildRules = (
);
dependencies = (
BEB31F951A0E56E200F525B9 /* PBXTargetDependency */,
);
name = "SwiftGit2-OSX";
productName = "SwiftGit2-OSX";
@@ -598,6 +575,21 @@
productReference = BEB31F2E1A0D6F7A00F525B9 /* SwiftGit2-OSXTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
BEB31F8E1A0E563900F525B9 /* libgit2-OSX */ = {
isa = PBXNativeTarget;
buildConfigurationList = BEB31F901A0E563900F525B9 /* Build configuration list for PBXNativeTarget "libgit2-OSX" */;
buildPhases = (
BEB31F931A0E567000F525B9 /* ShellScript */,
);
buildRules = (
);
dependencies = (
);
name = "libgit2-OSX";
productName = libgit2;
productReference = BEB31F8F1A0E563900F525B9 /* libgit2.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -622,6 +614,9 @@
CreatedOnToolsVersion = 6.1;
LastSwiftMigration = 1020;
};
BEB31F8E1A0E563900F525B9 = {
CreatedOnToolsVersion = 6.1;
};
C9CE0DD21E0710BD0053205D = {
CreatedOnToolsVersion = 8.2;
ProvisioningStyle = Automatic;
@@ -645,6 +640,7 @@
BEB31F2D1A0D6F7A00F525B9 /* SwiftGit2-OSXTests */,
621E66611C72958800A0F352 /* SwiftGit2-iOS */,
621E66B61C72958D00A0F352 /* SwiftGit2-iOSTests */,
BEB31F8E1A0E563900F525B9 /* libgit2-OSX */,
621E66DC1C729CE500A0F352 /* libgit2-iOS */,
621E66E71C729EB800A0F352 /* OpenSSL-iOS */,
621E66ED1C729EBB00A0F352 /* libssh2-iOS */,
@@ -679,36 +675,14 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
50A682DD2AD9959500FDB557 /* Update libgit2 */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Update libgit2";
outputFileListPaths = (
);
outputPaths = (
"$(SRCROOT)/External/libgit2-mac/libgit2-mac.a",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "script/update_libgit2\n";
};
621E66DD1C729CE500A0F352 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
"$(SRCROOT)/External/libgit2-ios/libgit2.xcframework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@@ -716,7 +690,6 @@
};
621E66E81C729EB800A0F352 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -730,7 +703,6 @@
};
621E66EE1C729EBB00A0F352 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -740,11 +712,23 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "script/update_libssh2_ios\n";
shellScript = script/update_libssh2_ios;
};
BEB31F931A0E567000F525B9 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "script/update_libgit2\n";
};
C9CE0DD61E0710C20053205D /* Lint Sources */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -755,7 +739,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint --lenient\nelse\n echo \"warning: SwiftLint is not installed\"\nfi\n";
shellScript = "if which swiftlint >/dev/null; then\n swiftlint --lenient\nelse\n echo \"warning: SwiftLint is not installed\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
@@ -860,6 +844,11 @@
target = BEB31F221A0D6F7A00F525B9 /* SwiftGit2-OSX */;
targetProxy = BEB31F301A0D6F7A00F525B9 /* PBXContainerItemProxy */;
};
BEB31F951A0E56E200F525B9 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = BEB31F8E1A0E563900F525B9 /* libgit2-OSX */;
targetProxy = BEB31F941A0E56E200F525B9 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
@@ -867,7 +856,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BEB31F501A0D75EE00F525B9 /* iOS-Framework.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/External/libgit2-ios";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/External/libgit2/include",
"$(inherited)",
@@ -880,6 +868,9 @@
"$(inherited)",
);
OTHER_LDFLAGS = (
"-force_load",
"External/libgit2-ios/libgit2-ios.a",
"-lgit2-ios",
"-lssl",
"-lcrypto",
"-lssh2-ios",
@@ -894,7 +885,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BEB31F501A0D75EE00F525B9 /* iOS-Framework.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/External/libgit2-ios";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/External/libgit2/include",
"$(inherited)",
@@ -907,6 +897,9 @@
"$(inherited)",
);
OTHER_LDFLAGS = (
"-force_load",
"External/libgit2-ios/libgit2-ios.a",
"-lgit2-ios",
"-lssl",
"-lcrypto",
"-lssh2-ios",
@@ -996,7 +989,7 @@
INSTALL_GROUP = "";
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SWIFT_VERSION = 5.0;
};
@@ -1012,7 +1005,7 @@
INSTALL_GROUP = "";
INSTALL_MODE_FLAG = "";
INSTALL_OWNER = "";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.13;
SWIFT_VERSION = 5.0;
};
@@ -1031,10 +1024,11 @@
"External/libgit2-mac",
External/,
"$(inherited)",
"$(PROJECT_DIR)/External/libgit2-mac",
);
OTHER_LDFLAGS = (
/opt/homebrew/lib/libssh2.a,
"-force_load",
"External/libgit2-mac/libgit2-mac.a",
External/libssh2.a,
"-lgit2-mac",
"-lcrypto",
"-lssl",
@@ -1060,10 +1054,11 @@
"External/libgit2-mac",
External/,
"$(inherited)",
"$(PROJECT_DIR)/External/libgit2-mac",
);
OTHER_LDFLAGS = (
/opt/homebrew/lib/libssh2.a,
"-force_load",
"External/libgit2-mac/libgit2-mac.a",
External/libssh2.a,
"-lgit2-mac",
"-lcrypto",
"-lssl",
@@ -1081,6 +1076,7 @@
baseConfigurationReference = BEB31F531A0D75EE00F525B9 /* macOS-Application.xcconfig */;
buildSettings = {
INFOPLIST_FILE = SwiftGit2Tests/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
@@ -1091,11 +1087,30 @@
baseConfigurationReference = BEB31F531A0D75EE00F525B9 /* macOS-Application.xcconfig */;
buildSettings = {
INFOPLIST_FILE = SwiftGit2Tests/Info.plist;
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = "org.libgit2.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
BEB31F911A0E563900F525B9 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BEB31F571A0D75EE00F525B9 /* macOS-StaticLibrary.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
PRODUCT_NAME = git2;
};
name = Debug;
};
BEB31F921A0E563900F525B9 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BEB31F571A0D75EE00F525B9 /* macOS-StaticLibrary.xcconfig */;
buildSettings = {
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
PRODUCT_NAME = git2;
};
name = Release;
};
C9CE0DD41E0710BD0053205D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -1185,6 +1200,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BEB31F901A0E563900F525B9 /* Build configuration list for PBXNativeTarget "libgit2-OSX" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BEB31F911A0E563900F525B9 /* Debug */,
BEB31F921A0E563900F525B9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C9CE0DD31E0710BD0053205D /* Build configuration list for PBXAggregateTarget "SwiftLint" */ = {
isa = XCConfigurationList;
buildConfigurations = (
+9 -1
View File
@@ -571,7 +571,15 @@ public final class Repository {
/// :param: branch The branch to get all commits from
/// :returns: Returns a result with array of branches or the error that occurred
public func commits(in branch: Branch) -> CommitIterator {
let iterator = CommitIterator(repo: self, root: branch.oid.oid)
return commits(from: branch.oid)
}
/// Load all commits from the given base in topological & time order descending
///
/// :param: base The oid to get all commits from
/// :returns: Returns a result with array of branches or the error that occurred
public func commits(from base: OID) -> CommitIterator {
let iterator = CommitIterator(repo: self, root: base.oid)
return iterator
}
+1 -1
View File
@@ -9,7 +9,7 @@
import Quick
class FixturesSpec: QuickSpec {
override class func spec() {
override func spec() {
beforeSuite {
Fixtures.sharedInstance.setUp()
}
+1 -1
View File
@@ -11,7 +11,7 @@ import Nimble
import Quick
class OIDSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("OID(string:)") {
it("should be nil if string is too short") {
expect(OID(string: "123456789012345678901234567890123456789")).to(beNil())
+6 -6
View File
@@ -26,7 +26,7 @@ private extension Repository {
}
class SignatureSpec: FixturesSpec {
override class func spec() {
override func spec() {
describe("Signature(signature)") {
it("should initialize its properties") {
let repo = Fixtures.simpleRepository
@@ -88,7 +88,7 @@ class SignatureSpec: FixturesSpec {
}
class CommitSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Commit(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.simpleRepository
@@ -169,7 +169,7 @@ class CommitSpec: QuickSpec {
}
class TreeEntrySpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Tree.Entry(attributes:object:name:)") {
it("should set its properties") {
let attributes = Int32(GIT_FILEMODE_BLOB.rawValue)
@@ -230,7 +230,7 @@ class TreeEntrySpec: QuickSpec {
}
class TreeSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Tree(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.simpleRepository
@@ -281,7 +281,7 @@ class TreeSpec: QuickSpec {
}
class BlobSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Blob(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.simpleRepository
@@ -330,7 +330,7 @@ class BlobSpec: QuickSpec {
}
class TagSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Tag(pointer)") {
it("should set its properties") {
let repo = Fixtures.simpleRepository
+3 -3
View File
@@ -25,7 +25,7 @@ private extension Repository {
}
class ReferenceSpec: FixturesSpec {
override class func spec() {
override func spec() {
describe("Reference(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.simpleRepository
@@ -64,7 +64,7 @@ class ReferenceSpec: FixturesSpec {
}
class BranchSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("Branch(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.mantleRepository
@@ -119,7 +119,7 @@ class BranchSpec: QuickSpec {
}
class TagReferenceSpec: QuickSpec {
override class func spec() {
override func spec() {
describe("TagReference(pointer)") {
it("should work with an annotated tag") {
let repo = Fixtures.simpleRepository
+1 -1
View File
@@ -25,7 +25,7 @@ private extension Repository {
}
class RemoteSpec: FixturesSpec {
override class func spec() {
override func spec() {
describe("Remote(pointer)") {
it("should initialize its properties") {
let repo = Fixtures.mantleRepository
+2 -2
View File
@@ -13,7 +13,7 @@ import Quick
// swiftlint:disable cyclomatic_complexity
class RepositorySpec: FixturesSpec {
override class func spec() {
override func spec() {
describe("Repository.Type.at(_:)") {
it("should work if the repo exists") {
let repo = Fixtures.simpleRepository
@@ -980,7 +980,7 @@ class RepositorySpec: FixturesSpec {
}
}
static func temporaryURL(forPurpose purpose: String) -> URL {
func temporaryURL(forPurpose purpose: String) -> URL {
let globallyUniqueString = ProcessInfo.processInfo.globallyUniqueString
let path = "\(NSTemporaryDirectory())\(globallyUniqueString)_\(purpose)"
return URL(fileURLWithPath: path)
+52 -24
View File
@@ -46,6 +46,7 @@ main ()
check_deps ()
{
echo "** check_deps **"
# Check if Homebrew is installed
which -s brew
local result=$?
@@ -56,13 +57,21 @@ check_deps ()
echo "Homebrew is not installed (http://brew.sh). You will need to manually ensure the following tools are installed:"
echo " $REQUIRED_TOOLS"
echo
echo "Additionally, the following libssh2 files must be symlinked under /usr/local:"
echo "Additionally, the following libssh2 files must be symlinked under /usr/local or /opt/homebrew :"
echo " lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h"
exit $result
if [ ! -z "$CI" ]
then
echo
echo "I will try to install brew now on the github runner"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
# Ensure that we have libgit2's dependencies installed.
installed=`brew list`
installed=$(brew list)
for tool in $REQUIRED_TOOLS
do
@@ -71,6 +80,7 @@ check_deps ()
if [ "$code" -eq "0" ]
then
echo "*** $tool is available 👍"
continue
elif [ "$code" -ne "1" ]
then
@@ -81,27 +91,45 @@ check_deps ()
brew install "$tool"
done
brew_prefix=`brew --prefix`
expected_prefix=/opt/homebrew
if [ "$brew_prefix" != "$expected_prefix" ]
then
echo "*** Adding soft links into $expected_prefix..."
products=(lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h)
for product in "${products[@]}"
do
destination="$expected_prefix/$product"
if [ -e "$destination" ]
then
continue
fi
sudo mkdir -p "$(dirname "$destination")"
sudo ln -s "$brew_prefix/$product" "$destination"
done
brew_prefix=$(brew --prefix)
if [[ $(uname -m) == 'arm64' ]]; then
echo "** Running on a Apple Silicon M1"
expected_prefix=/opt/homebrew
else
echo "** Running on a Apple x86"
expected_prefix=/usr/local
fi
install_path="./External"
pwd
set -x
cp "$brew_prefix"/lib/libcrypto.a $install_path
cp "$brew_prefix"/lib/libssl.a $install_path
cp "$brew_prefix"/lib/libssh2.a $install_path
set +x
if [ "$brew_prefix" != "$expected_prefix" ]
then
echo "*** Adding soft links into $expected_prefix..."
products=(lib/libssh2.a include/libssh2.h include/libssh2_sftp.h include/libssh2_publickey.h)
for product in "${products[@]}"
do
destination="$expected_prefix/$product"
if [ -e "$destination" ]
then
continue
fi
sudo mkdir -p "$(dirname "$destination")"
sudo ln -s "$brew_prefix/$product" "$destination"
done
fi
# openssl@1 is expected
#sslSource=$(find $brew_prefix -name libcrypto.a | grep openssl | sort | head -1 | xargs dirname)
#echo "Find libcrypto.a and take first $sslSource and copy to install_path=$install_path"
#cp $sslSource/* "$install_path" 2>/dev/null | echo "Copy and ignore subdirectory. This makes build work on x86 and arm64"
}
bootstrap_submodule ()
@@ -110,7 +138,7 @@ bootstrap_submodule ()
if [ -e "$bootstrap" ]
then
echo "*** Bootstrapping $name..."
echo "*** Bootstrapping ..."
"$bootstrap" >/dev/null
else
update_submodules
+2 -2
View File
@@ -57,7 +57,7 @@ if [ "$SCHEME" == "SwiftGit2-OSX" ]; then
xcodebuild -workspace "$XCWORKSPACE" \
-scheme "$SCHEME" \
${XCODE_OPTIONS[*]} \
"${XCODE_OPTIONS[*]}" \
build test \
2>&1 | xcpretty $XCPRETTY_FORMAT_OPTIONS
elif [ "$SCHEME" == "SwiftGit2-iOS" ]; then
@@ -80,7 +80,7 @@ elif [ "$SCHEME" == "SwiftGit2-iOS" ]; then
-scheme "$SCHEME" \
-destination "id=$DESTINATION_ID" \
-sdk iphonesimulator \
${XCODE_OPTIONS[*]} \
"${XCODE_OPTIONS[*]}" \
build test \
2>&1 | xcpretty $XCPRETTY_FORMAT_OPTIONS
fi
+17 -26
View File
@@ -1,13 +1,15 @@
#!/bin/bash
# augment path to help it find cmake via homebrew
PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
SCRIPT_DIR=$(dirname "$0")
source "${SCRIPT_DIR}/xcode_functions.sh"
function setup_build_environment ()
{
# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="/usr/local/bin:/opt/boxen/homebrew/bin:$PATH"
pushd "$SCRIPT_DIR/.." > /dev/null
ROOT_PATH="$PWD"
popd > /dev/null
@@ -28,7 +30,7 @@ function setup_build_environment ()
# directly (ie not from an Xcode proj)
if [ -z "${IPHONEOS_DEPLOYMENT_TARGET}" ]
then
IPHONEOS_DEPLOYMENT_TARGET="12.0"
IPHONEOS_DEPLOYMENT_TARGET="6.0"
fi
# Determine if we can be building 64-bit binaries
@@ -37,14 +39,12 @@ function setup_build_environment ()
CAN_BUILD_64BIT="1"
fi
ARCHS=""
ARCHS="i386 armv7 armv7s"
if [ "${CAN_BUILD_64BIT}" -eq "1" ]
then
# For some stupid reason cmake needs simulator
# builds to be first
ARCHS="x86_64 ${ARCHS} arm64"
else
ARCHS="i386 ${ARCHS} armv7 armv7s"
fi
}
@@ -63,15 +63,11 @@ function build_all_archs ()
for ARCH in ${ARCHS}
do
PLATFORMS=""
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] || [ "${ARCH}" == "arm64" ]
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ]
then
PLATFORMS="${PLATFORMS} iphonesimulator"
fi
if [ "${ARCH}" == "arm64" ]
then
PLATFORMS="${PLATFORMS} iphoneos"
PLATFORM="iphonesimulator"
else
PLATFORM="iphoneos"
fi
SDKVERSION=$(ios_sdk_version)
@@ -83,19 +79,14 @@ function build_all_archs ()
HOST="${ARCH}-apple-darwin"
fi
echo "Building ${ARCH} for ${PLATFORMS}"
SDKNAME="${PLATFORM}${SDKVERSION}"
SDKROOT="$(sdk_path ${SDKNAME})"
for PLATFORM in ${PLATFORMS}
do
SDKNAME="${PLATFORM}${SDKVERSION}"
SDKROOT="$(sdk_path ${SDKNAME})"
echo "Building ${LIBRARY_NAME} for ${SDKNAME} ${ARCH}"
echo "Please stand by..."
echo "Building ${LIBRARY_NAME} for ${SDKNAME} ${ARCH} on ${PLATFORM}"
echo "Please stand by..."
# run the per arch build command
eval $build_arch
done
# run the per arch build command
eval $build_arch
done
# finish the build (usually lipo)
+60 -31
View File
@@ -1,9 +1,17 @@
#!/bin/bash
#!/bin/sh
set -e
# augment path to help it find cmake via homebrew
PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
if [[ `uname -m` == 'arm64' ]]; then
echo "** Running on a Apple Silicon M1"
PATH="/opt/homebrew/bin:$PATH"
else
echo "** Running on a Apple x86"
PATH="/usr/local/bin:$PATH"
fi
SCRIPT_DIR=$(dirname "$0")
source "${SCRIPT_DIR}/xcode_functions.sh"
@@ -18,18 +26,60 @@ function setup_build_environment ()
CC="${CLANG}"
CPP="${CLANG} -E"
MACOSX_DEPLOYMENT_TARGET="10.13"
# We need to clear this so that cmake doesn't have a conniption
MACOSX_DEPLOYMENT_TARGET=""
XCODE_MAJOR_VERSION=$(xcode_major_version)
XCODE_MINOR_VERSION=$(xcode_minor_version)
if [ "${XCODE_MAJOR_VERSION}" -lt "14" ]
CAN_BUILD_ARM="0"
# Determine if we can be building for ARM Macs
if [ "${XCODE_MAJOR_VERSION}" -ge "13" ]
then
echo "Requires Xcode 14 or newer."
exit 1
CAN_BUILD_ARM="1"
elif [ "${XCODE_MAJOR_VERSION}" -eq "12" ] && [ "${XCODE_MINOR_VERSION}" -ge "2" ]
then
CAN_BUILD_ARM="1"
fi
ARCHS="x86_64 arm64"
ARCHS="x86_64"
if [ "${CAN_BUILD_ARM}" -eq "1" ]
then
ARCHS="${ARCHS} arm64 arm64e"
fi
}
function build_all_archs ()
{
setup_build_environment
local setup=$1
local build_arch=$2
local finish_build=$3
# run the prepare function
eval $setup
echo "Building for ${ARCHS}"
for ARCH in ${ARCHS}
do
PLATFORM="macosx"
SDKVERSION=$(macos_sdk_version)
SDKNAME="${PLATFORM}${SDKVERSION}"
SDKROOT="$(sdk_path ${SDKNAME})"
echo "Building ${LIBRARY_NAME} for ${SDKNAME} ${ARCH}"
echo "Please stand by..."
# run the per arch build command
eval $build_arch
done
# finish the build (usually lipo)
eval $finish_build
}
function setup ()
@@ -62,14 +112,13 @@ function build_libgit2 ()
LOG="${INSTALL_PREFIX}/build-libgit2.log"
echo "$LOG"
cmake \
MACOSX_DEPLOYMENT_TARGET="10.9" cmake \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_PREFIX_PATH:PATH="${ROOT_PATH}/External/libssh2-mac/bin/${SDKNAME}-${ARCH}.sdk" \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}/" \
-DBUILD_CLAR:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="${MACOSX_DEPLOYMENT_TARGET}" \
.. >> "${LOG}" 2>&1
cmake --build . --target install >> "${LOG}" 2>&1
@@ -89,26 +138,6 @@ function fat_binary ()
popd > /dev/null
}
setup_build_environment
setup
echo "Building for ${ARCHS}"
for ARCH in ${ARCHS}
do
PLATFORM="macosx"
SDKVERSION=$(macos_sdk_version)
SDKNAME="${PLATFORM}${SDKVERSION}"
SDKROOT="$(sdk_path ${SDKNAME})"
echo "Building ${LIBRARY_NAME} for ${SDKNAME} ${ARCH}"
echo "Please stand by..."
# run the per arch build command
build_libgit2
done
fat_binary
build_all_archs setup build_libgit2 fat_binary
echo "libgit2 has been updated."
+4 -66
View File
@@ -8,7 +8,7 @@ source "${SCRIPT_DIR}/ios_build_functions.sh"
function setup ()
{
if [ "${ROOT_PATH}/External/libgit2-ios/libgit2.xcframework" -nt "${ROOT_PATH}/External/libgit2" ]
if [ "${ROOT_PATH}/External/libgit2-ios/libgit2-ios.a" -nt "${ROOT_PATH}/External/libgit2" ]
then
echo "No update needed."
exit 0
@@ -49,14 +49,11 @@ function build_libgit2 ()
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}/" \
-DBUILD_CLAR:BOOL=OFF \
-DBUILD_TESTS:BOOL=OFF \
-DREGEX_BACKEND:STRING="builtin" \
-DTHREADSAFE:BOOL=ON \
-DCURL:BOOL=OFF \
-DCMAKE_C_FLAGS:STRING="-fembed-bitcode" \
"${SYS_ROOT}" \
-DCMAKE_OSX_ARCHITECTURES:STRING="${ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="${IPHONEOS_DEPLOYMENT_TARGET}" \
.. >> "${LOG}" 2>&1
cmake --build . --target install >> "${LOG}" 2>&1
@@ -67,72 +64,13 @@ function build_libgit2 ()
function fat_binary ()
{
echo "Building fat binary for simulator..."
echo "Building fat binary..."
# Collect all simulator build paths
for path in "${BUILT_LIB_PATHS[@]}"
do
case "$path" in
*libgit2-ios/iphonesimulator* )
SIMULATOR_LIB_PATHS+=("$path")
# Remember one header location (headers are the same, so overwriting doesn't matter)
base_dir=$(dirname $(dirname "${path}"))
HEADER_PATH="${base_dir}/include/git2.h"
;;
* )
# Ignore libs build for the actual phone
;;
esac
done
SIMULATOR_LIB_DIR="${ROOT_PATH}/External/libgit2-ios/iphonesimulator"
mkdir -p "${SIMULATOR_LIB_DIR}"
echo "... from ${SIMULATOR_LIB_PATHS[@]}"
lipo -create "${SIMULATOR_LIB_PATHS[@]}" -output "${SIMULATOR_LIB_DIR}/libgit2.a"
echo "Copying shared simulator header from ${HEADER_PATH}"
cp "${HEADER_PATH}" "${SIMULATOR_LIB_DIR}/libgit2.h"
lipo -create "${BUILT_LIB_PATHS[@]}" -output "${ROOT_PATH}/External/libgit2-ios/libgit2-ios.a"
echo "Building done."
}
function xcframework ()
{
echo "Building XCFramework..."
for path in "${BUILT_LIB_PATHS[@]}"
do
case "$path" in
*libgit2-ios/iphonesimulator* )
# Skip simulator library binaries
;;
* )
args+=("-library" "${path}")
base_dir=$(dirname $(dirname "${path}"))
args+=("-headers" "${base_dir}/include/git2.h")
;;
esac
done
args+=("-library" "${SIMULATOR_LIB_DIR}/libgit2.a")
args+=("-headers" "${SIMULATOR_LIB_DIR}/libgit2.h")
echo "... from ${args[@]}"
xcodebuild -create-xcframework \
"${args[@]}" \
-output "${ROOT_PATH}/External/libgit2-ios/libgit2.xcframework"
echo "Building done."
}
function combine_all_the_binaries ()
{
fat_binary
xcframework
popd > /dev/null
}
build_all_archs setup build_libgit2 combine_all_the_binaries
build_all_archs setup build_libgit2 fat_binary
+2 -2
View File
@@ -16,7 +16,7 @@ function setup ()
LIBRARY_NAME="libssh2"
}
function build_ssh2 ()
function build_ssh2 ()
{
mkdir -p "${ROOT_PATH}/External/libssh2-ios/lib" "${ROOT_PATH}/External/libssh2-ios/lib" "${ROOT_PATH}/External/libssh2-ios/src"
@@ -47,7 +47,7 @@ function fat_binary ()
lipo -create "${BUILT_LIBS[@]}" -output "${ROOT_PATH}/External/libssh2-ios/lib/libssh2-ios.a"
mkdir -p "${ROOT_PATH}/External/libssh2-ios/include/libssh2"
cp -R "${ROOT_PATH}/External/libssh2-ios/bin/iphonesimulator${SDKVERSION}-x86_64.sdk/include/libssh2.h" "${ROOT_PATH}/External/libssh2-ios/include/libssh2/"
cp -R "${ROOT_PATH}/External/libssh2-ios/bin/iphonesimulator${SDKVERSION}-i386.sdk/include/libssh2.h" "${ROOT_PATH}/External/libssh2-ios/include/libssh2/"
echo "Building done."
}