Skip to content

Commit 48ac353

Browse files
committed
Add initial Azure.Functions.Sdk project (#3142)
* Add initial Azure.Functions.Sdk project * dotnet isolated -> dotnet-isolated
1 parent b13f47c commit 48ac353

File tree

5 files changed

+104
-0
lines changed

5 files changed

+104
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<Description>Azure Functions SDK for dotnet-isolated workers.</Description>
6+
<PackageTags>Azure Functions Dotnet Dotnet-Isolated</PackageTags>
7+
<PackageType>MSBuildSdk</PackageType>
8+
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
9+
<DevelopmentDependency>true</DevelopmentDependency>
10+
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
11+
<VersionPrefix>0.1.0</VersionPrefix>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.11.4" ExcludeAssets="Runtime" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<None Include="**/*.props;**/*.targets" Pack="true" CamelCasePath="true" />
20+
</ItemGroup>
21+
22+
<Target Name="_AddPackagePath" BeforeTargets="_GetPackageFiles">
23+
<ItemGroup>
24+
<!-- Convert these file paths to camel case, which is the nuget package convention. -->
25+
<!-- This way we can keep our folders pascal case on disk for consistency. -->
26+
<None Update="@(None)"
27+
PackagePath="$([System.String]::new('%(RecursiveDir)').Substring(0, 1).ToLowerInvariant())$([System.String]::new('%(RecursiveDir)').Substring(1))%(Filename)%(Extension)"
28+
Condition="'%(None.CamelCasePath)' == 'true'" />
29+
</ItemGroup>
30+
</Target>
31+
32+
<Target Name="IncludeReferenceCopyLocalPathsInBuildOutputInPackage"
33+
BeforeTargets="_GetBuildOutputFilesWithTfm"
34+
DependsOnTargets="ResolveReferences;ResolvePackageDependenciesForBuild">
35+
<ItemGroup>
36+
<BuildOutputInPackage Include="@(RuntimeCopyLocalItems-&gt;WithMetadataValue('AssetType', 'runtime'))"
37+
TargetPath="%(RuntimeCopyLocalItems.DestinationSubDirectory)%(Filename)%(Extension)" />
38+
<BuildOutputInPackage Include="@(RuntimeCopyLocalItems-&gt;WithMetadataValue('CopyLocal', 'true'))"
39+
TargetPath="%(RuntimeCopyLocalItems.DestinationSubDirectory)%(Filename)%(Extension)" />
40+
</ItemGroup>
41+
</Target>
42+
43+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
***********************************************************************************************
3+
Azure.Functions.Sdk.targets
4+
5+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6+
created a backup copy. Incorrect changes to this file will make it
7+
impossible to load or build your projects from the command-line or the IDE.
8+
9+
***********************************************************************************************
10+
-->
11+
12+
<Project>
13+
14+
<!-- Fail the build if we are referenced via PackageReference and not Sdk element. -->
15+
<Target Name="_AzureFunctionsIncorrectImport" BeforeTargets="Build">
16+
<Error Text="Azure.Functions.Sdk must be imported through an 'Sdk' element and not a 'PackageReference'." />
17+
</Target>
18+
19+
</Project>

src/Azure.Functions.Sdk/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Azure.Functions.Sdk
2+
3+
The MSBuild SDK to use for building dotnet-isolated function apps.
4+
5+
This is intended to replace `Microsoft.Azure.Functions.Worker.Sdk` (which is at sdk/Sdk in this repo).
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!--
2+
***********************************************************************************************
3+
Sdk.props
4+
5+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6+
created a backup copy. Incorrect changes to this file will make it
7+
impossible to load or build your projects from the command-line or the IDE.
8+
9+
***********************************************************************************************
10+
-->
11+
12+
<Project>
13+
14+
<PropertyGroup>
15+
<UsingAzureFunctionsSdk>true</UsingAzureFunctionsSdk>
16+
</PropertyGroup>
17+
18+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
***********************************************************************************************
3+
Sdk.targets
4+
5+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6+
created a backup copy. Incorrect changes to this file will make it
7+
impossible to load or build your projects from the command-line or the IDE.
8+
9+
***********************************************************************************************
10+
-->
11+
12+
<Project>
13+
14+
<PropertyGroup>
15+
<AzureFunctionsSdkTasksDirectory>$(MSBuildThisFileDirectory)../tools/netstandard2.0/</AzureFunctionsSdkTasksDirectory>
16+
<AzureFunctionsSdkTasksAssembly>$(AzureFunctionsSdkTasksDirectory)Azure.Functions.Sdk.dll</AzureFunctionsSdkTasksAssembly>
17+
</PropertyGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)