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 internal/diagnostics/diagnostics_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions internal/diagnostics/extraDiagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
"category": "Message",
"code": 6420
},
"Failed to update timestamp of file '{0}'.": {
"category": "Message",
"code": 5074
},
"Project '{0}' is out of date because it has errors.": {
"category": "Message",
"code": 6423
Expand Down
18 changes: 9 additions & 9 deletions internal/execute/build/buildtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,16 +661,16 @@ func (t *buildTask) updateTimeStamps(orchestrator *Orchestrator, emittedFiles []
verboseMessageReported = true
}
err := orchestrator.host.SetMTime(file, now)
if err != nil {
t.reportDiagnostic(ast.NewCompilerDiagnostic(diagnostics.Failed_to_update_timestamp_of_file_0, file))
} else if file == buildInfoName {
t.buildInfoEntryMu.Lock()
if t.buildInfoEntry != nil {
t.buildInfoEntry.mTime = now
if err == nil {
if file == buildInfoName {
t.buildInfoEntryMu.Lock()
if t.buildInfoEntry != nil {
t.buildInfoEntry.mTime = now
}
t.buildInfoEntryMu.Unlock()
} else if t.storeOutputTimeStamp(orchestrator) {
orchestrator.host.storeMTime(file, now)
}
t.buildInfoEntryMu.Unlock()
} else if t.storeOutputTimeStamp(orchestrator) {
orchestrator.host.storeMTime(file, now)
}
}

Expand Down
59 changes: 59 additions & 0 deletions internal/execute/tsctests/tscbuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2062,6 +2062,65 @@ func TestBuildProgramUpdates(t *testing.T) {
cwd: "/user/username/projects/project",
commandLineArgs: []string{"--b", "-i", "-w"},
},
{
subScenario: "when root is source from project reference",
files: FileMap{
"/home/src/workspaces/project/lib/tsconfig.json": stringtestutil.Dedent(`
{
"compilerOptions": {
"composite": true,
"outDir": "./dist"
}
}`),
"/home/src/workspaces/project/lib/foo.ts": `export const FOO: string = 'THEFOOEXPORT';`,
"/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
"references": [ { "path": "./lib" } ]
}`),
"/home/src/workspaces/project/index.ts": `import { FOO } from "./lib/foo";`,
},
commandLineArgs: []string{"--b"},
edits: []*tscEdit{
{
caption: "dts doesnt change",
edit: func(sys *testSys) {
sys.appendFile("/home/src/workspaces/project/lib/foo.ts", "const Bar = 10;")
},
},
},
cwd: "/home/src/workspaces/project",
},
{
subScenario: "when root is source from project reference with composite",
files: FileMap{
"/home/src/workspaces/project/lib/tsconfig.json": stringtestutil.Dedent(`
{
"compilerOptions": {
"composite": true,
"outDir": "./dist"
}
}`),
"/home/src/workspaces/project/lib/foo.ts": `export const FOO: string = 'THEFOOEXPORT';`,
"/home/src/workspaces/project/tsconfig.json": stringtestutil.Dedent(`
{
"compilerOptions": {
"composite": true,
},
"references": [ { "path": "./lib" } ]
}`),
"/home/src/workspaces/project/index.ts": `import { FOO } from "./lib/foo";`,
},
commandLineArgs: []string{"--b"},
edits: []*tscEdit{
{
caption: "dts doesnt change",
edit: func(sys *testSys) {
sys.appendFile("/home/src/workspaces/project/lib/foo.ts", "const Bar = 10;")
},
},
},
cwd: "/home/src/workspaces/project",
},
}
for _, test := range testCases {
test.run(t, "programUpdates")
Expand Down
Loading
Loading