Fixing the build issue when functions is run in the container scenario

This commit is contained in:
Vijay Ramakrishnan 2019-08-07 08:13:20 -07:00
Родитель 536d7536e9
Коммит f17ac70c65
21 изменённых файлов: 19 добавлений и 52 удалений

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

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\netstandard1.0\ExtensionsMetadataGeneratorVersion.props" />
<Import Project="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\netstandard1.0\Microsoft.NET.Sdk.Functions.Version.props" />
<Import Project="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\ExtensionsMetadataGeneratorVersion.props" />
<Import Project="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\Microsoft.NET.Sdk.Functions.Version.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
@ -34,13 +34,9 @@
</PropertyGroup>
<ItemGroup>
<Content Include="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\netstandard1.0\**\*">
<Content Include="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\**\*">
<Pack>true</Pack>
<PackagePath>build\netstandard1.0\</PackagePath>
</Content>
<Content Include="..\..\src\Microsoft.NET.Sdk.Functions.MSBuild\Targets\Sdk\**\*">
<Pack>true</Pack>
<PackagePath>Sdk\</PackagePath>
<PackagePath>build\</PackagePath>
</Content>
</ItemGroup>

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

@ -1,6 +1,6 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.Functions.props
ExtensionsMetadataGeneratorVersion.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it

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

@ -42,8 +42,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
-->
<Target Name="_InitializeDotNetPublishProperties"
BeforeTargets="PrepareForPublish"
Condition="'$(DeployOnBuild)' != 'true'
">
Condition="'$(DeployOnBuild)' != 'true'">
<ConvertToAbsolutePath Paths="$(PublishDir)">
<Output TaskParameter="AbsolutePaths"
@ -69,6 +68,11 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<Target Name="_InitializeDeployOnBuildProperties" >
<ConvertToAbsolutePath Paths="$(PublishIntermediateOutputPath)">
<Output TaskParameter="AbsolutePaths"
PropertyName="PublishIntermediateOutputPath"/>
</ConvertToAbsolutePath>
<PropertyGroup>
<PublishDir>$(PublishIntermediateOutputPath)</PublishDir>
<PublishDir Condition="!HasTrailingSlash('$(PublishDir)')">$(PublishDir)\</PublishDir>

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

@ -14,7 +14,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<PropertyGroup>
<_FunctionsTaskFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netcoreapp2.1</_FunctionsTaskFramework>
<_FunctionsTaskFramework Condition=" '$(_FunctionsTaskFramework)' == ''">net46</_FunctionsTaskFramework>
<_FunctionsTasksDir Condition=" '$(_FunctionsTasksDir)'=='' ">$(MSBuildThisFileDirectory)..\..\tools\$(_FunctionsTaskFramework)\</_FunctionsTasksDir>
<_FunctionsTasksDir Condition=" '$(_FunctionsTasksDir)'=='' ">$(MSBuildThisFileDirectory)..\tools\$(_FunctionsTaskFramework)\</_FunctionsTasksDir>
<_FunctionsTaskAssemblyFullPath Condition=" '$(_FunctionsTaskAssemblyFullPath)'=='' ">$(_FunctionsTasksDir)\Microsoft.NET.Sdk.Functions.MSBuild.dll</_FunctionsTaskAssemblyFullPath>
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>

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

@ -1,18 +0,0 @@
<!--
***********************************************************************************************
Sdk.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.props" />
<Import Project="$(MSBuildThisFileDirectory)..\build\netstandard1.0\Microsoft.NET.Sdk.Functions.props" />
</Project>

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

@ -1,18 +0,0 @@
<!--
***********************************************************************************************
Sdk.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" />
<Import Project="$(MSBuildThisFileDirectory)..\build\netstandard1.0\Microsoft.NET.Sdk.Functions.targets" />
</Project>

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

@ -19,8 +19,11 @@ namespace Microsoft.NET.Sdk.Functions.Test
jObject.Should().HaveElement("path");
jObject["path"].Should().Be("eventHub");
#else
jObject.Should().HaveElement("eventHubName");
jObject["eventHubName"].Should().Be("eventHub");
jObject.Should().HaveElement("type");
jObject["type"].Should().Be("eventHubTrigger");
jObject.Should().HaveElement("path");
jObject["path"].Should().Be("eventHub");
#endif
}
}

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

@ -53,7 +53,7 @@ namespace Microsoft.NET.Sdk.Functions.Test
public void FunctionMethodsAreExported(string functionName, string type, string parameterName)
{
var logger = new RecorderLogger();
var converter = new FunctionJsonConverter(logger, ".", ".");
var converter = new FunctionJsonConverter(logger, ".", ".", functionsInDependencies:false);
var functions = converter.GenerateFunctions(new [] {typeof(FunctionsClass)});
var schema = functions.Single(e => Path.GetFileName(e.Value.outputFile.DirectoryName) == functionName).Value.schema;
var binding = schema.Bindings.Single();
@ -87,7 +87,7 @@ namespace Microsoft.NET.Sdk.Functions.Test
public void InvalidFunctionMethodProducesWarning(Type type, string warningMessage)
{
var logger = new RecorderLogger();
var converter = new FunctionJsonConverter(logger, ".", ".");
var converter = new FunctionJsonConverter(logger, ".", ".", functionsInDependencies:false);
var functions = converter.GenerateFunctions(new [] {type});
functions.Should().BeEmpty();
logger.Errors.Should().BeEmpty();