Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xcodegen: init at 2.42.0 #367199

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions pkgs/by-name/xc/xcodegen/0001-spectre-xct-record.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/Sources/Spectre/XCTest.swift b/Sources/Spectre/XCTest.swift
index 3704436..e759f14 100644
--- a/Sources/Spectre/XCTest.swift
+++ b/Sources/Spectre/XCTest.swift
@@ -31,28 +31,6 @@ class XcodeReporter: ContextReporter {
func addDisabled(_ name: String) {}

func addFailure(_ name: String, failure: FailureType) {
- // Xcode 12 removed `recordFailure` and replaced with `record(_:)`
- #if swift(>=4.2)
- // The `compiler` statement was added in swift 4.2, so it needs to be in a separate statement to retain
- // compatibility with 4.x.
- #if compiler(>=5.3) && os(macOS)
- let location = XCTSourceCodeLocation(filePath: failure.file, lineNumber: failure.line)
- #if Xcode
- // As of Xcode 12.0.1, XCTIssue is unavailable even though it is documented:
- // https://developer.apple.com/documentation/xctest/xctissue
- // When building with `swift build`, it is available. Perhaps the xctest overlay behaves differently between the two.
- let issue = XCTIssueReference(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
- #else
- let issue = XCTIssue(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
- #endif
- #if compiler(>=5.4)
- testCase.record(issue as XCTIssue)
- #else
- testCase.record(issue)
- #endif
- #else
testCase.recordFailure(withDescription: "\(name): \(failure.reason)", inFile: failure.file, atLine: failure.line, expected: false)
- #endif
- #endif
}
}
\ No newline at end of file
16 changes: 16 additions & 0 deletions pkgs/by-name/xc/xcodegen/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file was generated by swiftpm2nix.
{
workspaceStateFile = ./workspace-state.json;
hashes = {
"AEXML" = "sha256-bQcXq1aS76sOjW8yYCOlGVZ2tStDvzRQSyj9VrAj6nI=";
"ArtifactBundleGen" = "sha256-mSXJiRGFIm2RtzBG8l6s4RJ2BzSbPZKUZIqWM4vDIhc=";
"JSONUtilities" = "sha256-jl8XfgoB5IX0qwwDtzcWgK0u3SNG2HfrPoEb2a6/mlA=";
"PathKit" = "sha256-ewxTC1kpu6PXhwamCxYfI50ooYO1SIU0+IXH2tc/uv4=";
"Rainbow" = "sha256-zmd/wGFX0AYRvwecqQerlxDETMuBqQM+Whuf3JezAGM=";
"Spectre" = "sha256-fipGRIgw+jV7Wrxa+xivRk7YMyxDhGFB6SHIHscrmV8=";
"SwiftCLI" = "sha256-PmjzLss0D12iy6YKsudFa8i63NQAssyCBqqq8VjRiH4=";
"Version" = "sha256-4IwQlexWtIH9M0sSai1a+ITTAKkD2zJtbYoV4Cg+Snw=";
"XcodeProj" = "sha256-ycHDzay37YtT/3QqUpG6XPjRh32P5iU/I5GpfjrXs/I=";
"Yams" = "sha256-5qxuCkmopm3uFcoYJKQA8ofW98f53H1gZaPiOh2DS4U=";
};
}
178 changes: 178 additions & 0 deletions pkgs/by-name/xc/xcodegen/nix/workspace-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"object": {
"artifacts": [],
"dependencies": [
{
"basedOn": null,
"packageRef": {
"identity": "aexml",
"kind": "remoteSourceControl",
"location": "https://github.com/tadija/AEXML.git",
"name": "AEXML"
},
"state": {
"checkoutState": {
"revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3",
"version": "4.6.1"
},
"name": "sourceControlCheckout"
},
"subpath": "AEXML"
},
{
"basedOn": null,
"packageRef": {
"identity": "artifactbundlegen",
"kind": "remoteSourceControl",
"location": "https://github.com/freddi-kit/ArtifactBundleGen",
"name": "ArtifactBundleGen"
},
"state": {
"checkoutState": {
"revision": "707e4ccc4b1c7e48e881cd5ea91e493a95df24bf",
"version": "0.0.6"
},
"name": "sourceControlCheckout"
},
"subpath": "ArtifactBundleGen"
},
{
"basedOn": null,
"packageRef": {
"identity": "jsonutilities",
"kind": "remoteSourceControl",
"location": "https://github.com/yonaskolb/JSONUtilities.git",
"name": "JSONUtilities"
},
"state": {
"checkoutState": {
"revision": "128d2ffc22467f69569ef8ff971683e2393191a0",
"version": "4.2.0"
},
"name": "sourceControlCheckout"
},
"subpath": "JSONUtilities"
},
{
"basedOn": null,
"packageRef": {
"identity": "pathkit",
"kind": "remoteSourceControl",
"location": "https://github.com/kylef/PathKit.git",
"name": "PathKit"
},
"state": {
"checkoutState": {
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version": "1.0.1"
},
"name": "sourceControlCheckout"
},
"subpath": "PathKit"
},
{
"basedOn": null,
"packageRef": {
"identity": "rainbow",
"kind": "remoteSourceControl",
"location": "https://github.com/onevcat/Rainbow.git",
"name": "Rainbow"
},
"state": {
"checkoutState": {
"revision": "e0dada9cd44e3fa7ec3b867e49a8ddbf543e3df3",
"version": "4.0.1"
},
"name": "sourceControlCheckout"
},
"subpath": "Rainbow"
},
{
"basedOn": null,
"packageRef": {
"identity": "spectre",
"kind": "remoteSourceControl",
"location": "https://github.com/kylef/Spectre.git",
"name": "Spectre"
},
"state": {
"checkoutState": {
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version": "0.10.1"
},
"name": "sourceControlCheckout"
},
"subpath": "Spectre"
},
{
"basedOn": null,
"packageRef": {
"identity": "swiftcli",
"kind": "remoteSourceControl",
"location": "https://github.com/jakeheis/SwiftCLI.git",
"name": "SwiftCLI"
},
"state": {
"checkoutState": {
"revision": "2e949055d9797c1a6bddcda0e58dada16cc8e970",
"version": "6.0.3"
},
"name": "sourceControlCheckout"
},
"subpath": "SwiftCLI"
},
{
"basedOn": null,
"packageRef": {
"identity": "version",
"kind": "remoteSourceControl",
"location": "https://github.com/mxcl/Version",
"name": "Version"
},
"state": {
"checkoutState": {
"revision": "a94b48f36763c05629fc102837398505032dead9",
"version": "2.0.0"
},
"name": "sourceControlCheckout"
},
"subpath": "Version"
},
{
"basedOn": null,
"packageRef": {
"identity": "xcodeproj",
"kind": "remoteSourceControl",
"location": "https://github.com/tuist/XcodeProj.git",
"name": "XcodeProj"
},
"state": {
"checkoutState": {
"revision": "447c159b0c5fb047a024fd8d942d4a76cf47dde0",
"version": "8.16.0"
},
"name": "sourceControlCheckout"
},
"subpath": "XcodeProj"
},
{
"basedOn": null,
"packageRef": {
"identity": "yams",
"kind": "remoteSourceControl",
"location": "https://github.com/jpsim/Yams.git",
"name": "Yams"
},
"state": {
"checkoutState": {
"revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6",
"version": "5.0.1"
},
"name": "sourceControlCheckout"
},
"subpath": "Yams"
}
]
},
"version": 6
}
76 changes: 76 additions & 0 deletions pkgs/by-name/xc/xcodegen/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
lib,
swiftPackages,
swift,
swiftpm,
swiftpm2nix,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
...
}:

let
# Pass the generated files to the helper.
generated = swiftpm2nix.helpers ./nix;
in

swiftPackages.stdenv.mkDerivation (finalAttrs: {
pname = "xcodegen";
version = "2.42.0";

src = fetchFromGitHub {
owner = "yonaskolb";
repo = "XcodeGen";
tag = finalAttrs.version;
hash = "sha256-wcjmADG+XnS2kR8BHe6ijApomucS9Tx7ZRjWZmTCUiI=";
};

# Including SwiftPM as a nativeBuildInput provides a buildPhase for you.
# This by default performs a release build using SwiftPM, essentially:
# swift build -c release
nativeBuildInputs = [
swift
swiftpm
];

buildInputs = [
swiftPackages.XCTest
];

# The helper provides a configure snippet that will prepare all dependencies
# in the correct place, where SwiftPM expects them.
configurePhase =
generated.configure
+ ''
# Replace the dependency symlink with a writable copy
swiftpmMakeMutable Spectre
# Now apply a patch
patch -p1 -d .build/checkouts/Spectre -i ${./0001-spectre-xct-record.patch}
'';

installPhase = ''
mkdir -p $out/bin
cp "$(swiftpmBinPath)/${finalAttrs.pname}" $out/bin/
'';

nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;

passthru = {
updateScript = nix-update-script { };
};

meta = {
description = "Swift command line tool for generating your Xcode project";
homepage = "https://github.com/yonaskolb/XcodeGen";
changelog = "https://github.com/XcodeGen/blob/${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.mit;
platforms = lib.platforms.darwin;
maintainers = [ lib.maintainers.samasaur ];
mainProgram = "xcodegen";
};
})
Loading