Merge pull request #101 from nventive/dev/jela/single-use-mode

Expose single-use host mode parameter
This commit is contained in:
Jérôme Laban 2019-03-13 15:53:13 -04:00 коммит произвёл GitHub
Родитель 62b2657b64 afc4ebdf2b
Коммит ed61ef22dd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 26 добавлений и 3 удалений

Просмотреть файл

@ -78,6 +78,13 @@ jobs:
- job: macOS
strategy:
matrix:
Xamarin_5_16_0:
XamarinVersion: 5_16_0
Xamarin_5_12_0:
XamarinVersion: 5_12_0
variables:
NUGET_PACKAGES: $(Agent.WorkFolder)\.nuget
@ -90,6 +97,9 @@ jobs:
versionSpec: 4.7.0
checkLatest: false
- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh $(XamarinVersion)"
displayName: Select Xamarin Version
- bash: msbuild /r /p:Configuration=Release ./src/Uno.SourceGenerator.Linux.sln # /bl:$(build.artifactstagingdirectory)/macos-build.binlog
displayName: Build

Просмотреть файл

@ -19,6 +19,9 @@
<!-- Disable the host controller when running outside of VS -->
<UnoSourceGeneratorUseGenerationController Condition="'$(BuildingInsideVisualStudio)'=='' and '$(UnoSourceGeneratorUseGenerationController)'==''">false</UnoSourceGeneratorUseGenerationController>
<!-- Enables the out of process single-use generation host -->
<UnoSourceGeneratorUseGenerationHost Condition="'$(UnoSourceGeneratorUseGenerationHost)'==''">true</UnoSourceGeneratorUseGenerationHost>
</PropertyGroup>
<ItemGroup>
@ -126,6 +129,7 @@
TargetFrameworkRootPath="$(TargetFrameworkRootPath)"
AdditionalAssemblies="@(SourceGeneratorAdditionalAssemblies)"
UseGenerationController="$(UnoSourceGeneratorUseGenerationController)"
UseGenerationHost="$(UnoSourceGeneratorUseGenerationHost)"
CaptureGenerationHostOutput="$(UnoSourceGeneratorCaptureGenerationHostOutput)"
BinLogOutputPath="$(UnoSourceGeneratorBinLogOutputPath)"
BinLogEnabled="$(UnoSourceGeneratorUnsecureBinLogEnabled)"

Просмотреть файл

@ -58,10 +58,15 @@ namespace Uno.SourceGeneratorTasks
public string CaptureGenerationHostOutput { get; set; }
/// <summary>
/// Enables the use of the GenerationController mode.
/// Enables the use of the Generation Controller mode.
/// </summary>
public string UseGenerationController { get; set; } = bool.TrueString;
/// <summary>
/// Enables the use of the Generation Host mode.
/// </summary>
public string UseGenerationHost { get; set; } = bool.TrueString;
/// <summary>
/// Provides a list of assemblies to be loaded in the SourceGenerator
/// secondary app domains. This is a backward compatibility feature related
@ -112,7 +117,7 @@ namespace Uno.SourceGeneratorTasks
{
GenerateWithHostController();
}
else if(IsMonoMSBuildCompatible || RuntimeHelpers.IsNetCore)
else if(SupportsGenerationHost)
{
GenerateWithHost();
}
@ -157,6 +162,11 @@ namespace Uno.SourceGeneratorTasks
|| RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
);
public bool SupportsGenerationHost
=> (bool.TryParse(UseGenerationHost, out var result) && result)
&& (
IsMonoMSBuildCompatible || RuntimeHelpers.IsNetCore
);
private void GenerateWithHostController()
{
@ -404,7 +414,6 @@ namespace Uno.SourceGeneratorTasks
string.Compare(FileVersionInfo.GetVersionInfo(new Uri(typeof(Microsoft.Build.Utilities.Task).Assembly.Location).LocalPath).FileVersion, "16.0") >= 0
|| RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
private BuildEnvironment CreateBuildEnvironment()
=> new BuildEnvironment
{