A build linearization should define the order in which built classes are appended to an artifact. These can be known in advance of compilation completing, so building the artifact can begin as soon as each is ready.
Using the build linearization, each item can be a future which awaits both its corresponding compilation future and the previous item, appending classfiles to the artifact as they go. Some cleanup might be required if compilation fails.
A build linearization should define the order in which built classes are appended to an artifact. These can be known in advance of compilation completing, so building the artifact can begin as soon as each is ready.
Using the build linearization, each item can be a future which awaits both its corresponding compilation future and the previous item, appending classfiles to the artifact as they go. Some cleanup might be required if compilation fails.