# Targets with build plugin generated source require a swift file

**URL:** <https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868>\
**Category:** Package Manager\
**Created:** [December 6, 2022, 2:29pm UTC](https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868 "2022-12-06T14:29:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [December 6, 2022, 2:29pm UTC](https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868/1 "2022-12-06T14:29:08Z")

</div>

If I have a target whose swift code is exclusively generated by swift build plugins, swift package manager warns that the target has no source files and doesn't build the target. Even though there will be swift code as it is generated by the build process. To get the target to compile I have to add an empty swift file to the target. Is this intended?

---

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ktoso/32/44526_2.png) [@ktoso](https://forums.swift.org/u/ktoso)\
**Post date:** [December 6, 2022, 2:32pm UTC](https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868/2 "2022-12-06T14:32:36Z")

</div>

Not sure if intended but it definitely is a known thing, usually just putting a "generated.swift" that is empty and explains where the actual sources "are" is good to do and solves the issue. To be honest that's not so bad, one would normally want a "readme" or something in there anyway, no?

@NeoNacho @abertelrud can comment on wether this is a bug or intended.

---

<div class="post-metadata">

**Author:** ![adam-fowler](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/adam-fowler/32/9266_2.png) [@adam-fowler](https://forums.swift.org/u/adam-fowler)\
**Post date:** [December 6, 2022, 2:36pm UTC](https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868/3 "2022-12-06T14:36:00Z")

</div>

> [@ktoso](#):
>
> usually just putting a "generated.swift" that is empty and explains where the actual sources "are" is good to do and solves the issue

That's what I've been doing. Was just wondering if this is the official line.

---

<div class="post-metadata">

**Author:** ![NeoNacho](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/neonacho/32/1368_2.png) [@NeoNacho](https://forums.swift.org/u/NeoNacho)\
**Post date:** [December 7, 2022, 5:16am UTC](https://forums.swift.org/t/targets-with-build-plugin-generated-source-require-a-swift-file/61868/4 "2022-12-07T05:16:27Z")

</div>

It is a known issue, tracked by rdar://92858144 internally
