Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searching for csproj, fsproj that uses Microsoft.Net.Sdk.Web #10704

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a24e39a
Searching for csproj, vbproj, fsproj using sdk Microsoft.Net.Sdk.Web
issacnitinmsft Jun 20, 2019
cef0696
Merge branch 'master' of https://github.com/Microsoft/azure-pipelines…
issacnitinmsft Jun 20, 2019
b2497ae
Updating package.json
issacnitinmsft Jun 20, 2019
7391524
Updating error message
issacnitinmsft Jun 20, 2019
b32a031
Review comments
issacnitinmsft Jun 21, 2019
b4ea957
Review comments
issacnitinmsft Jun 21, 2019
18b34f0
Try-catch
issacnitinmsft Jun 21, 2019
f6fdbea
Iteratively find and check for file encodings
issacnitinmsft Jun 21, 2019
230f4d8
Review comments
issacnitinmsft Jun 21, 2019
44ab483
Supporting only utf encodings
issacnitinmsft Jun 21, 2019
ec18b03
Merge branch 'master' of https://github.com/Microsoft/azure-pipelines…
issacnitinmsft Jun 24, 2019
98f0500
L0
issacnitinmsft Jun 24, 2019
ab684de
Adding semicolons
issacnitinmsft Jun 24, 2019
f3608b6
Merge branch 'master' into users/nijoy/dotnetcorecliv2_improve_webpro…
issacnitin Jun 24, 2019
c04b69f
Merge branch 'master' into users/nijoy/dotnetcorecliv2_improve_webpro…
issacnitin Jun 25, 2019
302f166
Removing vbproj
issacnitinmsft Jun 25, 2019
a90e273
Merge branch 'users/nijoy/dotnetcorecliv2_improve_webproject_detectio…
issacnitinmsft Jun 25, 2019
4fa6237
Comments
issacnitinmsft Jun 25, 2019
1e585f4
Merge branch 'master' into users/nijoy/dotnetcorecliv2_improve_webpro…
issacnitin Jun 25, 2019
904ce69
Merge branch 'master' into users/nijoy/dotnetcorecliv2_improve_webpro…
issacnitin Jun 25, 2019
ce2175c
Updating error message
issacnitinmsft Jun 25, 2019
db7d2be
Merge branch 'users/nijoy/dotnetcorecliv2_improve_webproject_detectio…
issacnitinmsft Jun 25, 2019
62570a9
Updating error message
issacnitinmsft Jun 25, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"loc.messages.dotnetCommandFailed": "Dotnet command failed with non-zero exit code on the following projects : %s",
"loc.messages.noProjectFilesFound": "Project file(s) matching the specified pattern were not found.",
"loc.messages.noPublishFolderFoundToZip": "A publish folder could not be found to zip for project file: %s.",
"loc.messages.noWebProjectFound": "No web project was found in the repository. Web projects are identified by presence of either a web.config file or wwwroot folder in the directory. You can set Publish Web Projects property to false (publishWebProjects: false in yml) if your project doesn't follow this convention or if you want to publish projects other than web projects.",
"loc.messages.noWebProjectFound": "No web project was found in the repository. Web projects are identified by presence of either a web.config file, wwwroot folder in the directory, or by the usage of Microsoft.Net.Web.Sdk in your csproj file. You can set Publish Web Projects property to false (publishWebProjects: false in yml) if your project doesn't follow this convention or if you want to publish projects other than web projects.",
issacnitin marked this conversation as resolved.
Show resolved Hide resolved
"loc.messages.zipFailed": "Zip failed with error: %s",
"loc.messages.Error_ApiKeyNotSupported": "DotNetCore currently does not support using an encrypted Api Key.",
"loc.messages.Error_ExpectedConfigurationElement": "Invalid xml. Expected element named 'configuration'.",
Expand Down
29 changes: 6 additions & 23 deletions Tasks/DotNetCoreCLIV2/dotnetcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import tl = require("azure-pipelines-task-lib/task");
import tr = require("azure-pipelines-task-lib/toolrunner");
import path = require("path");
import fs = require("fs");
import ltx = require("ltx");
issacnitin marked this conversation as resolved.
Show resolved Hide resolved
var archiver = require('archiver');

import * as packCommand from './packcommand';
import * as pushCommand from './pushcommand';
import * as restoreCommand from './restorecommand';
import * as utility from './Common/utility';


var ltxdomutility = require('webdeployment-common/ltxdomutility')
var fileEncoding = require('webdeployment-common/fileencoding')

export class dotNetExe {
private command: string;
private projects: string[];
Expand Down Expand Up @@ -254,7 +251,7 @@ export class dotNetExe {
}

private extractOutputArgument(): void {
if (!this.arguments || !this.arguments.trim()) {
if (!this.arguments || !this.arguments.trim()) {
return;
}

Expand Down Expand Up @@ -347,30 +344,16 @@ export class dotNetExe {
}
return resolvedProjectFiles;
}

return projectFiles;
}

private isWebSdkUsed(projectfile: string) {
var fileBuffer: Buffer = fs.readFileSync(projectfile);
var fileEncodeType = fileEncoding.detectFileEncoding(projectfile, fileBuffer);
var webConfigContent: string = fileBuffer.toString(fileEncodeType[0]);

if(fileEncodeType[1]) {
webConfigContent = webConfigContent.slice(1);
}

var ltxDom = new ltxdomutility.LtxDomUtility(webConfigContent);
var projectDomArray: Array<any> = ltxDom.getElementsByTagName("project");

for(var project of projectDomArray) {
if(project.attrs['Sdk'].toLowerCase() == "microsoft.net.sdk.web" ||
project.attrs['sdk'].toLowerCase() == "microsoft.net.sdk.web") {
return true;
}
}
var webConfigContent: string = fileBuffer.toString();
issacnitin marked this conversation as resolved.
Show resolved Hide resolved
issacnitin marked this conversation as resolved.
Show resolved Hide resolved

return false;
var projectSdkUsed: string = ltx.parse(webConfigContent).getAttr("sdk") || ltx.parse(webConfigContent).getAttr("Sdk")

return projectSdkUsed != undefined && projectSdkUsed.toLowerCase() == "microsoft.net.sdk.web"
}

private isPublishCommand(): boolean {
Expand Down
6 changes: 0 additions & 6 deletions Tasks/DotNetCoreCLIV2/make.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
"module": "../Common/packaging-common",
"type": "node",
"compile": true
},
{
"module": "../Common/webdeployment-common",
"type": "node",
"dest": "./",
"compile" : true
}
],
"rm": [
Expand Down
203 changes: 18 additions & 185 deletions Tasks/DotNetCoreCLIV2/package-lock.json

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

3 changes: 1 addition & 2 deletions Tasks/DotNetCoreCLIV2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"azure-pipelines-task-lib": "2.8.0",
"packaging-common": "file:../../_build/Tasks/Common/packaging-common-1.0.1.tgz",
"q": "^1.4.1",
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz",
"webdeployment-common": "file:../../_build/Tasks/Common/webdeployment-common-1.0.0.tgz"
"utility-common": "file:../../_build/Tasks/Common/utility-common-1.0.2.tgz"
}
}