roc-lang / rbt

Roc Build Tool
Universal Permissive License v1.0
49 stars 5 forks source link

implement FileMapping #68

Closed BrianHicks closed 1 year ago

BrianHicks commented 2 years ago

As in ADR 008 (docs/adrs/008-unified-inputs.md) we need some data structure like this to avoid conflicts between jobs and source files:

FileMapping := { sourceFile : Str, workspacePath : Str }

sourceFile : Str -> FileMapping
sourceFile = \path -> @FileMapping { sourceFile : path, workspacePath : path }

withWorkspacePath : FileMapping, Str -> FileMapping
withWorkspacePath = \@FileMapping { sourceFile }, workspacePath ->
    @FileMapping { sourceFile, workspacePath }

Right now we're just using a Str for input paths—they should be replaced by this data structure.