Package bm.machine
Class Machine
java.lang.Object
bm.machine.Machine
Machinery to build things. Use
update(bm.machine.Target) to update a target.-
Constructor Summary
ConstructorsConstructorDescriptionMachine(SupplyOrThrow<StateStore> stateStoreSupplier) Creates the machine with its state store. -
Method Summary
Modifier and TypeMethodDescriptiontriggeringDepencendies(Target target) Once the target's update process has proceeded far enough to be sure about the dependencies that are triggering its recreation, this returns those dependencies, otherwisenullis returned.voidUpdates the target, i.e.booleanwasRecreated(Target target) Was the target actually recreated so far?booleanwasUpdated(Target target) Was a target updated so far?
-
Constructor Details
-
Machine
Creates the machine with its state store. The state store is used to store hashes of targets which allow to find out whether a target has changed since last looked at.- Parameters:
stateStoreSupplier- to be called at the start ofupdate(bm.machine.Target)to obtain the state store where to persist target states between invocations.- See Also:
-
-
Method Details
-
wasUpdated
Was a target updated so far?- Parameters:
target- to query- Returns:
trueifupdate(bm.machine.Target)was run for the target.- Throws:
BuildProblemException
-
wasRecreated
Was the target actually recreated so far?- Parameters:
target- to query- Returns:
trueifTarget.recreate()was run for the target.- Throws:
BuildProblemException
-
triggeringDepencendies
Once the target's update process has proceeded far enough to be sure about the dependencies that are triggering its recreation, this returns those dependencies, otherwisenullis returned.- Parameters:
target- to query- Returns:
- the triggering dependencies, which may be empty
- Throws:
BuildProblemException
-
update
Updates the target, i.e. it makes sureTarget.recreate()is called if this is necessary. In particular all dependencies are updated first, if they were not updated already. If a hash created by combiningStateProvider.addState(java.util.function.Consumer<byte[]>)of all dependencies with the one of the given target is different from the previously stored hash, if any,Target.recreate()is called.- Throws:
BuildProblemException- as needed
-