-
Notifications
You must be signed in to change notification settings - Fork 325
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
Convert TestPlatform.vsix from V2 to V3 format. #316
Changes from all commits
3f8ef3f
9b3a836
26b4923
5cdaef1
c5ab3cd
7b0206c
36d03ab
82c9245
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ namespace Microsoft.TestPlatform.VSIXCreator | |
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.IO.Compression; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
@@ -15,7 +16,7 @@ public static void Main(string[] args) | |
{ | ||
var inputDirectory = "win7-x64"; | ||
var outputDirectory = System.Environment.CurrentDirectory; | ||
if(args.Length > 0 && !String.IsNullOrEmpty(args[0])) | ||
if (args.Length > 0 && !String.IsNullOrEmpty(args[0])) | ||
{ | ||
inputDirectory = args[0]; | ||
} | ||
|
@@ -31,10 +32,26 @@ public static void Main(string[] args) | |
System.IO.File.Delete(vsixFilePath); | ||
} | ||
|
||
if(System.IO.Directory.Exists(inputDirectory)) | ||
if (System.IO.Directory.Exists(inputDirectory)) | ||
{ | ||
ZipFile.CreateFromDirectory(inputDirectory, vsixFilePath, CompressionLevel.Fastest, false); | ||
} | ||
// Get all files to put in vsix | ||
IEnumerable<string> files = Directory.EnumerateFiles(inputDirectory, "*.*", SearchOption.AllDirectories); | ||
int inputDirectoryLength = inputDirectory.Length; | ||
|
||
using (ZipArchive vsixFile = ZipFile.Open(vsixFilePath, ZipArchiveMode.Create)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: always better to use var instead. |
||
{ | ||
foreach (var file in files) | ||
{ | ||
if (!file.EndsWith(".pdb")) | ||
{ | ||
// Creating same directory structure as of inputDirectory and replacing \ with / to make compatible with V3 format. | ||
// because if we create vsix with \ then at time of installation sub folder does not get copied. | ||
string addFile = file.Substring(inputDirectoryLength + 1).Replace(@"\", @"/"); | ||
vsixFile.CreateEntryFromFile(file, addFile, CompressionLevel.Optimal); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"manifestVersion": "1.1", | ||
"info": { "id": "Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI,version=1.0.2" }, | ||
"packages": [ | ||
{ | ||
"id": "Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI", | ||
"version": "1.0.3", | ||
"type": "Vsix", | ||
"payloads": [ | ||
{ | ||
"fileName": "TestPlatform.vsix", | ||
"size": 3083061 | ||
} | ||
], | ||
"vsixId": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"extensionDir": "[installdir]\\Common7\\IDE\\Extensions\\qgyll0uu.4m0" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. --> | ||
<Import Project="..\..\packages\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.14.0.12-pre\build\Microsoft.VisualStudio.Sdk.BuildTasks.14.0.props" /> | ||
<PropertyGroup> | ||
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">..\..\</TestPlatformRoot> | ||
<FinalizeManifest>true</FinalizeManifest> | ||
<FinalizeSkipLayout>true</FinalizeSkipLayout> | ||
<IsPackage>true</IsPackage> | ||
<OutputPath>$(TestPlatformRoot)artifacts\$(Configuration)\v3vsix\</OutputPath> | ||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | ||
<UseVisualStudioVersion>true</UseVisualStudioVersion> | ||
<ValidateManifest>false</ValidateManifest> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(RunningInMicroBuild)' != 'true'"> | ||
<FinalizeValidate>false</FinalizeValidate> | ||
<ManifestPublishUrl>https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/VS/lab/d15prerel/$(BUILD_BUILDNUMBER);</ManifestPublishUrl> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets" /> | ||
<Import Project="..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props" /> | ||
<ItemGroup> | ||
<VsixFileToCopy Include="Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI.json" /> | ||
<VsixFileToCopy Include="$(TestPlatformRoot)artifacts\$(Configuration)\TestPlatform.vsix" /> | ||
</ItemGroup> | ||
<Target Name="BeforeBuild"> | ||
<Copy SourceFiles="@(VsixFileToCopy)" DestinationFolder="$(OutputPath)" OverwriteReadOnlyFiles="true" SkipUnchangedFiles="true" /> | ||
</Target> | ||
<ItemGroup> | ||
<MergeManifest Include="$(OutputPath)Microsoft.VisualStudio.Templates.CS.MSTestv2.Desktop.UnitTest.json" /> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="vsixmanifest" ContentType="text/xml" /><Default Extension="dll" ContentType="application/octet-stream" /><Default Extension="pdb" ContentType="application/octet-stream" /><Default Extension="exe" ContentType="application/octet-stream" /><Default Extension="config" ContentType="application/octet-stream" /><Default Extension="manifest" ContentType="text/xml" /><Default Extension="rtf" ContentType="application/rtf" /></Types> | ||
<?xml version="1.0" encoding="utf-8"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="vsixmanifest" ContentType="text/xml" /><Default Extension="rtf" ContentType="text/richtext" /><Default Extension="dll" ContentType="application/octet-stream" /><Default Extension="exe" ContentType="application/octet-stream" /><Default Extension="config" ContentType="application/octet-stream" /><Default Extension="manifest" ContentType="text/xml" /><Default Extension="json" ContentType="application/json" /></Types> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"manifestVersion": "1.1", | ||
"info": { "id": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf,version=1.0.2" }, | ||
"packages": [ | ||
{ | ||
"id": "Component.Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"version": "1.0.2", | ||
"type": "Component", | ||
"extension": true, | ||
"dependencies": { | ||
"Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf": "1.0.2", | ||
"Microsoft.VisualStudio.Component.CoreEditor": "[15.0,16.0)" | ||
}, | ||
"localizedResources": [ | ||
{ | ||
"language": "en-US", | ||
"title": "Microsoft Visual Studio Test Platform", | ||
"description": "Extensible Test Platform that allows developers to discover, execute and analyze automated tests." | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"version": "1.0.2", | ||
"type": "Vsix", | ||
"payloads": [ | ||
{ | ||
"fileName": "TestPlatform.vsix", | ||
"size": 3083061 | ||
} | ||
], | ||
"vsixId": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"extensionDir": "[installdir]\\Common7\\IDE\\Extensions\\qgyll0uu.4m0" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011"> | ||
<Metadata> | ||
<Identity Id="Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf" Version="1.0.1" Language="en-US" Publisher="Microsoft" /> | ||
<Identity Id="Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf" Version="1.0.2" Language="en-US" Publisher="Microsoft" /> | ||
<DisplayName>Microsoft Visual Studio Test Platform</DisplayName> | ||
<Description xml:space="preserve">Extensible Test Platform that allows developers to discover, execute and analyze automated tests.</Description> | ||
<License>License.rtf</License> | ||
<PackageId>Microsoft.VisualStudio.TestTools.TestPlatform.V2.CLI</PackageId> | ||
</Metadata> | ||
<Installation AllUsers="true" Experimental="true"> | ||
<Installation AllUsers="true"> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Community" /> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Pro" /> | ||
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" /> | ||
|
@@ -19,4 +21,7 @@ | |
<Assets> | ||
<Asset Type="Microsoft.TestPlatform.V2" Path="vstest.console.exe" /> | ||
</Assets> | ||
</PackageManifest> | ||
<Prerequisites> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain this dependency please. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is by default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a comment here that it is by default? |
||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" /> | ||
</Prerequisites> | ||
</PackageManifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"id": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"version": "1.0.2", | ||
"type": "Vsix", | ||
"vsixId": "Microsoft.TestPlatform.VSIX.Microsoft.0e51abf6-9f5f-401e-a812-4043b87acabf", | ||
"extensionDir": "[installdir]\\Common7\\IDE\\Extensions\\qgyll0uu.4m0", | ||
"files": [ | ||
{ | ||
"fileName": "/extension.vsixmanifest", | ||
"sha256": "439E8D9C90642193F7D2DEA7C40DEFBE8254F63F1926CC385BDA20A3CAC9B476" | ||
}, | ||
{ | ||
"fileName": "/License.rtf", | ||
"sha256": "F451AB5C77BB7B9DC19733D5C9585E0F4A86D8BFB447349C5F6F3D1BEA862630" | ||
} | ||
], | ||
"installSize": 8348725, | ||
"dependencies": { "Microsoft.VisualStudio.Component.CoreEditor": "[15.0,16.0)" } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use var instead of "IEnumerable" as per resharper stylecop conventions.