(zilch planner step): track historical build plan steps
This commit is contained in:
parent
43322a8f05
commit
20f06e2eb9
1 changed files with 17 additions and 6 deletions
|
|
@ -23,13 +23,17 @@
|
||||||
(finalized build-plan-finalized set-build-plan-finalized!)
|
(finalized build-plan-finalized set-build-plan-finalized!)
|
||||||
(last-id build-plan-last-id set-build-plan-last-id!))
|
(last-id build-plan-last-id set-build-plan-last-id!))
|
||||||
|
|
||||||
|
;; Represents a single step in the build.
|
||||||
|
;; id is a monotonically increasing identifier.
|
||||||
|
;; dependencies is an alist of identifiers for other build steps to when they were added.
|
||||||
(define-record-type <build-step>
|
(define-record-type <build-step>
|
||||||
(make-build-step id dependencies type arguments)
|
(make-build-step id dependencies type arguments called-from)
|
||||||
build-step?
|
build-step?
|
||||||
(id build-step-id)
|
(id build-step-id)
|
||||||
(dependencies build-step-dependencies set-build-step-dependencies!)
|
(dependencies build-step-dependencies set-build-step-dependencies!)
|
||||||
(type build-step-type)
|
(type build-step-type)
|
||||||
(arguments build-step-arguments set-build-step-arguments!))
|
(arguments build-step-arguments set-build-step-arguments!)
|
||||||
|
(called-from build-step-called-from))
|
||||||
|
|
||||||
(define-record-type <build-step-type>
|
(define-record-type <build-step-type>
|
||||||
(make-build-step-type proc name batch)
|
(make-build-step-type proc name batch)
|
||||||
|
|
@ -51,7 +55,7 @@
|
||||||
;; Appends a new step to the build plan, returning its ID.
|
;; Appends a new step to the build plan, returning its ID.
|
||||||
(define (build-plan-append plan type args dependencies)
|
(define (build-plan-append plan type args dependencies)
|
||||||
(define id (build-plan-next-id plan))
|
(define id (build-plan-next-id plan))
|
||||||
(define new-step (make-build-step id dependencies type args))
|
(define new-step (make-build-step id dependencies type args #f))
|
||||||
(set-build-plan-steps! plan (mapping-set! (build-plan-steps plan) id new-step))
|
(set-build-plan-steps! plan (mapping-set! (build-plan-steps plan) id new-step))
|
||||||
id)
|
id)
|
||||||
|
|
||||||
|
|
@ -154,10 +158,17 @@
|
||||||
(make-build-step (build-step-id step)
|
(make-build-step (build-step-id step)
|
||||||
(list-ref result 3)
|
(list-ref result 3)
|
||||||
(list-ref result 1)
|
(list-ref result 1)
|
||||||
(list-ref result 2)))))
|
(list-ref result 2)
|
||||||
|
(cons (build-plan-next-id plan) step)))))
|
||||||
((append)
|
((append)
|
||||||
(set-build-step-dependencies! step (append (build-step-dependencies step) (list-ref result 1)))
|
(set-build-plan-steps! plan
|
||||||
(unless (eq? (list-ref result 2) #f) (set-build-step-arguments! step (list-ref result 2))))))
|
(mapping-set! (build-plan-steps plan)
|
||||||
|
(build-step-id step)
|
||||||
|
(make-build-step (build-step-id step)
|
||||||
|
(append (build-step-dependencies step) (list-ref result 1))
|
||||||
|
(build-step-type step)
|
||||||
|
(or (list-ref result 2) (build-step-arguments step))
|
||||||
|
(cons (build-plan-next-id plan) step)))))))
|
||||||
|
|
||||||
;; Run all build steps that are ready to run.
|
;; Run all build steps that are ready to run.
|
||||||
(mapping-for-each
|
(mapping-for-each
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue