Skip to content

Commit 6460f62

Browse files
michaelgsharpharishsk
authored andcommitted
The -test command for windows. Nuget packages (#5464)
* working on testing * testing updates * tests almost working * build changes * all tests should be working * changes from PR comments * fixes for .net 3.1 * Fixed extension check. Removed <PackageId> where not needed * Removed pkg folder and updated paths.
1 parent ca70e00 commit 6460f62

File tree

106 files changed

+591
-732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+591
-732
lines changed

Directory.Build.props

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313

1414
<PropertyGroup>
1515
<Copyright>$(CopyrightNetFoundation)</Copyright>
16-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1716
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
18-
<DebugType>embedded</DebugType>
17+
<DebugType>portable</DebugType>
1918
<DebugSymbols>true</DebugSymbols>
2019
<LangVersion>latest</LangVersion>
2120
</PropertyGroup>
@@ -31,7 +30,7 @@
3130
</PropertyGroup>
3231

3332
<PropertyGroup>
34-
<PackageAssetsPath>$(ArtifactsDir)/pkgassets/</PackageAssetsPath>
33+
<PackageAssetsPath>$(ArtifactsDir)pkgassets/</PackageAssetsPath>
3534
<PkgDir>$(RepoRoot)pkg/</PkgDir>
3635
</PropertyGroup>
3736

@@ -49,17 +48,17 @@
4948
<PropertyGroup>
5049
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
5150
<PublishRepositoryUrl>true</PublishRepositoryUrl>
52-
51+
5352
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
5453
<EmbedUntrackedSources>true</EmbedUntrackedSources>
55-
54+
5655
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
5756
<IncludeSymbols>true</IncludeSymbols>
5857
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
5958
</PropertyGroup>
60-
59+
6160
<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true'">
62-
<!--
61+
<!--
6362
When building using source-build the process is:
6463
- Newtonsoft.Json versions 9.0.1 and 12.0.2 are built by source-build
6564
- Version 12.0.2 is written to Version.props

Directory.Build.targets

+35
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
4+
5+
<Target Name="CopyNativeAssembiles" AfterTargets="CopyFilesToOutputDirectory">
6+
<PropertyGroup>
7+
<LibPrefix Condition="'$(OS)' != 'Windows_NT'">lib</LibPrefix>
8+
<LibExtension Condition="'$(OS)' == 'Windows_NT'">.dll</LibExtension>
9+
<LibExtension Condition="'$(OS)' != 'Windows_NT'">.so</LibExtension>
10+
<LibExtension Condition="$([MSBuild]::IsOSPlatform('osx'))">.dylib</LibExtension>
11+
12+
<TargetArchitecture Condition="'$(Platform)' == ''">x64</TargetArchitecture>
13+
<NativeTargetArchitecture Condition="'$(NativeTargetArchitecture)' == ''">$(TargetArchitecture)</NativeTargetArchitecture>
14+
<BinDir Condition="'$(BinDir)'==''">$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin'))</BinDir>
15+
<NativeOutputPath>$(BinDir)Native\$(NativeTargetArchitecture).$(Configuration)\</NativeOutputPath>
16+
17+
<Platform Condition="'$(Platform)'==''">AnyCPU</Platform>
18+
<PlatformConfig>$(Platform).$(Configuration)</PlatformConfig>
19+
<OutputPath Condition="'$(OutputPath)'==''">$(BinDir)$(MSBuildProjectName)\Debug</OutputPath>
20+
</PropertyGroup>
21+
22+
<ItemGroup>
23+
<NativeAssemblyReference>
24+
<FullAssemblyPath>$(NativeOutputPath)$(LibPrefix)%(NativeAssemblyReference.Identity)$(LibExtension)</FullAssemblyPath>
25+
</NativeAssemblyReference>
26+
</ItemGroup>
27+
28+
<Copy SourceFiles = "@(NativeAssemblyReference->'%(FullAssemblyPath)')"
29+
DestinationFolder="$(OutDir)"
30+
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
31+
Retries="$(CopyRetryCount)"
32+
RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
33+
UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
34+
UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
35+
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
36+
</Copy>
37+
</Target>
38+
439
</Project>

Microsoft.ML.sln

+84-44
Large diffs are not rendered by default.

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
1010
done
1111
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
1212

13-
"$DIR/eng/common/build.sh" --restore --build --pack --warnAsError false
13+
"$DIR/eng/common/build.sh" --restore --build --pack --warnAsError false "$@"

docs/samples/Microsoft.ML.AutoML.Samples/Microsoft.ML.AutoML.Samples.csproj

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77

88
<ItemGroup>
99
<ProjectReference Include="..\..\..\src\Microsoft.ML.AutoML\Microsoft.ML.AutoML.csproj" />
10+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Core\Microsoft.ML.Core.csproj" >
11+
<PrivateAssets>all</PrivateAssets>
12+
</ProjectReference>
13+
14+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Transforms\Microsoft.ML.Transforms.csproj" >
15+
<PrivateAssets>all</PrivateAssets>
16+
</ProjectReference>
17+
1018
<NativeAssemblyReference Include="MatrixFactorizationNative" />
1119
<NativeAssemblyReference Include="FastTreeNative" />
1220
</ItemGroup>

docs/samples/Microsoft.ML.Samples.GPU/Microsoft.ML.Samples.GPU.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020

2121
<ItemGroup>
2222
<ProjectReference Include="..\..\..\src\Microsoft.ML.Vision\Microsoft.ML.Vision.csproj" />
23+
<ProjectReference Include="..\..\..\src\Microsoft.ML.ImageAnalytics\Microsoft.ML.ImageAnalytics.csproj" />
24+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
2325
<ProjectReference Include="..\..\..\src\Microsoft.ML.LightGbm\Microsoft.ML.LightGbm.csproj" />
2426
<ProjectReference Include="..\..\..\src\Microsoft.ML.TensorFlow\Microsoft.ML.TensorFlow.csproj" />
2527
<ProjectReference Include="..\..\..\src\Microsoft.ML.SamplesUtils\Microsoft.ML.SamplesUtils.csproj" />
28+
<ProjectReference Include="..\..\..\src\Microsoft.ML.StandardTrainers\Microsoft.ML.StandardTrainers.csproj" />
29+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Transforms\Microsoft.ML.Transforms.csproj" />
2630

2731
<NativeAssemblyReference Include="CpuMathNative" />
2832
<NativeAssemblyReference Include="FastTreeNative" />

docs/samples/Microsoft.ML.Samples/Microsoft.ML.Samples.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<ProjectReference Include="..\..\..\src\Microsoft.ML.DnnImageFeaturizer.ResNet18\Microsoft.ML.DnnImageFeaturizer.ResNet18.csproj" />
3131
<ProjectReference Include="..\..\..\src\Microsoft.ML.Transforms\Microsoft.ML.Transforms.csproj" />
3232
<ProjectReference Include="..\..\..\src\Microsoft.ML.OnnxConverter\Microsoft.ML.OnnxConverter.csproj" />
33+
<ProjectReference Include="..\..\..\src\Microsoft.ML.ImageAnalytics\Microsoft.ML.ImageAnalytics.csproj" />
34+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Core\Microsoft.ML.Core.csproj" />
35+
<ProjectReference Include="..\..\..\src\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
3336

3437
<NativeAssemblyReference Include="CpuMathNative" />
3538
<NativeAssemblyReference Include="FastTreeNative" />

eng/Build.props

+9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3+
4+
<ItemDefinitionGroup>
5+
<ProjectToBuild>
6+
<RestoreInParallel>true</RestoreInParallel>
7+
<BuildInParallel>false</BuildInParallel>
8+
</ProjectToBuild>
9+
</ItemDefinitionGroup>
10+
311
<ItemGroup>
412
<ProjectToBuild Include="$(RepoRoot)src/Redist/Microsoft.ML.DnnImageFeaturizer.ModelRedist/Microsoft.ML.DnnImageFeaturizer.ModelRedist.proj" />
513
<ProjectToBuild Include="$(RepoRoot)src/Native/Native.proj" />
614
<ProjectToBuild Include="$(RepoRoot)Microsoft.ML.sln" />
715
</ItemGroup>
16+
817
</Project>

eng/Versions.props

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<Project>
33
<PropertyGroup>
44
<!-- This repo version -->
5-
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
5+
<DotNetUseShippingVersions>false</DotNetUseShippingVersions>
66
<VersionPrefix>1.5.3</VersionPrefix>
7-
<PreReleaseVersionLabel></PreReleaseVersionLabel>
7+
<PreReleaseVersionLabel>dev</PreReleaseVersionLabel>
88

99
<!--ML.NET Core dependencies-->
1010
<NewtonsoftJsonPackageVersion>10.0.3</NewtonsoftJsonPackageVersion>
@@ -37,7 +37,7 @@
3737
<ReportGeneratorVersion>4.3.6</ReportGeneratorVersion>
3838
<MicrosoftDotNetApiCompatPackageVersion>1.0.0-beta.19225.5</MicrosoftDotNetApiCompatPackageVersion>
3939
<MicrosoftSourceLinkVersion>1.1.0-beta-20206-02</MicrosoftSourceLinkVersion>
40-
40+
4141
<!-- Test-only Dependencies -->
4242
<BenchmarkDotNetVersion>0.12.0</BenchmarkDotNetVersion>
4343
<MicrosoftCodeAnalysisTestingVersion>1.0.1-beta1.20080.1</MicrosoftCodeAnalysisTestingVersion>
@@ -77,6 +77,7 @@
7777
<MicrosoftExtensionsDependencyModelVersion>2.1.0</MicrosoftExtensionsDependencyModelVersion>
7878
<MicrosoftExtensionsFileSystemGlobbingVersion>2.0.0</MicrosoftExtensionsFileSystemGlobbingVersion>
7979
<MicrosoftNETCorePlatformsVersion>2.1.0</MicrosoftNETCorePlatformsVersion>
80+
<MicrosoftNETCore3PlatformsVersion>3.1.0</MicrosoftNETCore3PlatformsVersion>
8081
<MicrosoftNetCompilersToolsetVersion>3.8.0-3.20460.2</MicrosoftNetCompilersToolsetVersion>
8182
<MoqVersion>4.8.3</MoqVersion>
8283
<MonoOptionsVersion>5.3.0.1</MonoOptionsVersion>
@@ -103,9 +104,9 @@
103104
<SystemThreadingTasksExtensionVersion>4.5.2</SystemThreadingTasksExtensionVersion>
104105
<SystemValueTupleVersion>4.4.0</SystemValueTupleVersion>
105106
<WindowsAzureStorageVersion>8.5.0</WindowsAzureStorageVersion>
106-
<XUnitVersion>2.4.1</XUnitVersion>
107+
<XUnitVersion>2.4.0</XUnitVersion>
107108
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
108-
<XUnitVSRunnerVersion>2.4.1</XUnitVSRunnerVersion>
109+
<XUnitVSRunnerVersion>2.4.0</XUnitVSRunnerVersion>
109110
<MicrosoftDotNetBuildTasksFeedVersion>5.0.0-beta.20461.7</MicrosoftDotNetBuildTasksFeedVersion>
110111
<MicrosoftDotNetSignToolVersion>5.0.0-beta.20461.7</MicrosoftDotNetSignToolVersion>
111112
<MicrosoftAzureDocumentDBVersion>1.22.0</MicrosoftAzureDocumentDBVersion>
File renamed without changes.

eng/pkg/Pack.props

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<PackageAssetsPath>$(ArtifactsDir)pkgassets/</PackageAssetsPath>
5+
<IncludeSymbols>true</IncludeSymbols>
6+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
7+
<IsSymbolsPackage Condition="$(MSBuildProjectName.Contains('.snupkg'))">true</IsSymbolsPackage>
8+
<PackageIdFolderName>$(MSBuildProjectName.Replace('.symbols', ''))</PackageIdFolderName>
9+
<IncludeBuildOutput>true</IncludeBuildOutput>
10+
<IsPackable>true</IsPackable>
11+
12+
</PropertyGroup>
13+
14+
<!-- nuspec properties -->
15+
<PropertyGroup>
16+
<Authors>Microsoft</Authors>
17+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
18+
<PackageProjectUrl>https://dot.net/ml</PackageProjectUrl>
19+
<PackageIcon>mlnetlogo.png</PackageIcon>
20+
<PackageReleaseNotes>https://aka.ms/mlnetreleasenotes</PackageReleaseNotes>
21+
<!-- space separated -->
22+
<PackageTags>ML.NET ML Machine Learning</PackageTags>
23+
24+
<LibExtension Condition="'$(OS)' == 'Windows_NT'">.dll</LibExtension>
25+
<LibExtension Condition="'$(OS)' != 'Windows_NT'">.so</LibExtension>
26+
<LibExtension Condition="$([MSBuild]::IsOSPlatform('osx'))">.dylib</LibExtension>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
31+
<!-- Create symbol packages correctly by copying the library and xml to the nuget. Then the pdb is auto put in the symbols package-->
32+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\lib\**\*" PackagePath="lib" />
33+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\analyzers\**\*" PackagePath="analyzers" />
34+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\runtimes\**\*" PackagePath="runtimes" />
35+
<Content Include="$(PackageAssetsPath)$(PackageIdFolderName)\tools\**\*" PackagePath="tools" />
36+
37+
<Content Include="$(RepoRoot)eng\pkg\mlnetlogo.png" Pack="true" PackagePath="" />
38+
</ItemGroup>
39+
40+
<ItemGroup Condition="'$(IncludeMLNetNotices)' != 'false'">
41+
<Content Include="$(RepoRoot)\THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="" />
42+
<Content Include="$(RepoRoot)\LICENSE" Pack="true" PackagePath=""/>
43+
</ItemGroup>
44+
45+
<!-- This check does not work corectly anymore and also removes the PDB from the symbols packages.
46+
Need to figure out the correct way to do this, but since the normal packages are building correctly
47+
I am leaving this as is for now. -->
48+
<ItemGroup Condition="'$(IsSymbolsPackage)' != 'true'">
49+
<Content Remove="$(PackageAssetsPath)$(PackageIdFolderName)\**\*.pdb" />
50+
<Content Remove="$(PackageAssetsPath)$(PackageIdFolderName)\**\*.dwarf" />
51+
<Content Remove="$(PackageAssetsPath)$(PackageIdFolderName)\**\*.dbg" />
52+
</ItemGroup>
53+
54+
<ItemGroup Condition="Exists('packages.config') OR
55+
Exists('$(MSBuildProjectName).packages.config') OR
56+
Exists('packages.$(MSBuildProjectName).config')">
57+
<Content Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x64\native\*.dll"
58+
Condition="'$(PlatformTarget)' == 'x64'">
59+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60+
<Visible>false</Visible>
61+
<Link>%(Filename)%(Extension)</Link>
62+
</Content>
63+
<Content Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x86\native\*.dll"
64+
Condition="'$(PlatformTarget)' == 'x86'">
65+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
66+
<Visible>false</Visible>
67+
<Link>%(Filename)%(Extension)</Link>
68+
</Content>
69+
</ItemGroup>
70+
71+
<!-- Work around https://github.com/NuGet/Home/issues/6091 -->
72+
<ItemDefinitionGroup>
73+
<PackageReference>
74+
<PrivateAssets>None</PrivateAssets>
75+
</PackageReference>
76+
</ItemDefinitionGroup>
77+
78+
</Project>

pkg/_._ renamed to eng/pkg/_._

File renamed without changes.
File renamed without changes.

global.json

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"tools": {
3-
"dotnet": "5.0.100-rc.1.20452.10"
4-
},
5-
"msbuild-sdks": {
6-
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20461.7",
7-
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20461.7",
8-
"Microsoft.Build.Traversal": "2.1.1",
9-
"Microsoft.SourceLink.GitHub": "1.1.0-beta-20206-02",
10-
"Microsoft.SourceLink.Common": "1.1.0-beta-20206-02"
2+
"tools": {
3+
"dotnet": "5.0.100-rc.1.20452.10",
4+
"runtimes": {
5+
"dotnet/x64": ["$(MicrosoftNETCorePlatformsVersion)", "$(MicrosoftNETCore3PlatformsVersion)" ]
6+
}
7+
},
8+
"msbuild-sdks": {
9+
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20461.7",
10+
"Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20461.7",
11+
"Microsoft.Build.Traversal": "2.1.1",
12+
"Microsoft.SourceLink.GitHub": "1.1.0-beta-20206-02",
13+
"Microsoft.SourceLink.Common": "1.1.0-beta-20206-02"
14+
}
1115
}
12-
}

pkg/Directory.Build.props

-59
This file was deleted.

pkg/Microsoft.Extensions.ML/Microsoft.Extensions.ML.nupkgproj

-16
This file was deleted.

pkg/Microsoft.Extensions.ML/Microsoft.Extensions.ML.symbols.nupkgproj

-5
This file was deleted.

pkg/Microsoft.ML.AutoML/Microsoft.ML.AutoML.nupkgproj

-17
This file was deleted.

pkg/Microsoft.ML.AutoML/Microsoft.ML.AutoML.symbols.nupkgproj

-3
This file was deleted.

0 commit comments

Comments
 (0)