Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
Initial commit of Microsoft.NET.Sdk.WindowsForms project
Browse files Browse the repository at this point in the history
The targets files in this project were borrowed from a comment
in dotnet/project-system#1272 and
modified somewhat to fit into an SDK project. Note that these
targets are as-yet untested.
  • Loading branch information
wjk committed Mar 6, 2018
1 parent 48964f2 commit 19d671b
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 0 deletions.
17 changes: 17 additions & 0 deletions MSBuildSdks.sln
Expand Up @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.WPF", "sr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.Xamarin", "src\Microsoft.NET.Sdk.Xamarin\Microsoft.NET.Sdk.Xamarin.csproj", "{E33B8555-4BC9-4CD8-B179-641A5DFE5AC3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.NET.Sdk.WindowsForms", "src\Microsoft.NET.Sdk.WindowsForms\Microsoft.NET.Sdk.WindowsForms.csproj", "{900986BC-7E6A-44F2-9081-29B5E0CF6DBC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -47,11 +49,26 @@ Global
{E33B8555-4BC9-4CD8-B179-641A5DFE5AC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E33B8555-4BC9-4CD8-B179-641A5DFE5AC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E33B8555-4BC9-4CD8-B179-641A5DFE5AC3}.Release|Any CPU.Build.0 = Release|Any CPU
{900986BC-7E6A-44F2-9081-29B5E0CF6DBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{900986BC-7E6A-44F2-9081-29B5E0CF6DBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{900986BC-7E6A-44F2-9081-29B5E0CF6DBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{900986BC-7E6A-44F2-9081-29B5E0CF6DBC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6AB3C4FB-938A-42B8-8E9E-A53178C94301}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.TextStylePolicy = $1
$1.TabsToSpaces = True
$1.scope = text/x-json
$0.TextStylePolicy = $2
$2.TabWidth = 2
$2.TabsToSpaces = True
$2.IndentWidth = 2
$2.scope = application/x-csproject
EndGlobalSection
EndGlobal
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Description>Provides SDK functionality specific to Windows Forms projects</Description>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PackageTags>tags</PackageTags>
</PropertyGroup>
</Project>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>$id$</id>
<version>$version$</version>
<description>$description$</description>
<authors>$authors$</authors>
<owners>$authors$</owners>
<copyright>$copyright$</copyright>
<projectUrl>$projecturl$</projectUrl>
<licenseUrl>$licenseurl$</licenseUrl>
<iconUrl>$iconurl$</iconUrl>
<tags>$tags$</tags>
<packageTypes>
<packageType name="$packagetype$" />
</packageTypes>
</metadata>
<files>
<file src="Sdk\**" target="Sdk" />
<file src="build\**" target="build" />
</files>
</package>
19 changes: 19 additions & 0 deletions src/Microsoft.NET.Sdk.WindowsForms/Sdk/Sdk.props
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<_SdkLanguageName>CSharp</_SdkLanguageName>
<_SdkLanguageExtension>.cs</_SdkLanguageExtension>
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.vbproj'">
<_SdkLanguageName>VisualBasic</_SdkLanguageName>
<_SdkLanguageExtension>.vb</_SdkLanguageExtension>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="$(MSBuildThisFileDirectory)/../build/DesignerProject.props" />
<Import Project="$(MSBuildThisFileDirectory)/../build/DefaultReferences.props" />
</Project>
7 changes: 7 additions & 0 deletions src/Microsoft.NET.Sdk.WindowsForms/Sdk/Sdk.targets
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>
20 changes: 20 additions & 0 deletions src/Microsoft.NET.Sdk.WindowsForms/build/DefaultReferences.props
@@ -0,0 +1,20 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true'">
<_ExtrasImplicitReference Include="System.Windows.Forms" />
<_ExtrasImplicitReference Include="System.Drawing" />
<_ExtrasImplicitReference Include="System.Design" />

<!-- Set Pack=false on implicit references so they don't get added to NuGet packages as framework assemblies -->
<_ExtrasImplicitReference Update="@(_ExtrasImplicitReference)" Pack="false" />
<!-- Don't duplicate any references that are explicit in the project file. This means that if you do want to include a framework assembly in your
NuGet package, you can just add the Reference to your project file. -->
<_ExtrasImplicitReference Remove="@(Reference)" />

<!-- Add the implicit references to @(Reference) -->
<Reference Include="@(_ExtrasImplicitReference)" />
</ItemGroup>
</Project>
37 changes: 37 additions & 0 deletions src/Microsoft.NET.Sdk.WindowsForms/build/DesignerProject.props
@@ -0,0 +1,37 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>

<PropertyGroup Condition="'$(DesignerProjectPath)' == '' and '$(DesignerProjectRoot)' != ''">
<DesignerProjectPath>$(DesignerProjectRoot)/$(MSBuildProjectName).Designer</DesignerProjectPath>
</PropertyGroup>

<PropertyGroup Condition="'$(DesignerProjectPath)' != '' and Exists('$(DesignerProjectPath)')">
<WinFormsExcludes>$(DesignerProjectPath)/bin/**;$(DesignerProjectPath)/obj/**</WinFormsExcludes>
</PropertyGroup>

<ItemGroup Condition="'$(DesignerProjectPath)' != '' and Exists('$(DesignerProjectPath)') and '$(EnableDefaultItems)' == 'true'">
<Compile Include="$(DesignerProjectPath)/**/*$(_SdkLanguageExtension)" Exclude="$(DefaultItemExcludes);$(WinFormsExcludes)" Link="%(RecursiveDir)%(FileName)%(Extension)" />
<EmbeddedResource Include="$(DesignerProjectPath)/**/*.resx" Exclude="$(DefualtItemExcludes);$(WinFormsExcludes)" Link="%(RecursiveDir)%(FileName)%(Extension)" />

<None Include="$(DesignerProjectPath)/**/*" Exclude="$(DefaultItemExcludes);$(WinFormsExcludes);$(DesignerProjectPath)/**/*$(_SdkLanguageExtension);$(DesignerProjectPath)/**/*.rsx" Link="%(RecursiveDir)%(FileName)%(Extension)" Condition="'$(EnableDefaultNoneItems)' == 'true'" />
</ItemGroup>

<ItemGroup Condition="'$(DesignerProjectPath)' != '' and Exists('$(DesignerProjectPath)')">
<Compile Update="$(DesignerProjectPath)/**/*$(DefaultLanguageSourceExtension)">
<PossiblyDependentUpon>$([System.String]::Copy('%(FileName)').Replace('.Designer', ''))$(DefualtLanguageSourceExtension)</PossiblyDependentUpon>
</Compile>

<EmbeddedResource Update="$(DesignerProjectPath)/**/*.resx">
<PossiblyDependentUpon>$([System.Text.RegularExpressions.Regex]::Replace('%(FileName)', '\.[a-z]{2}-[A-Z]{2}.resx', '$(DefaultLanguageSourceExtension)'))</PossiblyDependentUpon>
</EmbeddedResource>

<Compile Update="@(Compile)" Condition="Exists('$(PossiblyDependentUpon)')">
<DependentUpon>%(Compile.PossiblyDependentUpon)</DependentUpon>
</Compile>
<EmbeddedResource Update="@(EmbeddedResource)" Condition="Exists('$(PossiblyDependentUpon)')">
<DependentUpon>%(EmbeddedResource.PossiblyDependentUpon)</DependentUpon>
</EmbeddedResource>
</ItemGroup>
</Project>

0 comments on commit 19d671b

Please sign in to comment.