forked from pondok-programmer/SwiftGit2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for SwiftPM using SPMCLI
SPMCLI is an option since to compile SwiftGit2 we need to perform amounts of linking and passing flags during compilation which in turns very cumbersome. The other way is to use helper like Make or other automation. SPMCLI is choosen because it supports resolving configuration in dependencies. For now, ZipArchive. The user doesn't need to manually state each updated link and flags because SPMCLI will handle it.
- Loading branch information
Showing
9 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
SPMGenerated.xcodeproj | ||
.vscode/ | ||
.build/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Avoid warning in SwiftPM invocation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
OTHER_LDFLAGS = $(inherited) ./External/libgit2.a ./External/libssl.a ./External/libcrypto.a /usr/lib/libcurl.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libz.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libiconv.tbd | ||
OTHER_CFLAGS = $(inherited) -DHAVE_INTTYPES_H -DHAVE_PKCRYPT -DHAVE_STDINT_H -DHAVE_WZAES -DHAVE_ZLIB -DMZ_ZIP_NO_SIGNING -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fapplication-extension -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code-aggressive -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -fstrict-aliasing -Wdeprecated-declarations -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "Nimble", | ||
"repositoryURL": "https://github.com/Quick/Nimble", | ||
"state": { | ||
"branch": null, | ||
"revision": "e9d769113660769a4d9dd3afb855562c0b7ae7b0", | ||
"version": "7.3.4" | ||
} | ||
}, | ||
{ | ||
"package": "Quick", | ||
"repositoryURL": "https://github.com/Quick/Quick", | ||
"state": { | ||
"branch": null, | ||
"revision": "f2b5a06440ea87eba1a167cab37bf6496646c52e", | ||
"version": "1.3.4" | ||
} | ||
}, | ||
{ | ||
"package": "ZipArchive", | ||
"repositoryURL": "https://github.com/muizidn/ZipArchive", | ||
"state": { | ||
"branch": "master", | ||
"revision": "403986421556d945ce28b64bfc171e4ff9403a37", | ||
"version": null | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// swift-tools-version:5.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SwiftGit2", | ||
platforms: [ | ||
.macOS(.v10_11), | ||
], | ||
products: [ | ||
.executable( | ||
name: "example", | ||
targets: ["example"]), | ||
.library( | ||
name: "SwiftGit2", | ||
targets: ["SwiftGit2"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/Quick/Quick", from: "1.3.2"), | ||
.package(url: "https://github.com/Quick/Nimble", from: "7.3.1"), | ||
.package(url: "https://github.com/muizidn/ZipArchive", .branch("master")), | ||
], | ||
targets: [ | ||
.target( | ||
name: "example", | ||
dependencies: ["SwiftGit2"], | ||
path: "example"), | ||
.target( | ||
name: "SwiftGit2", | ||
dependencies: ["Clibgit2"], | ||
path: "SwiftGit2", | ||
sources: ["Swift"]), | ||
.target( | ||
name: "Clibgit2", | ||
path: "Clibgit2"), | ||
.testTarget( | ||
name: "SwiftGit2Tests", | ||
dependencies: ["SwiftGit2", "Quick", "Nimble", "ZipArchive"], | ||
path: "SwiftGit2Tests"), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
mac: | ||
build: | ||
-Xcc: | ||
- -DHAVE_INTTYPES_H | ||
- -DHAVE_PKCRYPT | ||
- -DHAVE_STDINT_H | ||
- -DHAVE_WZAES | ||
- -DHAVE_ZLIB | ||
- -DMZ_ZIP_NO_SIGNING | ||
- -Wnon-modular-include-in-framework-module | ||
- -Werror=non-modular-include-in-framework-module | ||
- -fapplication-extension | ||
- -Wno-trigraphs | ||
- -fpascal-strings | ||
- -O0 | ||
- -fno-common | ||
- -Wno-missing-field-initializers | ||
- -Wno-missing-prototypes | ||
- -Werror=return-type | ||
- -Wunreachable-code-aggressive | ||
- -Werror=deprecated-objc-isa-usage | ||
- -Werror=objc-root-class | ||
- -Wno-missing-braces | ||
- -Wparentheses | ||
- -Wswitch | ||
- -Wunused-function | ||
- -Wno-unused-label | ||
- -Wno-unused-parameter | ||
- -Wunused-variable | ||
- -Wunused-value | ||
- -Wempty-body | ||
- -Wuninitialized | ||
- -Wconditional-uninitialized | ||
- -Wno-unknown-pragmas | ||
- -Wno-shadow | ||
- -Wno-four-char-constants | ||
- -Wno-conversion | ||
- -Wconstant-conversion | ||
- -Wint-conversion | ||
- -Wbool-conversion | ||
- -Wenum-conversion | ||
- -Wno-float-conversion | ||
- -Wnon-literal-null-conversion | ||
- -Wobjc-literal-conversion | ||
- -Wshorten-64-to-32 | ||
- -Wpointer-sign | ||
- -Wno-newline-eof | ||
- -fstrict-aliasing | ||
- -Wdeprecated-declarations | ||
- -g | ||
- -Wno-sign-conversion | ||
- -Winfinite-recursion | ||
- -Wcomma | ||
- -Wblock-capture-autoreleasing | ||
- -Wstrict-prototypes | ||
- -Wno-semicolon-before-method-body | ||
-Xlinker: | ||
- ./External/libgit2.a | ||
- ./External/libssl.a | ||
- ./External/libcrypto.a | ||
- /usr/lib/libcurl.dylib | ||
- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libz.tbd | ||
- /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libiconv.tbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
mac: | ||
build: | ||
-Xlinker: | ||
- ${PWD}/External/libgit2.a | ||
- ${PWD}/External/libssl.a | ||
- ${PWD}/External/libcrypto.a | ||
- /usr/lib/libcurl.dylib | ||
|
||
xcconfig: | ||
name: MacOS.xcconfig | ||
keys: | ||
OTHER_LDFLAGS: -Xlinker | ||
OTHER_CFLAGS: -Xcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import SwiftGit2 |