danger / danger/swift

.build/x86_64-apple-macosx/debug/Danger.build/Danger-Swift.h' not found

Open
#442 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.1k
Forks
152
Avg merge
9h 54m
Merged PRs (30d)
2

Description

I have problems setting up danger-swift in my iOS project.

I followed the steps in the readme
```bash
npm install -g danger
brew install danger/tap/danger-swift
```
I created a `DangerCompileDummy.swift` file in the `Sources/DangerDependencies` folder, and created the following `Package.swift` following the example in the README.

```swift
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "DangerDependencies",
products: [
.library(name: "DangerDeps", type: .dynamic, targets: ["DangerDependencies"]),
],
dependencies: [
.package(name: "danger-swift", url: "https://github.com/danger/swift.git", from: "3.0.0")
],
targets: [
.target(name: "DangerDependencies", dependencies: ["danger-swift"], sources: ["DangerCompileDummy.swift"]),
]
)
```
i explicitly had to name the package `danger-swift`, otherwise i get the error `dependency 'Danger' in target 'DangerCompileDummy' requires explicit declaration...`.

However i get the confusing error

```bash
* Build Completed!
Starting Danger PR on my-pr
../my-project/.build/debug/Danger.build/module.modulemap:2:12: error: header '../my-project/.build/x86_64-apple-macosx/debug/Danger.build/Danger-Swift.h' not found
header "../my-project/.build/x86_64-apple-macosx/debug/Danger.build/Danger-Swift.h"
^

/var/folders/ms/28mx7fh50536x8wqx1j_xy7wl492lm/T/_tmp_dangerfile.swift:1:8: error: could not build Objective-C module 'Danger'
import Danger
^
```
I don't know what causes it. All i can see is that this header file referenced in the modulemap is really just not there. From all i can see now, my setup is consistent with the one in the readme.

Environment:
- XCode 12.5
- MacOS BigSur 11.4 (20F71)
```bash
danger --version
10.6.4
danger-swift --version
3.10.1
swift run danger-swift --version
[1/1] Planning build

* Build Completed!3.10.1
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.