Skip to content

Commit

Permalink
fix: swift package complains of having a dependency on a branch
Browse files Browse the repository at this point in the history
Signed-off-by: goncalo-frade-iohk <[email protected]>
  • Loading branch information
goncalo-frade-iohk committed Nov 27, 2024
1 parent e8bf5e9 commit a7efde5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 37 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ jobs:
- name: Adding Known Hosts
run: ssh-keyscan -H github.com >> ~/.ssh/known_hosts

- name: Install lcov
run: brew install lcov
# - name: Install lcov
# run: brew install lcov@1.15.0 && brew link --overwrite --force [email protected]

- name: Build and test
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build_test.sh

- name: Publish to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: coverallsapp/github-action@v2
with:
file: "lcov.info"
# - name: Publish to coveralls
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# uses: coverallsapp/github-action@v2
# with:
# file: "lcov.info"
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let package = Package(
.package(url: "https://github.com/kylef/JSONSchema.swift.git", exact: "0.6.0"),
.package(url: "https://github.com/eu-digital-identity-wallet/eudi-lib-sdjwt-swift.git", from: "0.1.0"),
.package(url: "https://github.com/1024jp/GzipSwift.git", exact: "6.0.0"),
.package(url: "https://github.com/goncalo-frade-iohk/eudi-lib-ios-openid4vci-swift.git", branch: "feature/add-w3cvc-support")
.package(url: "https://github.com/goncalo-frade-iohk/eudi-lib-ios-openid4vci-swift.git", from: "0.9.0")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
EE0E1FAF29473B10003CD7D5 /* SteradianMedium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = SteradianMedium.otf; sourceTree = "<group>"; };
EE0E1FB029473B10003CD7D5 /* SteradianRegular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = SteradianRegular.otf; sourceTree = "<group>"; };
EE2D40962ACC470100CF9446 /* CredentialDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CredentialDetailViewModel.swift; sourceTree = "<group>"; };
EE38134E2938D55D00A3A710 /* atala-prism-swift-sdk */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "atala-prism-swift-sdk"; path = ../..; sourceTree = "<group>"; };
EE418ADD2BCFD925008766A6 /* PresentationDetailViewState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentationDetailViewState.swift; sourceTree = "<group>"; };
EE418ADE2BCFD925008766A6 /* PresentationDetailViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentationDetailViewModel.swift; sourceTree = "<group>"; };
EE418ADF2BCFD925008766A6 /* PresentationDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresentationDetailView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -317,14 +316,6 @@
path = fonts;
sourceTree = "<group>";
};
EE38134D2938D55D00A3A710 /* Packages */ = {
isa = PBXGroup;
children = (
EE38134E2938D55D00A3A710 /* atala-prism-swift-sdk */,
);
name = Packages;
sourceTree = "<group>";
};
EE418ADB2BCFD925008766A6 /* Verifier */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -663,7 +654,6 @@
EEE61FAD2937CA280053AE52 = {
isa = PBXGroup;
children = (
EE38134D2938D55D00A3A710 /* Packages */,
EEE61FB82937CA280053AE52 /* AtalaPrismWalletDemo */,
EEE61FB72937CA280053AE52 /* Products */,
EEE61FEB2937DCBE0053AE52 /* Frameworks */,
Expand Down Expand Up @@ -882,6 +872,7 @@
);
mainGroup = EEE61FAD2937CA280053AE52;
packageReferences = (
EE86C3C82CF5EC750072BEB7 /* XCRemoteSwiftPackageReference "identus-edge-agent-sdk-swift" */,
);
productRefGroup = EEE61FB72937CA280053AE52 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -1243,6 +1234,17 @@
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
EE86C3C82CF5EC750072BEB7 /* XCRemoteSwiftPackageReference "identus-edge-agent-sdk-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/hyperledger/identus-edge-agent-sdk-swift";
requirement = {
kind = exactVersion;
version = 7.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
EE38134F2938D5B100A3A710 /* Apollo */ = {
isa = XCSwiftPackageProductDependency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public func getDataFromAttachment(attachmentDescriptor: AttachmentDescriptor) th
case let value as AttachmentBase64:
return Data(base64Encoded: value.base64)!
case let value as AttachmentJsonData:
return value.data
return try JSONEncoder().encode(value.json)
default:
throw UnknownError.somethingWentWrongError(customMessage: nil, underlyingErrors: nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ private func getDomainAndChallenge(msg: Message) throws -> (domain: String?, cha
.map({
switch $0.data {
case let json as AttachmentJsonData:
return json.data
return json.json
default:
return nil
}
})
.compactMap({ $0 })
.first
else { throw PolluxError.offerDoesntProvideEnoughInformation }
let jsonObject = try JSONSerialization.jsonObject(with: offerData)
let jsonObject = try JSONSerialization.jsonObject(with: JSONEncoder().encode(offerData))
return (findValue(forKey: "domain", in: jsonObject), findValue(forKey: "challenge", in: jsonObject))
}

Expand Down
30 changes: 15 additions & 15 deletions build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ xcodebuild -scheme "EdgeAgentSDK-Package" \
echo "Execution completed"

# Find profdata
PROF_DATA=$(find "$DERIVED_DATA_DIR" -name Coverage.profdata)
echo "Profdata found: $PROF_DATA"
#PROF_DATA=$(find "$DERIVED_DATA_DIR" -name Coverage.profdata)
#echo "Profdata found: $PROF_DATA"

# Find all binaries
BINARIES=$(find ~/.derivedData -type f -name "*Tests")
#BINARIES=$(find ~/.derivedData -type f -name "*Tests")

# Print all binaries found
for BINARY in $BINARIES; do
echo "Binary found: $BINARY"
done
#for BINARY in $BINARIES; do
# echo "Binary found: $BINARY"
#done

# Generate lcov for each target
for BINARY in $BINARIES; do
BASE_NAME=$(basename "$BINARY")
echo "Generating coverage for $BASE_NAME"
LCOV_NAME="${BASE_NAME}.lcov"
xcrun llvm-cov export --format=lcov \
-instr-profile "$PROF_DATA" "$BINARY" > "$LCOV_DIR/$LCOV_NAME"
done
#for BINARY in $BINARIES; do
# BASE_NAME=$(basename "$BINARY")
# echo "Generating coverage for $BASE_NAME"
# LCOV_NAME="${BASE_NAME}.lcov"
# xcrun llvm-cov export --format=lcov \
# -instr-profile "$PROF_DATA" "$BINARY" > "$LCOV_DIR/$LCOV_NAME"
#done

# Merge all coverage
echo "Merging partials to lcov.info"
lcov -o lcov.info -a "$LCOV_DIR/*.lcov" --include EdgeAgentSDK/ --exclude Tests > /dev/null
#echo "Merging partials to lcov.info"
#lcov -o lcov.info -a "$LCOV_DIR/*.lcov" --include EdgeAgentSDK/ --exclude Tests > /dev/null

0 comments on commit a7efde5

Please sign in to comment.