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

Convert MIDebugEngine to use SDK csproj #1075

Merged
merged 18 commits into from
Dec 16, 2020
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
60 changes: 0 additions & 60 deletions BuildAndTest.proj

This file was deleted.

55 changes: 48 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ jobs:
- job: Debug
pool: 'Hosted Windows 2019 with VS2019'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Debug'
- task: VSTest@2
inputs:
testAssemblyVer2: |
$(Build.SourcesDirectory)\bin\Debug\MICoreUnitTests.dll
$(Build.SourcesDirectory)\bin\Debug\JDbgUnitTests.dll
$(Build.SourcesDirectory)\bin\Debug\SSHDebugTests.dll
- task: PublishTestResults@2
inputs:
testResultsFormat: 'xUnit'
Expand All @@ -19,10 +30,21 @@ jobs:
- job: Release
pool: 'Hosted Windows 2019 with VS2019'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Release'
- task: VSTest@2
inputs:
testAssemblyVer2: |
$(Build.SourcesDirectory)\bin\Release\MICoreUnitTests.dll
$(Build.SourcesDirectory)\bin\Release\JDbgUnitTests.dll
$(Build.SourcesDirectory)\bin\Release\SSHDebugTests.dll
- task: PublishTestResults@2
inputs:
testResultsFormat: 'xUnit'
Expand All @@ -33,36 +55,55 @@ jobs:
- job: DesktopDebug
pool: 'Hosted Windows 2019 with VS2019'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Desktop.Debug'


- job: DesktopRelease
pool: 'Hosted Windows 2019 with VS2019'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Desktop.Release'

- job: LabRelease
pool: 'Hosted Windows 2019 with VS2019'
variables:
TEST_LAB_BUILD: 'true'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Lab.Release'

- job: LabDebug
pool: 'Hosted Windows 2019 with VS2019'
variables:
TEST_LAB_BUILD: 'true'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\src\.nuget\NuGet.config'
- task: MSBuild@1
inputs:
solution: 'BuildAndTest.proj'
solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln'
configuration: 'Lab.Debug'
47 changes: 0 additions & 47 deletions build.cmd

This file was deleted.

15 changes: 6 additions & 9 deletions build/Analyzers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@
<PropertyGroup>
<!-- Disable Legacy FxCop -->
<RunCodeAnalysis>false</RunCodeAnalysis>
<EnableNETAnalyzers>true</EnableNETAnalyzers>

<!-- Point to ruleset -->
<CodeAnalysisRuleSet>..\IDECodeAnalysis.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.CodeAnalysis.VersionCheckAnalyzer.3.3.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.VersionCheckAnalyzer.resources.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.CodeAnalysis.VersionCheckAnalyzer.3.3.0\analyzers\dotnet\Microsoft.CodeAnalysis.VersionCheckAnalyzer.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.CodeQuality.Analyzers.3.3.0\analyzers\dotnet\cs\Humanizer.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.CodeQuality.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.CodeQuality.Analyzers.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.CodeQuality.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.CodeQuality.CSharp.Analyzers.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.NetCore.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.NetCore.Analyzers.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.NetCore.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.NetCore.CSharp.Analyzers.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.NetFramework.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.NetFramework.Analyzers.dll" />
<Analyzer Include="$(NugetPackagesDirectory)\Microsoft.NetFramework.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.NetFramework.CSharp.Analyzers.dll" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.VersionCheckAnalyzer" Version="3.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeQuality.Analyzers" Version="3.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NetCore.Analyzers" Version="3.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.NetFramework.Analyzers" Version="3.3.0" PrivateAssets="all" />
</ItemGroup>
</Project>
23 changes: 19 additions & 4 deletions build/DropFiles.targets
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<ItemGroup Condition="'$(SIGN_TYPE)' == 'real'">
<FilesToSign Include="@(DropSignedFile)">
<Authenticode>Microsoft400</Authenticode>
<StrongName>StrongName</StrongName>
WardenGnaw marked this conversation as resolved.
Show resolved Hide resolved
</FilesToSign>
</ItemGroup>

<Target Name="DropFiles" AfterTargets="SignFiles;Build" Condition="'@(DropUnsignedFile);@(DropSignedFile)' != ';'">
<ItemGroup Condition="'$(SIGN_TYPE)' != 'real'">
<!-- Can not 'test' sign with StrongName -->
<FilesToSign Include="@(DropSignedFile)">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>

<!-- Sign 3rd Party dlls -->
<ItemGroup>
<FilesToSign Include="@(DropThirdPartySignedFile)">
<Authenticode>3PartySHA2</Authenticode>
<StrongName>None</StrongName>
</FilesToSign>
</ItemGroup>

<Target Name="DropFiles" AfterTargets="SignFiles;Build" Condition="'@(DropUnsignedFile);@(DropSignedFile);@(DropThirdPartySignedFile)' != ';;'">
<PropertyGroup>
<DropDir>$(DropRootDir)</DropDir>
<DropDir Condition="'$(DropSubDir)'!=''">$(DropRootDir)\$(DropSubDir)</DropDir>
</PropertyGroup>
<!--In official builds of the lab configuration, make sure that the MicroBuild props are included in any project that uses DropFiles-->
<Error Condition="'$(MicroBuild_SigningTargetsImported)'!='true' and '$(Lab)'!='false' and '$(TEST_LAB_BUILD)'=='' and '$(BUILD_BUILDURI)'!=''" Text="MicroBuild.Core.props must be included in projects that use DropFiles." />
<Error Condition="'$(PkgMicrosoft_VisualStudioEng_MicroBuild_Core)'=='' and '$(Lab)'!='false' and '$(TEST_LAB_BUILD)'=='' and '$(BUILD_BUILDURI)'!=''" Text="MicroBuild.Core.props must be included in projects that use DropFiles." />
<MakeDir Condition="!Exists($(DropDir))" Directories="$(DropDir)" />
<Copy DestinationFolder="$(DropDir)" SourceFiles="@(DropUnsignedFile);@(DropSignedFile)" />
<Copy DestinationFolder="$(DropDir)" SourceFiles="@(DropUnsignedFile);@(DropSignedFile);@(DropThirdPartySignedFile)" />
</Target>

</Project>
2 changes: 0 additions & 2 deletions build/all_projects.settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
<MIEngineRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..'))\</MIEngineRoot>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ILDir>$(MIEngineRoot)IL\</ILDir>
<NuGetPackagesDirectory>$(MIEngineRoot)src\packages</NuGetPackagesDirectory>
<GeneratedAssembliesDir>$(ILDir)GeneratedAssemblies\</GeneratedAssembliesDir>
<MIDefaultOutputPath>$(MIEngineRoot)bin\$(Configuration)\</MIDefaultOutputPath>
<DropDir>$(MIEngineRoot)bin\$(Configuration)</DropDir>
<ToolsHome>$(MIEngineRoot)\tools</ToolsHome>
<IntermediateOutputPath>$(MIEngineRoot)obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
<IntermediateGeneratedOutputPath>$(IntermediateOutputPath)Generated\</IntermediateGeneratedOutputPath>
</PropertyGroup>

<!-- Source Link -->
Expand Down
6 changes: 6 additions & 0 deletions build/miengine.settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</Target>

<Import Project="all_projects.settings.targets"/>
<Import Project="package_versions.settings.targets" />
<Import Project="version.settings.targets" />

<Choose>
Expand Down Expand Up @@ -55,6 +56,11 @@
<DropRootDir Condition="'$(TF_BUILD_BINARIESDIRECTORY)'!=''">$(TF_BUILD_BINARIESDIRECTORY)\$(DropConfigurationName)</DropRootDir>
<DropRootDir Condition="'$(BUILD_BINARIESDIRECTORY)'!=''">$(BUILD_BINARIESDIRECTORY)\$(DropConfigurationName)</DropRootDir>
<DropRootDir Condition="'$(DropRootDir)'==''">$(MIEngineRoot)bin\$(DropConfigurationName)\drop</DropRootDir>

<!-- SDK Project Variables -->
<Configurations>Debug;Release;Desktop.Debug;Desktop.Release;Lab.Debug;Lab.Release</Configurations>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

</Project>
23 changes: 21 additions & 2 deletions build/miengine.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
<BuildDependsOn>$(BuildDependsOn);GenerateMonoSymbols</BuildDependsOn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mono.Unofficial.pdb2mdb" Version="4.2.3.4" GeneratePathProperty="true" />
</ItemGroup>

<Target Name="GenerateMonoSymbols"
Condition="'$(IsXPlat)' == 'true' AND '$(ShouldGenerateMonoSymbols)' == 'true'">
Condition="'$(IsXPlat)' == 'true' AND '$(ShouldGenerateMonoSymbols)' == 'true'"
AfterTargets="Build" >
<!-- If we're building the Desktop config on Windows, run pdb2mdb to generate Mono symbols as well -->
<Exec Command="&quot;$(NugetPackagesDirectory)\Mono.Unofficial.pdb2mdb.4.2.3.4\tools\pdb2mdb.exe&quot; &quot;$(TargetPath)&quot;" />
<Exec Command="&quot;$(PkgMono_Unofficial_pdb2mdb)\tools\pdb2mdb.exe&quot; &quot;$(TargetPath)&quot;" />
</Target>

<Target Name="GlassDirCopy" Condition="'@(GlassDirCopy)' != ''" AfterTargets="Build">
Expand Down Expand Up @@ -88,4 +93,18 @@
<MakeDir Condition="!Exists('$(SourceLinkDir)')" Directories="$(SourceLinkDir)"/>
<WriteLinesToFile File="$(SourceLink)" Lines="$(JsonString)" Overwrite="true"/>
</Target>

<!-- ResolveProjectReferences allows us to generate the dll from il before adding them as a reference -->
<Target Name="GenerateAssemblies"
Condition="'@(GenerateAssembly)' != ''"
Inputs="@(GenerateAssembly)"
Outputs="@(GenerateAssembly->'$(GeneratedAssembliesDir)%(FileName).dll')"
BeforeTargets="ResolveProjectReferences">
<PropertyGroup>
<IlAsmCommand>"$(windir)\Microsoft.NET\Framework\v4.0.30319\ilasm.exe"</IlAsmCommand>
<IlAsmFlags>$(IlAsmFlags) /DLL /quiet</IlAsmFlags>
</PropertyGroup>
<MakeDir Condition="!Exists('$(GeneratedAssembliesDir)')" Directories="$(GeneratedAssembliesDir)" />
<Exec Command="$(IlAsmCommand) $(IlAsmFlags) /out=&quot;$(GeneratedAssembliesDir)%(FileName).dll&quot; @(GenerateAssembly->'&quot;%(Identity)&quot;')" />
</Target>
</Project>
Loading