Source generation depending on another package
See original GitHub issueI’m actually using conan 0.18.1 but looking at the changelog my problem is not resolved.
I have two conans package, one containing a configuration file that could be required by multiple other packages and another which requires the first package with the configuration file.
To get the configuration file from the first package, I use the imports()
method associated with the helper command self.copy()
. This way, I’m able to get the configuration file from the first package.
But my problem is that the second package has its sources depending on this configuration file, they are generated. The imports()
is called after the source()
therefore I can’t get the configuration file to generate my sources in the right section. I can generate my sources in the build()
but then they will not be present in the package, hence my test_package method fail and further dependencies will be broken too.
I also tried to call self.copy()
directly in the source method, but that was a fail ('NoneType' object is not callable
).
Is it possible to accomplish what I’m trying ?
My guess to do it (only if it is wise from a general point of view) : either call the imports()
method before the source()
method or enable the self.copy
in the source()
method.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Aw ok, I missed the fact that the source are copied to the build folder. There wasn’t any problem, just me that generate code at the wrong place ^^.
Thanks for the clarification 😃
Still not sure about what you mean. The source code evolves as follows:
source()
is calledbuild()
method is calledpackage()
copies from the “build/<ID>” folder to the “package/<ID>” folder, using theself.copy
patternsCode generated either in the
source()
method or in thebuild()
method will end in the “package” folder if correctly managed by thepackage()
method. Am I missing something?In any case, very glad that I could help 😃