gradle / gradle/gradle-native

XCTest plugin should offer more convenient support for testing on Linux

Open
#459 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
94
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Currently, a separate "main.swift" Swift source file is required for tests to run on Linux. This has two usability issues:

- Gradle expects "main.swift" whereas the Swift PM convention is "LinuxMain.swift". It would be easier to migrate if Gradle used the same convention or made this configurable.
- The "main.swift" source file should not be compiled on MacOS, and build logic rather than the XCTest plugin is currently responsible for dealing with this. It would be better to move this to the plugin.

Although a better solution would be to remove the need for a "main.swift" entirely, in the short term we can make some minor tweaks to improve the experience.

Contributor guide

Open the contributing guide

Research direction

Start by examining the XCTest plugin and the build logic that currently handles main.swift on Linux and macOS. Compare the existing main.swift convention with Swift Package Manager's LinuxMain.swift convention. Done means the plugin provides more convenient Linux test support, including configurable or matching source naming and keeping the Linux entry-point source out of macOS compilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.