Skip to content

Conversation

briannadoubt
Copy link

When using xcodebuild from the CLI with a -clonedSourcePackagesDirPath flag, this plugin fails. By adding a custom path to the config file we can leverage this value, and set the path up in a custom way to match our CLI. Because of the way the plugin was already doing the possibleSourcePackagesPaths check we can just add this path there and it doesn't break local builds.

@FelixHerrmann
Copy link
Owner

Thanks for your contribution @briannadoubt! I will take a look at it over the weekend.

@FelixHerrmann
Copy link
Owner

Hi, I have an update here.

Your solution would work but I don't think it scales very well; also the naming collision from the field customSourcePackagesPath and the option --custom-source-packages-path is not ideal, it indicates that the value is passed to the option in the plugin which is not (always) the case.

I have revisited the fixes from #140 and #142 and have an improved version ready (e4b4b87) which will make this solution no longer possible as well.

Despite that I think your request is very reasonable and should be supported, I have another idea to achieve that functionality: we could check for an environment variable in the current process, let's say SPL_CONFIGURATION_FILENAME, with which you can override the configuration file name that the plugin is looking for. So you would create a second configuration file (e.g. swift-package-list-config_ci.json) and then before the xcodebuild <options> invocation set the env-variable with export SPL_CONFIGURATION_FILENAME="swift-package-list-config_ci.json" (SPL_CONFIGURATION_FILENAME="swift-package-list-config_ci.json" xcodebuild <options> would also work and set it for only this command). This would require to expose the --custom-source-packages-path option in the configuration similar to what you have already done in this PR.

Let me know what you think and if there are any concerns with this approach.

@FelixHerrmann
Copy link
Owner

Let me know what you think @briannadoubt, I have some time over the weekend.

@briannadoubt
Copy link
Author

@FelixHerrmann all the points you made are totally valid!! Appreciate your time looking into this idea. Overriding the config file with a process info argument would work for our case (accessing the SourcePackages folder in a non-default location via a custom build environment).

Appreciate your feedback and work towards a scalable vision!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants