Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Terrabuild.Configuration.Tests/Project.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let parseProject() =
Defaults = None }

let targetBuild =
{ TargetBlock.DependsOn = Set [ "target.dist" ] |> Some
{ TargetBlock.DependsOn = Set [ "dist" ] |> Some
TargetBlock.Rebuild = None
TargetBlock.Outputs = None
TargetBlock.Cache = None
Expand Down
8 changes: 4 additions & 4 deletions src/Terrabuild.Configuration.Tests/Workspace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ open Terrabuild.Expressions
let parseWorkspace() =
let expectedWorkspace =
let targetBuild =
{ TargetBlock.DependsOn = Set [ "target.^build" ] |> Some
{ TargetBlock.DependsOn = Set [ "^build" ] |> Some
TargetBlock.Rebuild = None }
let targetDist =
{ TargetBlock.DependsOn = Set [ "target.build" ] |> Some
{ TargetBlock.DependsOn = Set [ "build" ] |> Some
TargetBlock.Rebuild = Expr.Bool true |> Some }
let targetDummy =
{ TargetBlock.DependsOn = None
Expand Down Expand Up @@ -62,10 +62,10 @@ let parseWorkspace() =
let parseWorkspace2() =
let expectedWorkspace =
let targetBuild =
{ TargetBlock.DependsOn = Set [ "target.^build" ] |> Some
{ TargetBlock.DependsOn = Set [ "^build" ] |> Some
TargetBlock.Rebuild = None }
let targetDist =
{ TargetBlock.DependsOn = Set [ "target.build" ] |> Some
{ TargetBlock.DependsOn = Set [ "build" ] |> Some
TargetBlock.Rebuild = Expr.Bool true |> Some }
let targetDummy =
{ TargetBlock.DependsOn = None
Expand Down
2 changes: 1 addition & 1 deletion src/Terrabuild.Configuration/Transpiler/Project.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ let toTarget (block: Block) =
|> Option.map (fun dependsOn ->
dependsOn |> Set.map (fun dependency ->
match dependency with
| String.Regex "^target\.(.*)$" [_] -> dependency
| String.Regex "^target\.(.*)$" [targetIdentifier] -> targetIdentifier
| _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'"))
let cache = block |> tryFindAttribute "cache"
let steps =
Expand Down
2 changes: 1 addition & 1 deletion src/Terrabuild.Configuration/Transpiler/Workspace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let toTarget (block: Block) =
|> Option.map (fun dependsOn ->
dependsOn |> Set.map (fun dependency ->
match dependency with
| String.Regex "^target\.(.*)$" [_] -> dependency
| String.Regex "^target\.(.*)$" [targetIdentifier] -> targetIdentifier
| _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'"))
let rebuild = block |> tryFindAttribute "rebuild"

Expand Down
4 changes: 2 additions & 2 deletions src/Terrabuild/Core/Builder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa
dependsOns
|> Set.fold (fun (accInChildren, accOutChildren) dependsOn ->
match dependsOn with
| String.Regex "^target\.\^(.+)$" [ parentDependsOn ] ->
| String.Regex "^\^(.+)$" [ parentDependsOn ] ->
accInChildren, accOutChildren + projectConfig.Dependencies |> Set.collect (buildTarget parentDependsOn)
| String.Regex "^target\.(.+)$" [ dependsOn ] ->
| String.Regex "^(.+)$" [ dependsOn ] ->
accInChildren + buildTarget dependsOn project, accOutChildren
| _ -> raiseBugError "Invalid target dependency format") (Set.empty, Set.empty)

Expand Down
14 changes: 7 additions & 7 deletions tests/cluster-layers/results/terrabuild-debug.build-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"hash": "34215119A4D68DB3B1137C90704FFA326799B219AE86B2DE93A123F6FEDCF68B",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -88,7 +88,7 @@
"hash": "34215119A4D68DB3B1137C90704FFA326799B219AE86B2DE93A123F6FEDCF68B",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -167,7 +167,7 @@
"hash": "E970FB6D3CCDCEE5AB6C4BAAB40D38439BDA75E6635D1B81F9A9DF7AFA6286C4",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -246,7 +246,7 @@
"hash": "F9B0B5708DFC227889BB22353D3EC4D1C1A57C07439470229E286568F031D11A",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -305,7 +305,7 @@
"hash": "F9B0B5708DFC227889BB22353D3EC4D1C1A57C07439470229E286568F031D11A",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -364,7 +364,7 @@
"hash": "8F9422FFE2A136EC80F0C31D42C172CA05826D7DAFBB18BBCE27B1719A82AE1E",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -421,7 +421,7 @@
"hash": "8F9422FFE2A136EC80F0C31D42C172CA05826D7DAFBB18BBCE27B1719A82AE1E",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down
16 changes: 8 additions & 8 deletions tests/cluster-layers/results/terrabuild-debug.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"targets": {
"build": [
"target.^build"
"^build"
]
},
"projects": {
Expand All @@ -27,7 +27,7 @@
"hash": "34215119A4D68DB3B1137C90704FFA326799B219AE86B2DE93A123F6FEDCF68B",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -84,7 +84,7 @@
"hash": "34215119A4D68DB3B1137C90704FFA326799B219AE86B2DE93A123F6FEDCF68B",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -144,7 +144,7 @@
"hash": "E970FB6D3CCDCEE5AB6C4BAAB40D38439BDA75E6635D1B81F9A9DF7AFA6286C4",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -198,7 +198,7 @@
"hash": "F9B0B5708DFC227889BB22353D3EC4D1C1A57C07439470229E286568F031D11A",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -241,7 +241,7 @@
"hash": "F9B0B5708DFC227889BB22353D3EC4D1C1A57C07439470229E286568F031D11A",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -285,7 +285,7 @@
"hash": "8F9422FFE2A136EC80F0C31D42C172CA05826D7DAFBB18BBCE27B1719A82AE1E",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -323,7 +323,7 @@
"hash": "8F9422FFE2A136EC80F0C31D42C172CA05826D7DAFBB18BBCE27B1719A82AE1E",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down
6 changes: 3 additions & 3 deletions tests/multirefs/results/terrabuild-debug.build-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -58,7 +58,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -106,7 +106,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down
16 changes: 8 additions & 8 deletions tests/multirefs/results/terrabuild-debug.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
],
"targets": {
"build": [
"target.^build"
"^build"
],
"docker": [
"target.^publish",
"target.publish"
"^publish",
"publish"
],
"publish": [
"target.build"
"build"
],
"push": [
"target.docker"
"docker"
]
},
"projects": {
Expand All @@ -33,7 +33,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -70,7 +70,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -105,7 +105,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down
20 changes: 10 additions & 10 deletions tests/simple/results/terrabuild-debug.build-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"hash": "339771D0416B0DE57F074F35A58947EC4DF21B15E79871D2231F33753B48C98E",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"*.planfile"
Expand Down Expand Up @@ -95,7 +95,7 @@
"hash": "80456575F34E04D1425875BF90F22EBAB1F3D70EC046398D85B2E66FE96E3FED",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -159,7 +159,7 @@
"hash": "A16A69B69BAAD8E5F7446EDA76618622CBB09F32BB4E2CBCFA87748838A6BF30",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -216,7 +216,7 @@
"hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -262,7 +262,7 @@
"hash": "80456575F34E04D1425875BF90F22EBAB1F3D70EC046398D85B2E66FE96E3FED",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/*.binlog",
Expand Down Expand Up @@ -328,7 +328,7 @@
"hash": "C6337486788B3103E3C2737C5C465A151569678B0F79EDBAF65D6409D1FDDCB4",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"dist"
Expand Down Expand Up @@ -407,7 +407,7 @@
"hash": "A16A69B69BAAD8E5F7446EDA76618622CBB09F32BB4E2CBCFA87748838A6BF30",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -464,7 +464,7 @@
"hash": "A16A69B69BAAD8E5F7446EDA76618622CBB09F32BB4E2CBCFA87748838A6BF30",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"**/dist/"
Expand Down Expand Up @@ -524,7 +524,7 @@
"hash": "368590893C4C4CB86F11CE435BED211B8E67BBAA776E88A26BA9786A25B48841",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [],
"operations": [
Expand Down Expand Up @@ -582,7 +582,7 @@
"hash": "5F97E6095B871F9045214CFE08ABC4C8E778379ACCA4D34A94079C508D24D5C4",
"rebuild": false,
"dependsOn": [
"target.^build"
"^build"
],
"outputs": [
"target/debug/",
Expand Down
Loading