Skip to content

Commit

Permalink
Fixed gulpfile.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Hovsep Mkrtchyan committed May 18, 2016
1 parent 6cb707c commit 69a989d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
10 changes: 5 additions & 5 deletions AutoRest/Generators/CSharp/Azure.CSharp.Tests/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.0",
"version": "2.0.0",
"summary": "Generator.CSharp Tests.",
"authors": [ "Microsoft" ],
"tags": [ "Microsoft AutoRest ClientRuntime REST" ],
Expand All @@ -15,10 +15,10 @@
},
"exclude": [ "CSharpAzureCodeNamingFrameworkTests.*" ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-*",
"CSharp.Tests": "1.5.0",
"Microsoft.Rest.ClientRuntime.Azure": "[4.0.0,5.0.0)",
"Microsoft.NETCore.App": "1.0.0-rc2-3002702",
"CSharp.Tests": "2.0.0",
"Microsoft.Rest.ClientRuntime.Azure": "[4.1.0,5.0.0)",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-140469-38"
"dotnet-test-xunit": "1.0.0-rc2-build10015"
}
}
14 changes: 7 additions & 7 deletions AutoRest/Generators/CSharp/CSharp.Tests/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.0",
"version": "2.0.0",
"summary": "Generator.CSharp Tests.",
"authors": [ "Microsoft" ],
"tags": [ "Microsoft AutoRest ClientRuntime REST" ],
Expand All @@ -15,12 +15,12 @@
},
"exclude": [ "CSharpCodeNamingFrameworkTests.*" ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-*",
"Microsoft.Rest.ClientRuntime": "[3.0.0,4.0)",
"Microsoft.Extensions.Logging": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.Extensions.Logging.Filter": "1.0.0-*",
"Microsoft.NETCore.App": "1.0.0-rc2-3002702",
"Microsoft.Rest.ClientRuntime": "[3.1.0,4.0)",
"Microsoft.Extensions.Logging": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final",
"Microsoft.Extensions.Logging.Filter": "1.0.0-rc2-final",
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-140469-38"
"dotnet-test-xunit": "1.0.0-rc2-build10015"
}
}
17 changes: 8 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ requireDir = require('require-dir')('./Tools/gulp'),
exec = require('child_process').exec;

const DEFAULT_ASSEMBLY_VERSION = '0.9.0.0';
const DNX_VERSION = '1.0.0-rc1-final';
const MAX_BUFFER = 1024 * 4096;
var isWindows = (process.platform.lastIndexOf('win') === 0);
process.env.MSBUILDDISABLENODEREUSE = 1;
Expand Down Expand Up @@ -555,7 +554,7 @@ var xunitTestsDlls = [
'AutoRest/Generators/Azure.Common/Azure.Common.Tests/bin/Net45-Debug/AutoRest.Generator.Azure.Common.Tests.dll'
];

var xunitDnxXproj = [
var xunitNetCoreXproj = [
'AutoRest/Generators/CSharp/Azure.CSharp.Tests/project.json',
'AutoRest/Generators/CSharp/CSharp.Tests/project.json',
'ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime.Tests/project.json',
Expand Down Expand Up @@ -587,7 +586,7 @@ var xunit = function(template, options){
return execClrCmd(xunitRunner + ' ' + template, options);
}

var xunitdnx = function(options){
var xunitnetcore = function(options){
options.templateData = {
f: function (s) {
return path.basename(path.dirname(s))
Expand All @@ -597,18 +596,18 @@ var xunitdnx = function(options){
if (!isWindows) {
printStatusCodeCmd = 'echo Status code: $?';
}
var dnxScript = 'dnx --project "<%= file.path %>" test -verbose -xml "' + path.join(basePathOrThrow(), '/TestResults/') + '<%= f(file.path) %>.xml" && ' + printStatusCodeCmd;
return shell(dnxScript, options);
var netcoreScript = 'dotnet test "<%= file.path %>" -verbose -xml "' + path.join(basePathOrThrow(), '/TestResults/') + '<%= f(file.path) %>.xml" && ' + printStatusCodeCmd;
return shell(netcoreScript, options);
}

gulp.task('test:xunit', ['test:xunit:dnx'], function () {
gulp.task('test:xunit', ['test:xunit:netcore'], function () {
return gulp.src(xunitTestsDlls).pipe(xunit('<%= file.path %> -noshadow -noappdomain -diagnostics', defaultShellOptions));
});

gulp.task('test:xunit:dnx', ['regenerate:expected:cs', 'regenerate:expected:csazure'], function () {
return gulp.src(xunitDnxXproj)
gulp.task('test:xunit:netcore', ['regenerate:expected:cs', 'regenerate:expected:csazure'], function () {
return gulp.src(xunitNetCoreXproj)
.pipe(debug())
.pipe(xunitdnx(defaultShellOptions));
.pipe(xunitnetcore(defaultShellOptions));
});

var nugetPath = path.resolve('Tools/NuGet.exe');
Expand Down

0 comments on commit 69a989d

Please sign in to comment.