Коммит
262a3b3c22
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"cake.tool": {
|
||||
"version": "1.0.0",
|
||||
"commands": [
|
||||
"dotnet-cake"
|
||||
]
|
||||
},
|
||||
"microsoft.dotnet.xharness.cli": {
|
||||
"version": "1.0.0-prerelease.21165.2",
|
||||
"commands": [
|
||||
"xharness"
|
||||
]
|
||||
},
|
||||
"powershell": {
|
||||
"version": "7.1.2",
|
||||
"commands": [
|
||||
"pwsh"
|
||||
]
|
||||
},
|
||||
"dotnet-vs": {
|
||||
"version": "1.0.0",
|
||||
"commands": [
|
||||
"vs"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -350,3 +350,4 @@ MigrationBackup/
|
|||
.ionide/
|
||||
.DS_Store
|
||||
.idea
|
||||
tools
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<Project>
|
||||
<Import Project="eng\Version.props" />
|
||||
<Import Project="eng\Versions.props" />
|
||||
<PropertyGroup>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
|
@ -7,6 +7,14 @@
|
|||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<ProduceReferenceAssembly Condition="'$(UsingMicrosoftNETSdk)' == 'True' AND '$(Configuration)' == 'Debug'">True</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DotNetOutputPath>$(MSBuildThisFileDirectory)bin/</DotNetOutputPath>
|
||||
<DotNetTempDirectory>$(DotNetOutputPath)temp/</DotNetTempDirectory>
|
||||
<DotNetDirectory>$(DotNetOutputPath)dotnet/</DotNetDirectory>
|
||||
<DotNetToolPath>$(DotNetDirectory)dotnet</DotNetToolPath>
|
||||
<DotNetPacksDirectory>$(DotNetDirectory)packs/</DotNetPacksDirectory>
|
||||
<DotNetSdkManifestsDirectory>$(DotNetDirectory)sdk-manifests/$(DotNetPreviewVersionBand)/</DotNetSdkManifestsDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GitDefaultBranch>main</GitDefaultBranch>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,4 +1,21 @@
|
|||
<Project>
|
||||
<Import Project="eng\Git.Build.targets" />
|
||||
<Import Project="eng\Version.targets" />
|
||||
<!-- Temporarily disable the linker for net6.0-ios and net6.0-maccatalyst until we get machine pools with Big Sur and Xcode 12.5 is stable -->
|
||||
<PropertyGroup>
|
||||
<PublishTrimmed Condition=" '$(TargetFramework)' == 'net6.0-ios' or '$(TargetFramework)' == 'net6.0-maccatalyst' ">false</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="Net6WinUIPackagingWorkaround" BeforeTargets="GetPackagingOutputs" Condition="$(TargetFramework.Contains('-windows')) == true AND '$(DisableEmbeddedXbf)' != 'true' ">
|
||||
<PropertyGroup>
|
||||
<TargetPlatformIdentifierAdjusted>UAP</TargetPlatformIdentifierAdjusted>
|
||||
<_SupportEmbedFileResources>true</_SupportEmbedFileResources>
|
||||
<_EmbedFileResfilePath>$(IntermediateOutputPath)$(AppxSubfolderWithFilesToBeEmbedded)\embed.resfiles</_EmbedFileResfilePath>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="Net6WinUIWorkaround" BeforeTargets="_GetSdkToolsPathsFromSdk" Condition="$(TargetFramework.Contains('-windows')) == true ">
|
||||
<PropertyGroup>
|
||||
<TargetPlatformIdentifierAdjusted>UAP</TargetPlatformIdentifierAdjusted>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -13,7 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{5F
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Graphics-net6", "src\Microsoft.Maui.Graphics\Microsoft.Maui.Graphics-net6.csproj", "{E66999B3-9585-4EF3-A45C-97A2101AD612}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Maui.Graphics.Text.Markdig-net6", "src\Microsoft.Maui.Graphics.Text.Markdig\Microsoft.Maui.Graphics.Text.Markdig-net6.csproj", "{B364BA53-2BA8-4844-8BD2-CF257A3C21F1}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Graphics.Text.Markdig-net6", "src\Microsoft.Maui.Graphics.Text.Markdig\Microsoft.Maui.Graphics.Text.Markdig-net6.csproj", "{B364BA53-2BA8-4844-8BD2-CF257A3C21F1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Graphics.Win2D.WinUI.Desktop-net6", "src\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop-net6.csproj", "{B2776881-0ED3-45B4-92DF-EF90810A2507}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -29,6 +31,10 @@ Global
|
|||
{B364BA53-2BA8-4844-8BD2-CF257A3C21F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B364BA53-2BA8-4844-8BD2-CF257A3C21F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B364BA53-2BA8-4844-8BD2-CF257A3C21F1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B2776881-0ED3-45B4-92DF-EF90810A2507}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B2776881-0ED3-45B4-92DF-EF90810A2507}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B2776881-0ED3-45B4-92DF-EF90810A2507}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B2776881-0ED3-45B4-92DF-EF90810A2507}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -36,6 +42,7 @@ Global
|
|||
GlobalSection(NestedProjects) = preSolution
|
||||
{E66999B3-9585-4EF3-A45C-97A2101AD612} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
{B364BA53-2BA8-4844-8BD2-CF257A3C21F1} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
{B2776881-0ED3-45B4-92DF-EF90810A2507} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0B07E734-6AE2-4A12-AD60-C072F3695854}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
variables:
|
||||
- name: BuildVersion
|
||||
value: $[counter('release-counter', 1)]
|
||||
BuildVersion: $[counter('release-counter', 1)]
|
||||
IsRunningOnCI: true
|
||||
DotNetVersion: 6.0.100-preview.4.21255.9
|
||||
DotNet.Cli.Telemetry.OptOut: true
|
||||
MauiCheck.Version: 0.4.1
|
||||
MauiCheck.Manifest: https://raw.githubusercontent.com/Redth/dotnet-maui-check/main/manifests/maui-dev.manifest.json
|
||||
|
||||
parameters:
|
||||
- name: BuildEverything
|
||||
|
@ -72,52 +76,30 @@ stages:
|
|||
pool:
|
||||
vmImage: windows-latest
|
||||
steps:
|
||||
- task: NuGetToolInstaller@1
|
||||
displayName: 'Use NuGet 5.9.1'
|
||||
inputs:
|
||||
versionSpec: 5.9.1
|
||||
# - powershell: |
|
||||
# $ProgressPreference = 'SilentlyContinue'
|
||||
# Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
|
||||
# & .\dotnet-install.ps1 -Version $(DotNetVersion) -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
|
||||
# & dotnet --list-sdks
|
||||
# displayName: install .NET $(DotNetVersion)
|
||||
# errorActionPreference: stop
|
||||
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: 'Install NET6'
|
||||
inputs:
|
||||
command: 'build'
|
||||
projects: src\external\DotNet\DotNet.csproj
|
||||
# - powershell: |
|
||||
# & dotnet tool update --global redth.net.maui.check --version $(MauiCheck.Version) --add-source https://api.nuget.org/v3/index.json
|
||||
# & maui-check --ci --non-interactive --fix --skip androidsdk --skip xcode --skip vswin --skip vsmac --manifest $(MauiCheck.Manifest)
|
||||
# displayName: maui-check
|
||||
# errorActionPreference: stop
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Restore sln'
|
||||
inputs:
|
||||
command: 'restore'
|
||||
restoreSolution: build\Build.Microsoft.Maui.Graphics.Windows.sln
|
||||
- script: dotnet tool restore
|
||||
displayName: install dotnet tools
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build Graphics with MSBUILD'
|
||||
inputs:
|
||||
solution: build\Build.Microsoft.Maui.Graphics.Windows.sln
|
||||
configuration: ${{ BuildCondition }}
|
||||
msbuildArguments: /verbosity:normal /t:Build
|
||||
- script: dotnet vs install enterprise preview +mobile --quiet
|
||||
displayName: install vs preview
|
||||
|
||||
- script: src\bin\dotnet\dotnet build build\Build.Microsoft.Maui.Graphics-net6.sln -p:Configuration=${{ BuildCondition }}
|
||||
displayName: 'Build Graphics with NET6'
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: 'Pack nupkg'
|
||||
inputs:
|
||||
command: 'pack'
|
||||
packagesToPack: 'build/Microsoft.Maui.Graphics.nuspec'
|
||||
packDestination: '$(Build.ArtifactStagingDirectory)/${{ BuildCondition }}'
|
||||
configuration: ${{ BuildCondition }}
|
||||
basePath: '$(System.DefaultWorkingDirectory)'
|
||||
versioningScheme : 'byEnvVar'
|
||||
versionEnvVar: 'BUILD_BUILDNUMBER'
|
||||
|
||||
- script: dotnet cake --configuration=${{ BuildCondition }}
|
||||
displayName: pack nugets
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Pack Win2D.WinUI'
|
||||
inputs:
|
||||
solution: src\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.csproj
|
||||
configuration: ${{ BuildCondition }}
|
||||
msbuildArguments: /verbosity:normal /t:Pack -p:PackageOutputPath=$(Build.ArtifactStagingDirectory)/${{ BuildCondition }}
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy SignList.xml Files'
|
||||
inputs:
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
// examples
|
||||
/*
|
||||
|
||||
Windows CMD:
|
||||
build.cmd -Target dotnet-pack
|
||||
build.cmd -Target dotnet-pack -ScriptArgs '--packageVersion="9.9.9-custom"','--configuration="Release"'
|
||||
|
||||
PowerShell:
|
||||
./build.ps1 -Target dotnet-pack
|
||||
./build.ps1 -Target dotnet-pack -ScriptArgs '--packageVersion="9.9.9-custom"'
|
||||
|
||||
*/
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// ADDINS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// #addin "nuget:?package=Cake.Android.SdkManager&version=3.0.2"
|
||||
// #addin "nuget:?package=Cake.Boots&version=1.0.4.600-preview1"
|
||||
// #addin "nuget:?package=Cake.AppleSimulator&version=0.2.0"
|
||||
// #addin "nuget:?package=Cake.FileHelpers&version=3.2.1"
|
||||
#load "eng/cake/dotnet.cake"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TOOLS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
#tool nuget:?package=NUnit.ConsoleRunner&version=3.11.1
|
||||
#tool "nuget:?package=nuget.commandline&version=5.8.1"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// ARGUMENTS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
string agentName = EnvironmentVariable("AGENT_NAME", "");
|
||||
bool isCIBuild = !String.IsNullOrWhiteSpace(agentName);
|
||||
string artifactStagingDirectory = EnvironmentVariable("BUILD_ARTIFACTSTAGINGDIRECTORY", ".");
|
||||
string workingDirectory = EnvironmentVariable("SYSTEM_DEFAULTWORKINGDIRECTORY", ".");
|
||||
string envProgramFiles = EnvironmentVariable("ProgramFiles(x86)");
|
||||
var configuration = GetBuildVariable("BUILD_CONFIGURATION", GetBuildVariable("configuration", "DEBUG"));
|
||||
var msbuildPath = GetBuildVariable("msbuild", $"{envProgramFiles}\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe");
|
||||
bool isHostedAgent = agentName.StartsWith("Azure Pipelines") || agentName.StartsWith("Hosted Agent");
|
||||
|
||||
|
||||
var target = Argument("target", "Default");
|
||||
if(String.IsNullOrWhiteSpace(target))
|
||||
target = "Default";
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// TASK TARGETS
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
Task("Default").IsDependentOn("dotnet-pack");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// EXECUTION
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
RunTarget(target);
|
||||
|
||||
T GetBuildVariable<T>(string key, T defaultValue)
|
||||
{
|
||||
// on MAC all environment variables are upper case regardless of how you specify them in devops
|
||||
// And then Environment Variable check is case sensitive
|
||||
T upperCaseReturnValue = Argument(key.ToUpper(), EnvironmentVariable(key.ToUpper(), defaultValue));
|
||||
return Argument(key, EnvironmentVariable(key, upperCaseReturnValue));
|
||||
}
|
|
@ -12,44 +12,36 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8A2197EB-6E30-495D-9DE9-2E40032FB2E9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Maui.Graphics-net6", "..\src\Microsoft.Maui.Graphics\Microsoft.Maui.Graphics-net6.csproj", "{8E78C89F-7AE7-4342-BFFE-227873D89397}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Graphics-net6", "..\src\Microsoft.Maui.Graphics\Microsoft.Maui.Graphics-net6.csproj", "{8E78C89F-7AE7-4342-BFFE-227873D89397}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Maui.Graphics.Text.Markdig-net6", "..\src\Microsoft.Maui.Graphics.Text.Markdig\Microsoft.Maui.Graphics.Text.Markdig-net6.csproj", "{E450989E-DAE2-4646-9BD3-09F706589A74}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Maui.Graphics.Win2D.WinUI.Desktop-net6", "..\src\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop-net6.csproj", "{00145282-A205-4230-8AC8-161E59E5C00A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
..\src\Microsoft.Maui.Graphics.SharpDX.Shared\Microsoft.Maui.Graphics.SharpDX.Shared.projitems*{5163bcb2-4d70-42da-975a-af55d6b6a0b3}*SharedItemsImports = 13
|
||||
..\src\Microsoft.Maui.Graphics.SharpDX.Shared\Microsoft.Maui.Graphics.SharpDX.Shared.projitems*{694e970d-5c18-483f-bc48-d6d86da8e78f}*SharedItemsImports = 4
|
||||
..\src\Microsoft.Maui.Graphics.CoreGraphics\Microsoft.Maui.Graphics.CoreGraphics.projitems*{95a3e5f1-26b7-4bd8-8f01-48fe7bfd79fa}*SharedItemsImports = 13
|
||||
..\src\Microsoft.Maui.Graphics.SharpDX.Shared\Microsoft.Maui.Graphics.SharpDX.Shared.projitems*{bc291304-fdc0-4e1d-a673-39f5e446b0e0}*SharedItemsImports = 5
|
||||
..\src\Microsoft.Maui.Graphics.CoreGraphics\Microsoft.Maui.Graphics.CoreGraphics.projitems*{edf26ebb-0ac3-4212-81d6-8dd08f5acc17}*SharedItemsImports = 4
|
||||
..\src\Microsoft.Maui.Graphics.CoreGraphics\Microsoft.Maui.Graphics.CoreGraphics.projitems*{f8d43f64-af09-4e06-8473-5bdc37281908}*SharedItemsImports = 4
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{8E78C89F-7AE7-4342-BFFE-227873D89397} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
{E450989E-DAE2-4646-9BD3-09F706589A74} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
{00145282-A205-4230-8AC8-161E59E5C00A} = {9E4B772B-D417-4147-B8B1-FD9E3B0B4EC5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {0B07E734-6AE2-4A12-AD60-C072F3695854}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<Project>
|
||||
<Import Project="../../../eng/Versions.props" />
|
||||
</Project>
|
|
@ -0,0 +1,20 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.Windows" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.Darwin" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.iOS.Windows.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
|
||||
<PackageDownload Include="Microsoft.tvOS.Ref" Version="[$(MicrosofttvOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.tvOS.Sdk" Version="[$(MicrosofttvOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.macOS.Ref" Version="[$(MicrosoftmacOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.macOS.Sdk" Version="[$(MicrosoftmacOSSdkPackageVersion)]" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="Microsoft.NET.Sdk.Android.Manifest-$(DotNetPreviewVersionBand)" Version="[$(MicrosoftAndroidSdkWindowsPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Sdk.MacCatalyst.Manifest-$(DotNetPreviewVersionBand)" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Sdk.iOS.Manifest-$(DotNetPreviewVersionBand)" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Sdk.tvOS.Manifest-$(DotNetPreviewVersionBand)" Version="[$(MicrosofttvOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Sdk.macOS.Manifest-$(DotNetPreviewVersionBand)" Version="[$(MicrosoftmacOSSdkPackageVersion)]" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,174 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
|
||||
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.ps1</DotNetInstallScriptUrl>
|
||||
<DotNetInstallScriptName>dotnet-install.ps1</DotNetInstallScriptName>
|
||||
<DotNetInstallScriptPath>$(DotNetOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
|
||||
<DotNetInstallCommand>& '$(DotNetInstallScriptPath)' -Version $(MicrosoftDotnetSdkInternalPackageVersion) -InstallDir '$(DotNetDirectory)' -Verbose</DotNetInstallCommand>
|
||||
<DotNetInstallCommand>powershell -Command "$(DotNetInstallCommand)"</DotNetInstallCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('osx'))">
|
||||
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.sh</DotNetInstallScriptUrl>
|
||||
<DotNetInstallScriptName>dotnet-install.sh</DotNetInstallScriptName>
|
||||
<DotNetInstallScriptPath>$(DotNetOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
|
||||
<DotNetInstallCommand>sh '$(DotNetInstallScriptPath)' --version $(MicrosoftDotnetSdkInternalPackageVersion) --install-dir '$(DotNetDirectory)' --verbose</DotNetInstallCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<_ProvisionDependsOn>
|
||||
_DownloadDotNetInstallScript;
|
||||
_InstallDotNet;
|
||||
_AcquireWorkloads;
|
||||
_AcquirePacks;
|
||||
</_ProvisionDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="_Provision" BeforeTargets="Build" DependsOnTargets="$(_ProvisionDependsOn)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- These files should invalidate ./bin/dotnet completely -->
|
||||
<_Inputs>
|
||||
$(MSBuildThisFile);
|
||||
../../eng/Versions.props;
|
||||
</_Inputs>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_DownloadDotNetInstallScript"
|
||||
Inputs="$(_Inputs)"
|
||||
Outputs="$(DotNetInstallScriptPath)">
|
||||
<DownloadFile
|
||||
SourceUrl="$(DotNetInstallScriptUrl)"
|
||||
DestinationFolder="$(DotNetOutputPath)"
|
||||
DestinationFileName="$(DotNetInstallScriptName)"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="_InstallDotNet"
|
||||
Inputs="$(_Inputs)"
|
||||
Outputs="$(DotNetDirectory).stamp">
|
||||
<RemoveDir Directories="$(DotNetDirectory)" />
|
||||
<Exec Command="$(DotNetInstallCommand)" />
|
||||
<Touch Files="$(DotNetDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- These are past workload names -->
|
||||
<_PacksToRemove Include="Microsoft.NET.Workload.Android" />
|
||||
<_PacksToRemove Include="Microsoft.NET.Workload.MacCatalyst" />
|
||||
<_PacksToRemove Include="Microsoft.NET.Workload.iOS" />
|
||||
<_PacksToRemove Include="Microsoft.NET.Workload.tvOS" />
|
||||
<_PacksToRemove Include="Microsoft.NET.Workload.macOS" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_AcquireWorkloads"
|
||||
Inputs="$(_Inputs);Dependencies/Workloads.csproj"
|
||||
Outputs="$(DotNetSdkManifestsDirectory).stamp">
|
||||
<RemoveDir Directories="@(_PacksToRemove->'$(DotNetSdkManifestsDirectory)%(Identity)')" />
|
||||
<Exec
|
||||
Command=""$(DotNetToolPath)" restore "$(MSBuildThisFileDirectory)Dependencies/Workloads.csproj" -bl:$(PackageOutputPath)/DotNetWorkloads.binlog"
|
||||
EnvironmentVariables="NUGET_PACKAGES=$(DotNetTempDirectory);DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1"
|
||||
/>
|
||||
<!--
|
||||
NOTE: Workloads need to go in dotnet/sdk-manifests/6.0.100/Microsoft.NET.*/
|
||||
Workloads only contain two files: data/WorkloadManifest.targets & data/WorkloadManifest.json
|
||||
We downloaded these to $(DotNetTempDirectory), so we could move files individually.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<_WorkloadFiles Include="$(DotNetTempDirectory)Microsoft.NET.*/*/data/WorkloadManifest.*" />
|
||||
</ItemGroup>
|
||||
<CopyWorkloadFiles
|
||||
Files="@(_WorkloadFiles)"
|
||||
WorkloadDirectory="$(DotNetSdkManifestsDirectory)"
|
||||
VersionBand="$(DotNetPreviewVersionBand)"
|
||||
/>
|
||||
|
||||
<!-- In order to support older MSBuild versions, change the version string to an integer -->
|
||||
<ReplaceText
|
||||
Input="$(DotNetSdkManifestsDirectory)microsoft.net.sdk.android/WorkloadManifest.json"
|
||||
OldValue=""version": "$(MicrosoftAndroidSdkWindowsPackageVersion)""
|
||||
NewValue=""version": 6"
|
||||
/>
|
||||
<ReplaceText
|
||||
Input="$(DotNetSdkManifestsDirectory)microsoft.net.sdk.maccatalyst/WorkloadManifest.json"
|
||||
OldValue=""version": "$(MicrosoftMacCatalystSdkPackageVersion)""
|
||||
NewValue=""version": 6"
|
||||
/>
|
||||
<ReplaceText
|
||||
Input="$(DotNetSdkManifestsDirectory)microsoft.net.sdk.ios/WorkloadManifest.json"
|
||||
OldValue=""version": "$(MicrosoftiOSSdkPackageVersion)""
|
||||
NewValue=""version": 6"
|
||||
/>
|
||||
<ReplaceText
|
||||
Input="$(DotNetSdkManifestsDirectory)microsoft.net.sdk.tvos/WorkloadManifest.json"
|
||||
OldValue=""version": "$(MicrosofttvOSSdkPackageVersion)""
|
||||
NewValue=""version": 6"
|
||||
/>
|
||||
<ReplaceText
|
||||
Input="$(DotNetSdkManifestsDirectory)microsoft.net.sdk.macos/WorkloadManifest.json"
|
||||
OldValue=""version": "$(MicrosoftmacOSSdkPackageVersion)""
|
||||
NewValue=""version": 6"
|
||||
/>
|
||||
|
||||
<Touch Files="$(DotNetSdkManifestsDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_AcquirePacks"
|
||||
Inputs="$(_Inputs);Dependencies/Packs.csproj"
|
||||
Outputs="$(DotNetPacksDirectory).stamp">
|
||||
<Exec
|
||||
Command=""$(DotNetToolPath)" restore "$(MSBuildThisFileDirectory)Dependencies/Packs.csproj" -bl:$(PackageOutputPath)/DotNetPacks.binlog"
|
||||
EnvironmentVariables="NUGET_PACKAGES=$(DotNetPacksDirectory);DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1"
|
||||
/>
|
||||
<RemoveDir Directories="@(_PacksToRemove->'$(DotNetPacksDirectory)%(Identity)')" />
|
||||
<Touch Files="$(DotNetPacksDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="CopyWorkloadFiles"
|
||||
TaskFactory="RoslynCodeTaskFactory"
|
||||
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||
<ParameterGroup>
|
||||
<Files ParameterType="System.String[]" Required="true" />
|
||||
<WorkloadDirectory ParameterType="System.String" Required="true" />
|
||||
<VersionBand ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System.IO" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
// This is only in C#, because the equivalent MSBuild XML would not be pretty.
|
||||
foreach (var file in Files)
|
||||
{
|
||||
var name = Directory.GetParent (file).Parent.Parent.Name;
|
||||
var directory = Path.Combine(WorkloadDirectory, name.Replace($".manifest-{VersionBand}", ""));
|
||||
Directory.CreateDirectory(directory);
|
||||
var destination = Path.Combine(directory, Path.GetFileName(file));
|
||||
Log.LogMessage($"Copying {file} to {destination}");
|
||||
File.Copy(file, destination, overwrite: true);
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
<UsingTask TaskName="ReplaceText"
|
||||
TaskFactory="RoslynCodeTaskFactory"
|
||||
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
|
||||
<ParameterGroup>
|
||||
<Input ParameterType="System.String" Required="true" />
|
||||
<OldValue ParameterType="System.String" Required="true" />
|
||||
<NewValue ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Text.RegularExpressions" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
var regex = new Regex(Regex.Escape(OldValue));
|
||||
File.WriteAllText(Input, regex.Replace(File.ReadAllText(Input), NewValue, count: 1));
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,28 @@
|
|||
<Dependencies>
|
||||
<ProductDependencies>
|
||||
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="6.0.100-preview.5.21260.2" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
|
||||
<Uri>https://github.com/dotnet/installer</Uri>
|
||||
<Sha>c1feef4a98dfc1bd2913b876e620d2ed2a01b90b</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="30.0.100-ci.main.2">
|
||||
<Uri>https://github.com/xamarin/xamarin-android</Uri>
|
||||
<Sha>92efdccb686454be32d742b8ca9f6a166a7c1808</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="14.5.100-ci.main.873">
|
||||
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
|
||||
<Sha>592d6fefb0089528383e38e50c7545b1e0f5a971</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.iOS.Sdk" Version="14.5.100-ci.main.873">
|
||||
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
|
||||
<Sha>592d6fefb0089528383e38e50c7545b1e0f5a971</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.tvOS.Sdk" Version="14.5.100-ci.main.873">
|
||||
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
|
||||
<Sha>592d6fefb0089528383e38e50c7545b1e0f5a971</Sha>
|
||||
</Dependency>
|
||||
<Dependency Name="Microsoft.macOS.Sdk" Version="11.3.100-ci.main.873">
|
||||
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
|
||||
<Sha>592d6fefb0089528383e38e50c7545b1e0f5a971</Sha>
|
||||
</Dependency>
|
||||
</ProductDependencies>
|
||||
</Dependencies>
|
|
@ -1,9 +0,0 @@
|
|||
<Project>
|
||||
<!--Package versions-->
|
||||
<PropertyGroup>
|
||||
<MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion>
|
||||
<MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion>
|
||||
<MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion>
|
||||
<MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,15 @@
|
|||
<Project>
|
||||
<!--Package versions-->
|
||||
<PropertyGroup>
|
||||
<MicrosoftDotnetSdkInternalPackageVersion>6.0.100-preview.5.21260.2</MicrosoftDotnetSdkInternalPackageVersion>
|
||||
<MicrosoftAndroidSdkWindowsPackageVersion>30.0.100-ci.main.2</MicrosoftAndroidSdkWindowsPackageVersion>
|
||||
<MicrosoftMacCatalystSdkPackageVersion>14.5.100-ci.main.873</MicrosoftMacCatalystSdkPackageVersion>
|
||||
<MicrosoftiOSSdkPackageVersion>14.5.100-ci.main.873</MicrosoftiOSSdkPackageVersion>
|
||||
<MicrosofttvOSSdkPackageVersion>14.5.100-ci.main.873</MicrosofttvOSSdkPackageVersion>
|
||||
<MicrosoftmacOSSdkPackageVersion>11.3.100-ci.main.873</MicrosoftmacOSSdkPackageVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Trim all characters after first `-` or `+` is encountered. -->
|
||||
<DotNetPreviewVersionBand Condition=" '$(DotNetPreviewVersionBand)' == '' ">$([System.Text.RegularExpressions.Regex]::Replace($(MicrosoftDotnetSdkInternalPackageVersion), `[-+].*$`, ""))</DotNetPreviewVersionBand>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,33 @@
|
|||
// Contains .NET 6-related Cake targets
|
||||
|
||||
var ext = IsRunningOnWindows() ? ".exe" : "";
|
||||
var dotnetPath = $"./bin/dotnet/dotnet{ext}";
|
||||
|
||||
Task("dotnet")
|
||||
.Description("Provisions .NET 6 into bin/dotnet based on eng/Versions.props")
|
||||
.Does(() =>
|
||||
{
|
||||
var binlog = $"artifacts/dotnet-{configuration}.binlog";
|
||||
var settings = new DotNetCoreBuildSettings
|
||||
{
|
||||
MSBuildSettings = new DotNetCoreMSBuildSettings()
|
||||
.EnableBinaryLogger(binlog)
|
||||
.SetConfiguration(configuration),
|
||||
};
|
||||
DotNetCoreBuild("./build/DotNet/DotNet.csproj", settings);
|
||||
});
|
||||
|
||||
Task("dotnet-pack")
|
||||
.Description("Build and create .NET 6 NuGet packages")
|
||||
.Does(()=>
|
||||
{
|
||||
|
||||
var settings = new DotNetCoreToolSettings
|
||||
{
|
||||
DiagnosticOutput = true,
|
||||
ArgumentCustomization = args => args.Append($"./eng/package.ps1 -configuration \"{configuration}\"")
|
||||
};
|
||||
|
||||
DotNetCoreTool("pwsh", settings);
|
||||
|
||||
});
|
102
eng/dogfood.ps1
102
eng/dogfood.ps1
|
@ -1,102 +0,0 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
*Windows-only* Launches Visual Studio with environment variables to use the local ./bin/dotnet/dotnet.exe.
|
||||
|
||||
.DESCRIPTION
|
||||
*Windows-only* Launches Visual Studio with environment variables to use the local ./bin/dotnet/dotnet.exe.
|
||||
Script based on:
|
||||
https://github.com/dotnet/runtime/blob/1be117d8e7c0cd29ebc55cbcff2a7fa70604ed39/eng/build.ps1#L186-L208
|
||||
https://github.com/dotnet/runtime/blob/1be117d8e7c0cd29ebc55cbcff2a7fa70604ed39/eng/common/tools.ps1#L109
|
||||
|
||||
.PARAMETER vs
|
||||
The path to Visual Studio, defaults to:
|
||||
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe".
|
||||
|
||||
.PARAMETER sln
|
||||
The path to a .sln or .project file, defaults to "Microsoft.Maui-net6.sln".
|
||||
|
||||
.PARAMETER modify
|
||||
Modify the environment variables in the current session. This would
|
||||
allow the "dotnet" command to work instead of ".\bin\dotnet\dotnet".
|
||||
However, it would be good to do this in a new terminal session,
|
||||
since you would have trouble running "dotnet build" if it needs to
|
||||
provision .NET 6 and the iOS/Android workloads again.
|
||||
|
||||
.EXAMPLE
|
||||
PS> .\scripts\dogfood.ps1
|
||||
|
||||
.EXAMPLE
|
||||
PS> .\scripts\dogfood.ps1 -vs "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe"
|
||||
|
||||
.EXAMPLE
|
||||
PS> .\scripts\dogfood.ps1 -sln .\path\to\MySolution.sln
|
||||
#>
|
||||
|
||||
param(
|
||||
[string]$vs = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe",
|
||||
[string]$sln,
|
||||
[switch]$modify
|
||||
)
|
||||
|
||||
$dotnet=Join-Path $PSScriptRoot ../bin/dotnet/
|
||||
$dotnet=(Get-Item $dotnet).FullName
|
||||
|
||||
if (-Not $sln) {
|
||||
$sln=Join-Path $PSScriptRoot ../Microsoft.Maui-net6.sln
|
||||
$sln=(Get-Item $sln).FullName
|
||||
}
|
||||
|
||||
# Modify global.json, so the IDE can load
|
||||
$globaljson = Join-Path $PSScriptRoot ../global.json
|
||||
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Version.props)
|
||||
$json = Get-Content $globaljson | ConvertFrom-Json
|
||||
$json | Add-Member sdk (New-Object -TypeName PSObject) -Force
|
||||
$json.sdk | Add-Member version $xml.Project.PropertyGroup.MicrosoftNETSdkPackageVersion -Force
|
||||
$json | ConvertTo-Json | Set-Content $globaljson
|
||||
|
||||
# NOTE: I've not found a better way to do this
|
||||
# see: https://github.com/PowerShell/PowerShell/issues/3316
|
||||
$oldDOTNET_INSTALL_DIR=$env:DOTNET_INSTALL_DIR
|
||||
$oldDOTNET_ROOT=$env:DOTNET_ROOT
|
||||
$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
$oldDOTNET_MULTILEVEL_LOOKUP=$env:DOTNET_MULTILEVEL_LOOKUP
|
||||
$oldMSBuildEnableWorkloadResolver=$env:MSBuildEnableWorkloadResolver
|
||||
$old_ExcludeMauiProjectCapability=$env:_ExcludeMauiProjectCapability
|
||||
$oldPATH=$env:PATH
|
||||
|
||||
try {
|
||||
$env:DOTNET_INSTALL_DIR=$dotnet
|
||||
|
||||
# This tells .NET to use the bootstrapped runtime
|
||||
$env:DOTNET_ROOT=$env:DOTNET_INSTALL_DIR
|
||||
|
||||
# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
|
||||
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_ROOT
|
||||
|
||||
# This tells .NET not to go looking for .NET in other places
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP=0
|
||||
|
||||
# This enables workload support inside the IDE
|
||||
$env:MSBuildEnableWorkloadResolver=$true
|
||||
|
||||
# This disables the Maui @(ProjectCapability), a temporary workaround for 16.9
|
||||
$env:_ExcludeMauiProjectCapability=$true
|
||||
|
||||
# Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
|
||||
$env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH)
|
||||
|
||||
# Launch VS
|
||||
& "$vs" "$sln"
|
||||
} finally {
|
||||
if (-Not $modify) {
|
||||
$env:DOTNET_INSTALL_DIR = $oldDOTNET_INSTALL_DIR
|
||||
$env:DOTNET_ROOT=$oldDOTNET_ROOT
|
||||
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP=$oldDOTNET_MULTILEVEL_LOOKUP
|
||||
$env:MSBuildEnableWorkloadResolver=$oldMSBuildEnableWorkloadResolver
|
||||
$env:_ExcludeMauiProjectCapability=$old_ExcludeMauiProjectCapability
|
||||
$env:PATH=$oldPATH
|
||||
}
|
||||
}
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,112 @@
|
|||
param(
|
||||
[string] $configuration = 'Debug',
|
||||
[string] $msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\MSBuild.exe"
|
||||
)
|
||||
|
||||
$OnWindows = $TRUE
|
||||
$ErrorActionPreference = "Stop"
|
||||
Write-Host $msbuild
|
||||
Write-Host $OnWindows
|
||||
|
||||
if($IsWindows)
|
||||
{
|
||||
$OnWindows = $IsWindows
|
||||
}
|
||||
|
||||
$artifacts = Join-Path $PSScriptRoot ../artifacts
|
||||
$sln = Join-Path $PSScriptRoot ../build/Build.Microsoft.Maui.Graphics-net6.sln
|
||||
|
||||
# Bootstrap ./bin/dotnet/
|
||||
$csproj = Join-Path $PSScriptRoot ../build/DotNet/DotNet.csproj
|
||||
& dotnet build $csproj -bl:$artifacts/dotnet-$configuration.binlog
|
||||
|
||||
# Full path to dotnet folder
|
||||
$dotnet = Join-Path $PSScriptRoot ../bin/dotnet/
|
||||
$dotnet = (Get-Item $dotnet).FullName
|
||||
|
||||
if ($OnWindows)
|
||||
{
|
||||
# Modify global.json, so the IDE can load
|
||||
$globaljson = Join-Path $PSScriptRoot ../global.json
|
||||
[xml] $xml = Get-Content (Join-Path $PSScriptRoot Versions.props)
|
||||
$json = Get-Content $globaljson | ConvertFrom-Json
|
||||
$json | Add-Member sdk (New-Object -TypeName PSObject) -Force
|
||||
$json.sdk | Add-Member version ([string]$xml.Project.PropertyGroup.MicrosoftDotnetSdkInternalPackageVersion).Trim() -Force
|
||||
$json | ConvertTo-Json | Set-Content $globaljson
|
||||
|
||||
# NOTE: I've not found a better way to do this
|
||||
# see: https://github.com/PowerShell/PowerShell/issues/3316
|
||||
$oldDOTNET_INSTALL_DIR=$env:DOTNET_INSTALL_DIR
|
||||
$oldDOTNET_ROOT=$env:DOTNET_ROOT
|
||||
$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
$oldDOTNET_MULTILEVEL_LOOKUP=$env:DOTNET_MULTILEVEL_LOOKUP
|
||||
$oldMSBuildEnableWorkloadResolver=$env:MSBuildEnableWorkloadResolver
|
||||
$oldPATH=$env:PATH
|
||||
try
|
||||
{
|
||||
$env:DOTNET_INSTALL_DIR=$dotnet
|
||||
|
||||
# This tells .NET to use the bootstrapped runtime
|
||||
$env:DOTNET_ROOT=$dotnet
|
||||
|
||||
# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
|
||||
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_ROOT
|
||||
|
||||
# This tells .NET not to go looking for .NET in other places
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP=0
|
||||
|
||||
# This enables workload support inside the IDE
|
||||
$env:MSBuildEnableWorkloadResolver=$true
|
||||
|
||||
# Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
|
||||
$env:PATH=($dotnet + [IO.Path]::PathSeparator + $env:PATH)
|
||||
|
||||
# Have to build the solution first so the xbf files are there for pack
|
||||
& $msbuild $sln `
|
||||
/p:configuration=$configuration `
|
||||
/p:SymbolPackageFormat=snupkg `
|
||||
/restore `
|
||||
/t:build `
|
||||
/p:Packing=true `
|
||||
/bl:"$artifacts/maui-graphics-build-$configuration.binlog"
|
||||
if (!$?) { throw "Build failed." }
|
||||
|
||||
& $msbuild $sln `
|
||||
/p:configuration=$configuration `
|
||||
/p:SymbolPackageFormat=snupkg `
|
||||
/t:pack `
|
||||
/p:Packing=true `
|
||||
/bl:"$artifacts/maui-graphics-pack-$configuration.binlog"
|
||||
if (!$?) { throw "Pack failed." }
|
||||
}
|
||||
finally
|
||||
{
|
||||
$env:DOTNET_INSTALL_DIR = $oldDOTNET_INSTALL_DIR
|
||||
$env:DOTNET_ROOT=$oldDOTNET_ROOT
|
||||
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$oldDOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
$env:DOTNET_MULTILEVEL_LOOKUP=$oldDOTNET_MULTILEVEL_LOOKUP
|
||||
$env:MSBuildEnableWorkloadResolver=$oldMSBuildEnableWorkloadResolver
|
||||
$env:PATH=$oldPATH
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$oldPATH=$env:PATH
|
||||
try
|
||||
{
|
||||
# Put our local dotnet on $PATH
|
||||
$env:PATH=($dotnet + [IO.Path]::PathSeparator + $env:PATH)
|
||||
$dotnet_tool = Join-Path $dotnet dotnet
|
||||
|
||||
# Build with ./bin/dotnet/dotnet
|
||||
& $dotnet_tool pack $sln `
|
||||
-c:$configuration `
|
||||
-p:SymbolPackageFormat=snupkg `
|
||||
-bl:$artifacts/maui-graphics-pack-$configuration.binlog
|
||||
if (!$?) { throw "Pack failed." }
|
||||
}
|
||||
finally
|
||||
{
|
||||
$env:PATH=$oldPATH
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0-windows10.0.18362</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>Microsoft.Maui.Graphics.Win2D.WinUI.Desktop</RootNamespace>
|
||||
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.ProjectReunion" Version="0.5.0" />
|
||||
<PackageReference Include="Microsoft.Graphics.Win2D" Version="0.5.0.13" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Net6WinUIWorkaround" BeforeTargets="_GetSdkToolsPathsFromSdk" Condition="$(TargetFramework.Contains('-windows')) == true ">
|
||||
<PropertyGroup>
|
||||
<TargetPlatformIdentifierAdjusted>UAP</TargetPlatformIdentifierAdjusted>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.Maui.Graphics\Microsoft.Maui.Graphics-net6.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -35,5 +35,11 @@
|
|||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Net6WinUIWorkaround" BeforeTargets="_GetSdkToolsPathsFromSdk" Condition="$(TargetFramework.Contains('-windows')) == true ">
|
||||
<PropertyGroup>
|
||||
<TargetPlatformIdentifierAdjusted>UAP</TargetPlatformIdentifierAdjusted>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Import Project="..\targets\MultiTargeting.targets" />
|
||||
</Project>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<Project>
|
||||
<Import Project="../../../../eng/Version.props" />
|
||||
</Project>
|
|
@ -1,15 +0,0 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="Microsoft.Android.Ref" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.win-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('windows'))" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.osx-x64" Version="[$(MicrosoftAndroidSdkPackageVersion)]" Condition="$([MSBuild]::IsOSPlatform('osx'))" />
|
||||
<PackageDownload Include="Microsoft.Android.Sdk.BundleTool" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.MacCatalyst.Ref" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.MacCatalyst.Sdk" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.iOS.Ref" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.iOS.Sdk" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,10 +0,0 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageDownload Include="Microsoft.NET.Workload.Android" Version="[$(MicrosoftAndroidSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Workload.MacCatalyst" Version="[$(MicrosoftMacCatalystSdkPackageVersion)]" />
|
||||
<PackageDownload Include="Microsoft.NET.Workload.iOS" Version="[$(MicrosoftiOSSdkPackageVersion)]" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -1,108 +0,0 @@
|
|||
<Project Sdk="Microsoft.Build.NoTargets">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<MauiOutputPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../../bin/'))</MauiOutputPath>
|
||||
<DotNetDirectory>$(MauiOutputPath)dotnet/</DotNetDirectory>
|
||||
<DotNetToolPath>$(DotNetDirectory)dotnet</DotNetToolPath>
|
||||
<DotNetPacksDirectory>$(DotNetDirectory)packs/</DotNetPacksDirectory>
|
||||
<DotNetSdkManifestsDirectory>$(DotNetDirectory)sdk-manifests/$(MicrosoftNETSdkPackageVersion.Split('-')[0])/</DotNetSdkManifestsDirectory>
|
||||
<DotNetSentinelPath>$(DotNetDirectory)sdk/$(MicrosoftNETSdkPackageVersion)/EnableWorkloadResolver.sentinel</DotNetSentinelPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
|
||||
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.ps1</DotNetInstallScriptUrl>
|
||||
<DotNetInstallScriptName>dotnet-install.ps1</DotNetInstallScriptName>
|
||||
<DotNetInstallScriptPath>$(MauiOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
|
||||
<DotNetInstallCommand>& '$(DotNetInstallScriptPath)' -Version $(MicrosoftNETSdkPackageVersion) -InstallDir '$(DotNetDirectory)' -Verbose</DotNetInstallCommand>
|
||||
<DotNetInstallCommand>powershell -Command "$(DotNetInstallCommand)"</DotNetInstallCommand>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('osx'))">
|
||||
<DotNetInstallScriptUrl>https://dot.net/v1/dotnet-install.sh</DotNetInstallScriptUrl>
|
||||
<DotNetInstallScriptName>dotnet-install.sh</DotNetInstallScriptName>
|
||||
<DotNetInstallScriptPath>$(MauiOutputPath)$(DotNetInstallScriptName)</DotNetInstallScriptPath>
|
||||
<DotNetInstallCommand>sh '$(DotNetInstallScriptPath)' --version $(MicrosoftNETSdkPackageVersion) --install-dir '$(DotNetDirectory)' --verbose</DotNetInstallCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<_ProvisionDependsOn>
|
||||
_DownloadDotNetInstallScript;
|
||||
_InstallDotNet;
|
||||
_AcquireWorkloads;
|
||||
_AcquirePacks;
|
||||
_CreateWorkloadSentinel;
|
||||
</_ProvisionDependsOn>
|
||||
</PropertyGroup>
|
||||
<Target Name="_Provision" BeforeTargets="Build" DependsOnTargets="$(_ProvisionDependsOn)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- These files should invalidate ./bin/dotnet completely -->
|
||||
<_Inputs>
|
||||
$(MSBuildThisFile);
|
||||
../../eng/Version.props;
|
||||
</_Inputs>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_DownloadDotNetInstallScript"
|
||||
Inputs="$(_Inputs)"
|
||||
Outputs="$(DotNetInstallScriptPath)">
|
||||
<DownloadFile
|
||||
SourceUrl="$(DotNetInstallScriptUrl)"
|
||||
DestinationFolder="$(MauiOutputPath)"
|
||||
DestinationFileName="$(DotNetInstallScriptName)"
|
||||
/>
|
||||
</Target>
|
||||
|
||||
<Target Name="_InstallDotNet"
|
||||
Inputs="$(_Inputs)"
|
||||
Outputs="$(DotNetDirectory).stamp">
|
||||
<RemoveDir Directories="$(DotNetDirectory)" />
|
||||
<Exec Command="$(DotNetInstallCommand)" />
|
||||
<Touch Files="$(DotNetDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- These are extra packs that get extracted that should be deleted -->
|
||||
<_PacksToRemove Include="microsoft.build.notargets" />
|
||||
<_PacksToRemove Include="microsoft.netcore.platforms" />
|
||||
<_PacksToRemove Include="netstandard.library" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_AcquireWorkloads"
|
||||
Inputs="$(_Inputs);Dependencies/Workloads.csproj"
|
||||
Outputs="$(DotNetSdkManifestsDirectory).stamp">
|
||||
<Exec
|
||||
Command=""$(DotNetToolPath)" restore "$(MSBuildThisFileDirectory)Dependencies/Workloads.csproj" -bl:$(PackageOutputPath)/DotNetWorkloads.binlog"
|
||||
EnvironmentVariables="NUGET_PACKAGES=$(DotNetSdkManifestsDirectory);DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1"
|
||||
/>
|
||||
<!--
|
||||
NOTE: Workloads need to go in dotnet/sdk-manifests/6.0.100/Microsoft.Workload.NET.*/
|
||||
Workloads only contain two files: WorkloadManifest.targets & WorkloadManifest.json
|
||||
We have to move everything up one directory, for things to land in the right location.
|
||||
-->
|
||||
<ItemGroup>
|
||||
<_WorkloadFiles Include="$(DotNetSdkManifestsDirectory)Microsoft.NET.Workload.*/*/WorkloadManifest.*" />
|
||||
<_WorkloadDirectoriesToDelete Include="@(_WorkloadFiles->'%(RootDir)%(Directory)'->Distinct())" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(_WorkloadFiles)" DestinationFiles="@(_WorkloadFiles->'%(RootDir)%(Directory)../%(FileName)%(Extension)')" />
|
||||
<RemoveDir Directories="@(_WorkloadDirectoriesToDelete);@(_PacksToRemove->'$(DotNetSdkManifestsDirectory)%(Identity)')" />
|
||||
<Touch Files="$(DotNetSdkManifestsDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_AcquirePacks"
|
||||
Inputs="$(_Inputs);Dependencies/Packs.csproj"
|
||||
Outputs="$(DotNetPacksDirectory).stamp">
|
||||
<Exec
|
||||
Command=""$(DotNetToolPath)" restore "$(MSBuildThisFileDirectory)Dependencies/Packs.csproj" -bl:$(PackageOutputPath)/DotNetPacks.binlog"
|
||||
EnvironmentVariables="NUGET_PACKAGES=$(DotNetPacksDirectory);DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1"
|
||||
/>
|
||||
<RemoveDir Directories="@(_PacksToRemove->'$(DotNetPacksDirectory)%(Identity)')" />
|
||||
<Touch Files="$(DotNetPacksDirectory).stamp" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_CreateWorkloadSentinel"
|
||||
Inputs="$(_Inputs)"
|
||||
Outputs="$(DotNetSentinelPath)">
|
||||
<Touch Files="$(DotNetSentinelPath)" AlwaysCreate="true" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
Загрузка…
Ссылка в новой задаче