-
Notifications
You must be signed in to change notification settings - Fork 218
Build managed projects and tests with csproj's #2259
Conversation
I pushed a couple of commits which should fix some Linux problems. I'm going to need some help understanding the remaining test issues -- they don't make a lot of sense to me. |
<Reference Include="Microsoft.CSharp" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' "> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -24,7 +24,7 @@ | |||
<Output ItemName="buildCmdArgs" TaskParameter="BuildArgs" /> | |||
</GetBuildArgsByFrameworks> | |||
|
|||
<Exec Command="$(DotnetToolCommand) build $(Args) %(buildCmdArgs.Identity)" | |||
<Exec Command="$(DotnetSdkToolCommand) build $(Args) %(buildCmdArgs.Identity)" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -160,18 +160,19 @@ | |||
|
|||
<Target Name="GenerateNugetPackages" DependsOnTargets="InitPackage"> | |||
<ItemGroup> | |||
<PackageProjects Include="$(ProjectDir)src\managed\Microsoft.DotNet.PlatformAbstractions\project.json" /> | |||
<PackageProjects Include="$(ProjectDir)src\managed\Microsoft.Extensions.DependencyModel\project.json" /> | |||
<PackageProjects Condition="'$(OS)' == 'Windows'" Include="$(ProjectDir)src\managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<RuntimeFrameworkVersion>$(MNAVersion)</RuntimeFrameworkVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' "> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
string baseArtifactsFolder = artifacts ?? Path.Combine(_repoRoot, "Bin"); | ||
|
||
_targetRID = Environment.GetEnvironmentVariable("TEST_TARGETRID"); | ||
_buildRID = Environment.GetEnvironmentVariable("BUILDRID"); | ||
_mnaVersion = Environment.GetEnvironmentVariable("MNA_VERSION"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
if ( ! _testProject.IsRestored()) | ||
{ | ||
RestoreProject(fallbackSources); | ||
string extraMSBuildProperties = $"/p:RuntimeIdentifiers={rid} /p:RuntimeIdentifier={rid}"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
EnvironmentVariables="NUGET_PACKAGES=$(PackagesDir);TEST_ARTIFACTS=$(SystemPathTestsOutputDir);TEST_TARGETRID=$(TestTargetRid);BUILDRID=$(TargetRid)" | ||
<Exec Command="$(DotnetTestToolCommand) test $(TestArgs) --logger "trx;LogFileName=$(TestResultsXml)"" | ||
WorkingDirectory="$(TestWorkingDirectory)" | ||
EnvironmentVariables="NUGET_PACKAGES=$(PackagesDir);TEST_ARTIFACTS=$(SystemPathTestsOutputDir);TEST_TARGETRID=$(TestTargetRid);BUILDRID=$(TargetRid);MNA_VERSION=$(ProductVersion)" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
With the two latest commits, I have a clean build on my Ubuntu machine. Hopefully we will see some green in CI now. |
@@ -50,6 +50,12 @@ public void Running_Build_Output_Standalone_EXE_with_DepsJson_and_RuntimeConfig_ | |||
|
|||
var appExe = fixture.TestProject.AppExe; | |||
|
|||
// TODO: Use FS.Chmod when build utility project is converted to csproj. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -17,7 +17,8 @@ public class PackageResolverTest | |||
{ | |||
private static string PackagesPath = Path.Combine("package", "directory", "location"); | |||
|
|||
[Fact] | |||
// This test does not work on .NET Core 2.0. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -31,21 +32,20 @@ public override bool Execute() | |||
List<string> args = new List<string>(); | |||
foreach (var projectJsonPath in ProjectJsonPaths) | |||
{ | |||
using (TextReader projectFileReader = File.OpenText(projectJsonPath.ItemSpec)) | |||
string dir = Path.GetDirectoryName(projectJsonPath.ItemSpec); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I think we will need to modify the netci.groovy script, because we are not producing xunit test results anymore. Rather, we are producing "TRX" logs. EDIT: I've made that change, but the CI jobs will still all show failures because of this. |
I"m good with merging this if you have confirmed it works and follow-up after your netci changes are in to ensure everything is green. |
The only thing I need to fix is the x86 run. I think I understand why it failed, though. |
<VersionPrefix>2.0.0</VersionPrefix> | ||
<TargetFrameworks>net451;netstandard1.3;netstandard1.6</TargetFrameworks> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<AssemblyName>Microsoft.Extensions.DependencyModel</AssemblyName> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<PackageId>Microsoft.Extensions.DependencyModel</PackageId> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>git://github.com/dotnet/core-setup</RepositoryUrl> | ||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.6' ">$(PackageTargetFallback);portable-net45+wp80+win8+wpa81+dnxcore50</PackageTargetFallback> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' "> | ||
<Reference Include="System" /> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/pkg/packaging/dir.proj
Outdated
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<BuildBasePathArg>--build-base-path $(IntermediateOutputForPackaging)</BuildBasePathArg> | ||
<BuildBasePathArg></BuildBasePathArg> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<AssemblyName>LightupClient</AssemblyName> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
restoreArgs.Add(fallbackSource); | ||
} | ||
restoreArgs.Add("--disable-parallel"); | ||
|
||
restoreArgs.Add($"/p:MNAVersion={_repoDirectoriesProvider.MicrosoftNETCoreAppVersion}"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
if ( ! _testProject.IsRestored()) | ||
{ | ||
RestoreProject(fallbackSources); | ||
string extraMSBuildProperties = $"/p:TestTargetRid={rid}"; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<AssemblyName>PortableTestApp</AssemblyName> | ||
<PackageId>PortableTestApp</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<AssemblyName>StandaloneApp</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>StandaloneApp</PackageId> | ||
<RuntimeIdentifiers>$(TestTargetRid)</RuntimeIdentifiers> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<PackageId>StandaloneTestApp</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback> | ||
<RuntimeIdentifiers>$(TestTargetRid)</RuntimeIdentifiers> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -1 +1 @@ | |||
1.0.0-preview3-003886 | |||
2.0.0-preview1-005899 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -96,7 +96,7 @@ private void ComputeSharedFxPaths() | |||
GreatestVersionSharedFxPath = sharedFxVersionDirectories | |||
.OrderByDescending(p => p.ToLower()) | |||
.First(); | |||
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
// TODO: Use FS.Chmod when build utility project is converted to csproj. | ||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
{ | ||
Command.Create("chmod", "+x", appExe).Execute().EnsureSuccessful(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
<AssemblyName>HostActivationTests</AssemblyName> | ||
<PackageId>HostActivationTests</PackageId> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
<ProjectReference Include="..\..\managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj" /> | ||
<ProjectReference Include="..\..\managed\Microsoft.Extensions.DependencyModel\Microsoft.Extensions.DependencyModel.csproj" /> | ||
|
||
<!-- TODO: Should this dependency be removed? --> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/test/TestUtils/TestProject.cs
Outdated
@@ -50,8 +50,8 @@ public class TestProject | |||
_sharedLibraryExtension = sharedLibraryExtension; | |||
_sharedLibraryPrefix = sharedLibraryPrefix; | |||
_projectName = Path.GetFileName(_projectDirectory); | |||
_projectJson = Path.Combine(_projectDirectory, "project.json"); | |||
_projectLockJson = Path.Combine(_projectDirectory, "project.lock.json"); | |||
_projectJson = Path.Combine(_projectDirectory, $"{_projectName}.csproj"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp1.0</TargetFramework> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
netci.groovy
Outdated
@@ -84,7 +84,7 @@ platformList.each { platform -> | |||
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") | |||
|
|||
if (!(os == 'Windows_NT' && architecture == 'arm')) { | |||
Utilities.addXUnitDotNETResults(newJob, '**/*-testResults.xml') | |||
Utilities.addMSTestResults(newJob, '**/*-testResults.xml') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
Console.WriteLine("OSGroup: " + OSGroup); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -31,21 +32,20 @@ public override bool Execute() | |||
List<string> args = new List<string>(); | |||
foreach (var projectJsonPath in ProjectJsonPaths) | |||
{ | |||
using (TextReader projectFileReader = File.OpenText(projectJsonPath.ItemSpec)) | |||
string dir = Path.GetDirectoryName(projectJsonPath.ItemSpec); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
args.Add($"--framework {framework.Name} {dir}"); | ||
args.Add($"--framework {framework} {projectJsonPath}"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@dotnet-bot Test Windows_NT x64 Release Build |
I think this is at an okay state to go in now. All of the CI "failures" are because of the mismatched test results files, and shouldn't show up after the update to netci.groovy gets consumed. |
GetBuildArgsByFrameworks
so it understands how to read and parse csproj files instead of project.json files.DotnetSdkToolCommand
instead ofDotnetToolCommand
).@eerhardt @weshaggard