Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defining parameters per-subproject #105

Open
ikstewa opened this issue Mar 22, 2023 · 3 comments
Open

Support defining parameters per-subproject #105

ikstewa opened this issue Mar 22, 2023 · 3 comments
Labels
question Further information is requested

Comments

@ikstewa
Copy link

ikstewa commented Mar 22, 2023

The current usage recommendation of this plugins shows all build parameters defined globally for the entire project.

We typically operate with a larger root project which multiple sub-projects. Each of those sub-projects may have parameters that are distinct to just that project.

Ideally we would like to apply the plugin to a sub-project, define the build parameters for that project, and reference from within the build file the parameters are defined in.

Is it possible to use this plugin to define build parameters per sub-project?

@britter britter added the question Further information is requested label Mar 23, 2023
@britter
Copy link
Member

britter commented Mar 23, 2023

It's not possible to define parameters per subproject. My recommendation would be to use parameter groups to separate parameters of the individual sub projects.

@ikstewa
Copy link
Author

ikstewa commented Mar 23, 2023

Is there a specific technical limitation why this plugin requires the parameters to be defined inside of a generated plugin instead of allowing them to be configured in the build file?

@britter
Copy link
Member

britter commented Mar 27, 2023

@ikstewa your question is the answer already 🙃 This plugin's goal is to provide compile-safe access to parameters supplied to a build. In order to do this, we need to generate some code, that you can compile your build script against. It's not possible to specify a parameter and use it in the same script, because the code that's backing the parameter can't be generated without compiling the build script. But in order to compile the build script, you need the generated code.

What you could do is generate multiple plugins with different plugin IDs. So for each module in your build you would set up a dedicated build-parameters module that generates the build parameters plugin for that module. You need to use the buildParameters.pluginId(String) method to set a unique plugin ID for each generated plugin.

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

No branches or pull requests

2 participants