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

chore: added Xcodegen and GitHub Action workflow for Carthage integration #379

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
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
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,51 @@ jobs:
.build/debug/TPPDFPackageTests.xctest/Contents/MacOS/TPPDFPackageTests \
--instr-profile .build/debug/codecov/default.profdata \
--format="lcov" > coverage.lcov

carthage-integration:
name: Test Carthage Integration
runs-on: macos-14
timeout-minutes: 30
defaults:
run:
working-directory: Example iOS-Carthage
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Patch Cartfile to pull request branch
if: github.event_name == 'pull_request'
run: |
ESCAPED_REF_NAME=$(echo "${{ github.head_ref }}" | sed 's/[\/&]/\\&/g')
sed -i.bak "s/main/$ESCAPED_REF_NAME/g" Cartfile

- name: Carthage Update
env:
GITHUB_ACCESS_TOKEN: ${{ github.token }}
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
carthage update \
--no-use-binaries \
--use-xcframeworks \
--verbose | xcbeautify \
--preserve-unbeautified

- name: Carthage Build
env:
GITHUB_ACCESS_TOKEN: ${{ github.token }}
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
carthage build \
--verbose | xcbeautify \
--preserve-unbeautified

- name: Build for iOS
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild \
-project Example_iOS-Carthage.xcodeproj \
CODE_SIGNING_ALLOWED="NO" \
build 2>&1 | xcbeautify
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
D49855562461FB9A00D54270 /* Examples.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49855552461FB9A00D54270 /* Examples.swift */; };
D49B06002658E7FD0084A0B7 /* DocumentSettingsExampleFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49B05FF2658E7FD0084A0B7 /* DocumentSettingsExampleFactory.swift */; };
D4D28D2323AA1A6D00028D5A /* ExamplesListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D28D2223AA1A6D00028D5A /* ExamplesListViewController.swift */; };
D4FF9A28249A488A006FF2ED /* TPPDF.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4FF9A27249A488A006FF2ED /* TPPDF.framework */; };
D4E49EE92BF110EF00BC7B0A /* TPPDF.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D4FF9A27249A488A006FF2ED /* TPPDF.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand Down Expand Up @@ -91,7 +91,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D4FF9A28249A488A006FF2ED /* TPPDF.framework in Frameworks */,
D4E49EE92BF110EF00BC7B0A /* TPPDF.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -343,7 +343,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/local/bin/carthage copy-frameworks\n";
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\ncarthage copy-frameworks\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
6 changes: 6 additions & 0 deletions Source/API/Document/PDFDocumentBackground.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#if canImport(UIKit)
import UIKit
#elseif canImport(AppKit)
import AppKit
#endif

/// Document background configuration
public struct PDFDocumentBackground {
/**
Expand Down
6 changes: 1 addition & 5 deletions Source/API/Graphics/PDFBezierPath+Copying.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Created by Philip Niedertscheider on 03.06.19.
//

#if os(iOS)
import UIKit
#elseif os(macOS)
import AppKit
#endif
import Foundation

// MARK: - PDFBezierPath + NSCopying

Expand Down
25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/CwlCatchExceptionSupport_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/CwlCatchException_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/CwlMachBadInstructionHandler_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/CwlPosixPreconditionTesting_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/CwlPreconditionTesting_Info.plist

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/NimbleCwlCatchExceptionSupport_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/NimbleCwlCatchException_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/NimbleCwlMachBadInstructionHandler_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/NimbleCwlPreconditionTesting_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions TPPDF.xcodeproj/Nimble_Info.plist

This file was deleted.

Loading
Loading