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

A "template" package kind #2138

Closed
SirLynix opened this issue Mar 9, 2022 · 1 comment
Closed

A "template" package kind #2138

SirLynix opened this issue Mar 9, 2022 · 1 comment

Comments

@SirLynix
Copy link
Member

SirLynix commented Mar 9, 2022

Is your feature request related to a problem? Please describe.

I'm trying to improve packages qt5core, qt5gui and qt5widgets by having a common package base (qt5lib) to reduce how many lines are required to add a Qt package, but that common base cannot be used in a project directly (and shouldn't be processed by xmake-package CI or xmake-mirror/build-artifacts)

Describe the solution you'd like

Now that we have package inheritance (#2011), it would be nice to have a "template" package kind, that can't be directly used in a project but can serve as a base for real packages.

package("qt5lib")
    set_kind("template")

... -- some generic code

package("qt5core")
    set_base("qt5lib")
    set_kind("library")
... -- customisation of variables in on_load
package_end()

add_requires("qt5lib") -- forbidden, this is a template package
add_requires("qt5core") -- allowed

target("example")
    add_packages("qt5lib") -- forbidden, this is a template package
    add_packages("qt5core") -- allowed

Describe alternatives you've considered

Adding an error in the package on_load if its directly included, however this will make xmake-repo and xmake-mirror CI fail

@waruqi waruqi added this to the v2.6.5 milestone Mar 9, 2022
@waruqi
Copy link
Member

waruqi commented Mar 9, 2022

I have supported it

@waruqi waruqi closed this as completed Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants