Skip to content

Commit

Permalink
Recognize relative path using in outDir property (#9025)
Browse files Browse the repository at this point in the history
* Recognize relative path using in outDir property

* Add projects tests

* Add project .json files

* Update baselines
  • Loading branch information
yuit committed Jun 8, 2016
1 parent 179d423 commit 899f667
Show file tree
Hide file tree
Showing 92 changed files with 420 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ tests/webhost/*.d.ts
tests/webhost/webtsc.js
tests/cases/**/*.js
tests/cases/**/*.js.map
tests/cases/**/*.d.ts
*.config
scripts/debug.bat
scripts/run.bat
Expand All @@ -49,3 +48,4 @@ internal/
**/.vs
**/.vscode
!**/.vscode/tasks.json
!tests/cases/projects/projectOption/**/node_modules
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ namespace ts {
if (outDir) {
exclude.push(outDir);
}
exclude = map(exclude, normalizeSlashes);
exclude = map(exclude, e => getNormalizedAbsolutePath(e, basePath));

const supportedExtensions = getSupportedExtensions(options);
Debug.assert(indexOf(supportedExtensions, ".ts") < indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property with only node_modules in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"a.js",
"a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify default exclude property with only node_modules in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"a.js",
"a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePathWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePathWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePath",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare var test: number;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePath",
"baselineCheck": true,
"declaration": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js",
"OutDir/a.d.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePathWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var test = 10;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeWithOutUsingRelativePathWithAllowJS",
"baselineCheck": true,
"resolvedInputFiles": [
"lib.d.ts",
"a.ts"
],
"emittedFiles": [
"OutDir/a.js"
]
}
6 changes: 6 additions & 0 deletions tests/cases/project/defaultExcludeNodeModulesAndOutDir.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDir",
"baselineCheck": true,
"declaration": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scenario": "Verify default exclude property in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndOutDirWithAllowJS",
"baselineCheck": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDir",
"baselineCheck": true,
"declaration": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"scenario": "Verify default exclude property with relative path for 'outDir' in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeNodeModulesAndRelativePathOutDirWithAllowJS",
"baselineCheck": true
}
6 changes: 6 additions & 0 deletions tests/cases/project/defaultExcludeOnlyNodeModules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"scenario": "Verify default exclude property with only node_modules in project option",
"projectRoot": "tests/cases/projects/projectOption/DefaultExcludeOnlyNodeModules",
"baselineCheck": true,
"declaration": true
}
6 changes: 6 additions & 0 deletions tests/cases/project/specifyExcludeUsingRelativepath.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"scenario": "Verify exclude property without using relative path",
"projectRoot": "tests/cases/projects/projectOption/SpecifyExcludeUsingRelativePath",
"baselineCheck": true,
"declaration": true
}
Loading

0 comments on commit 899f667

Please sign in to comment.