ice
ice copied to clipboard
Load slice improvements
This PR improves loadSlice to avoid redefining types, when there are multiple loadSlice calls.
We always run Slice compiler for all the given Slice files, this return a list of code fragments each correspond to a Python module or package. We only compile the new code fragments.
How do we handle the following (did it work before and does it work now):
In 3.7 we have --all which instruct IcePy to also generate code for included files. With 3.7 if you use --all you don't have to worry about compile included files.
So for 3.7 you can do:
Ice.loadSlice("--all A.ice")
Ice.loadSlice("--all B.ice")
In 3.8 you have to explicitly give all the required files.
Ice.loadSlice(["C.ice", "A.ice", "B.ice"])
or
Ice.loadSlice(["C.ice")
Ice.loadSlice(["A.ice")
Ice.loadSlice(["B.ice")
or with the fix in this PR:
Ice.loadSlice(["C.ice", "A.ice"])
Ice.loadSlice(["C.ice", "B.ice"]) # C definitions don't get recompiled