Fixing the build issue when functions is run in the container scenario
This commit is contained in:
Родитель
536d7536e9
Коммит
f17ac70c65
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче