Skip to content

Instantly share code, notes, and snippets.

@colinbull
Created March 10, 2019 19:06
Show Gist options
  • Save colinbull/6f861e62d6abeb2f21c6074d0164a54a to your computer and use it in GitHub Desktop.
Save colinbull/6f861e62d6abeb2f21c6074d0164a54a to your computer and use it in GitHub Desktop.
Function v2 directory.build.targets
<Project>
<PropertyGroup>
<_IsFunctionsSdkBuild Condition="$(_FunctionsTaskFramework) != ''">true</_IsFunctionsSdkBuild>
<_FunctionsExtensionsDir>$(TargetDir)</_FunctionsExtensionsDir>
<_FunctionsExtensionsDir Condition="$(_IsFunctionsSdkBuild) == 'true'">$(_FunctionsExtensionsDir)bin</_FunctionsExtensionsDir>
</PropertyGroup>
<Target Name="CopyExtensionsJson" AfterTargets="_GenerateFunctionsAndCopyContentFiles">
<Message Importance="High" Text="Overwritting extensions.json file with one from build." />
<Copy Condition="$(_IsFunctionsSdkBuild) == 'true' AND Exists('$(_FunctionsExtensionsDir)\extensions.json')"
SourceFiles="$(_FunctionsExtensionsDir)\extensions.json"
DestinationFiles="$(PublishDir)bin\extensions.json"
OverwriteReadOnlyFiles="true"
ContinueOnError="true"/>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment