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

Commit

Permalink
Added build output for .NET Core apps and UWP apps for the core Sharp…
Browse files Browse the repository at this point in the history
…DX library. Refactored some of the common properties into MSBuild .props and .targets files.
  • Loading branch information
jkoritzinsky committed Mar 19, 2017
1 parent 4b827d7 commit d330c38
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 196 deletions.
19 changes: 19 additions & 0 deletions Build/SharpDX.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<DefineConstants>$(DefineConstants);DIRECTX11_1;DIRECTX11_2;DirectX12</DefineConstants>

<PackageIconUrl>http://sharpdx.org/logo_100x100.png</PackageIconUrl>
<PackageLicenseUrl>http://sharpdx.org/License.txt</PackageLicenseUrl>
<PackageProjectUrl>http://sharpdx.org</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>SharpDX DirectX Direct3D Multimedia MDX 3D</PackageTags>

<Authors>Alexandre Mutel</Authors>
<Owners>Alexandre Mutel</Owners>
<Copyright>Copyright (c) 2010-2014 Alexandre Mutel</Copyright>
</PropertyGroup>

</Project>
59 changes: 7 additions & 52 deletions Build/SharpDX.targets
Original file line number Diff line number Diff line change
@@ -1,53 +1,8 @@
<!--
This Target file must be imported in a project using SharpDX
It adds automatically references to SharpDX assemblies
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Global property most of them are overridable in the project including this project file -->
<!-- The Most important variable is SharpDXSdkDir that should be a global system environement variable -->
<PropertyGroup>
<!--Detect SharpDX Platform based on .NETFramework version-->

<!-- Query the DirectX version to use unless already specified -->
<!-- By default: DirectX11 on desktop .NET, DirectX11_2 for Windows8.x+, DirectX11_1 for WP8 -->
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework'">DirectX11</SharpDXDirectXVersion>
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCore'">DirectX11_2</SharpDXDirectXVersion>
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == '' and '$(TargetPlatformIdentifier)' == 'WindowsPhoneApp'">DirectX11_2</SharpDXDirectXVersion>
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == '' and '$(TargetFrameworkIdentifier)' == 'WindowsPhone' and $(TargetFrameworkVersion.Contains('v8'))">DirectX11_1</SharpDXDirectXVersion>
<!-- Use latest DirectX11_2 in case we don't know the .NET framework -->
<SharpDXDirectXVersion Condition="'$(SharpDXDirectXVersion)' == ''">DirectX11_2</SharpDXDirectXVersion>

<!-- Detect the .NET Framework -->
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.5') ">net20</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and $(TargetFrameworkVersion.Contains('v4'))">net40</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCore'">winrt</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkProfile)' == 'Profile32'">winrt</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkIdentifier)' == 'WindowsPhone' and $(TargetFrameworkVersion.Contains('v8')) and '$(Platform)' != 'ARM'">wp8-x86</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetFrameworkIdentifier)' == 'WindowsPhone' and $(TargetFrameworkVersion.Contains('v8')) and '$(Platform)' == 'ARM'">wp8-ARM</SharpDXNETFramework>
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == '' and '$(TargetPlatformIdentifier)' == 'WindowsPhoneApp'">wp81</SharpDXNETFramework>

<!-- Use latest net40 in case we don't detect the .NET framework (to avoid nuget to crash when trying to add a SharpDX reference) -->
<SharpDXNETFramework Condition="'$(SharpDXNETFramework)' == ''">net40</SharpDXNETFramework>

<!-- Select Signed or not signed assemblies -->
<SharpDXSigned Condition="'$(SharpDXNoSigned)' == '' and '$(TargetFrameworkIdentifier)' != 'WindowsPhone'">Signed-</SharpDXSigned>
<SharpDXSigned Condition="'$(SharpDXNoSigned)' == 'true'"></SharpDXSigned>

<!-- Compute the full version number -->
<SharpDXPlatform Condition="'$(SharpDXPlatform)' == ''">$(SharpDXDirectXVersion)-$(SharpDXSigned)$(SharpDXNETFramework)</SharpDXPlatform>

<!-- Variable used to select the platform used for the tool at compile time - default to Win8Desktop-net40 -->
<SharpDXPlatformTool Condition="'$(SharpDXPlatformTool)' == ''">DirectX11-net40</SharpDXPlatformTool>

<!--Root SharpDX SDK Directory where assemblies are stored. This variable should be set as a Global System Environement Variable -->
<SharpDXPackageDir Condition="'$(SharpDXPackageDir)' == ''">$(MSBuildThisFileDirectory)..</SharpDXPackageDir>

<!--SharpDX Directory to link against - based on platform-->
<SharpDXPackageBinDir Condition="'$(SharpDXPackageBinDir)' == ''">$(SharpDXPackageDir)\Bin\$(SharpDXPlatform)</SharpDXPackageBinDir>

<!--SharpDX Directory used for compiling - Default to DirectX11-net40-->
<!--<SharpDXSdkToolsDir Condition="'$(SharpDXSdkToolsDir)' == ''">$(SharpDXPackageDir)\Bin\Win8Desktop-net40</SharpDXSdkToolsDir>-->
<SharpDXSdkToolsDir Condition="'$(SharpDXSdkToolsDir)' == ''">$(SharpDXPackageDir)\Bin\$(SharpDXPlatformTool)</SharpDXSdkToolsDir>
</PropertyGroup>
<Project>
<Target Name="RunGenerator" BeforeTargets="BeforeBuild">
<Exec Command="&quot;$(SolutionDir)Source\Tools\SharpGen\RunGenerator.bat&quot; $(ConfigurationName)" />
</Target>
<Target Name="PatchAssembly" AfterTargets="AfterBuild">
<Exec Command="&quot;$(SolutionDir)\Source\Bin\SharpCLI.exe&quot; &quot;$(TargetPath)&quot;" />
</Target>
</Project>
6 changes: 4 additions & 2 deletions SharpDX-Desktop.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sources", "Sources", "{CC8DB471-0644-430D-9D4B-808A2475BEC0}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -66,6 +66,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{E462D87D
Build\SharpDX.build = Build\SharpDX.build
Build\SharpDX.PostSettings.targets = Build\SharpDX.PostSettings.targets
Build\SharpDX.PreSettings.targets = Build\SharpDX.PreSettings.targets
Build\SharpDX.props = Build\SharpDX.props
Build\SharpDX.targets = Build\SharpDX.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpDX.Tests", "Source\Tests\SharpDX.Tests\SharpDX.Tests.csproj", "{931FA266-E756-41CA-9736-8B29235DC999}"
Expand Down
39 changes: 16 additions & 23 deletions Source/SharpDX/SharpDX.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)Build\SharpDX.props" />
<PropertyGroup>
<TargetFrameworks>net45;netstandard1.1</TargetFrameworks>
<!-- Disable FastUpToDate check in order to let VS to always run BeforeBuild.
Related to this issue http://connect.microsoft.com/VisualStudio/feedback/details/735718/visual-studio-2011-beta-is-incorrectly-building-solution -->
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<DefineConstants>$(DefineConstants);DIRECTX11_1;DIRECTX11_2;DirectX12</DefineConstants>

<TargetFrameworks>net45;netstandard1.1;netcoreapp1.0;uap10.0</TargetFrameworks>
<PackageId>SharpDX</PackageId>
<PackageIconUrl>http://sharpdx.org/logo_100x100.png</PackageIconUrl>
<PackageLicenseUrl>http://sharpdx.org/License.txt</PackageLicenseUrl>
<PackageProjectUrl>http://sharpdx.org</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>SharpDX DirectX Direct3D Multimedia MDX 3D</PackageTags>
<Title>SharpDX</Title>
<Authors>Alexandre Mutel</Authors>
<Owners>Alexandre Mutel</Owners>
<Copyright>Copyright (c) 2010-2014 Alexandre Mutel</Copyright>
<Description>Core assembly for all SharpDX assemblies.</Description>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'netcoreapp1.0' ">
<DefineConstants>$(DefineConstants);DESKTOP_APP</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
<DefineConstants>$(DefineConstants);STORE_APP;WINDOWS_API_SET</DefineConstants>
</PropertyGroup>
<ItemGroup>
<None Include="Mapping-core.xml" />
<None Include="Direct3D\Mapping.xml" />
Expand All @@ -33,10 +24,12 @@
</Compile>
</ItemGroup>

<Target Name="RunGenerator" BeforeTargets="BeforeBuild">
<Exec Command="&quot;$(SolutionDir)Source\Tools\SharpGen\RunGenerator.bat&quot; $(ConfigurationName)" />
</Target>
<Target Name="PatchAssembly" AfterTargets="AfterBuild">
<Exec Command="&quot;$(SolutionDir)\Source\Bin\SharpCLI.exe&quot; &quot;$(TargetPath)&quot;" />
</Target>
<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.0.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform " Version="5.2.2" />
</ItemGroup>
<Import Project="$(SolutionDir)Build\SharpDX.targets" />
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
117 changes: 0 additions & 117 deletions Source/SharpDX/SharpJit.cs

This file was deleted.

7 changes: 5 additions & 2 deletions Source/SharpDX/Text/ASCIIEncoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ namespace SharpDX.Text
/// </summary>
public abstract class Encoding : System.Text.Encoding
{
#if NETSTANDARD1_1
/// <summary>
/// Returns an encoding for the ASCII character set. The returned encoding
/// will be an instance of the ASCIIEncoding class.
/// </summary>
public static readonly ASCIIEncoding ASCII = new ASCIIEncoding();
public static readonly System.Text.Encoding ASCII = new ASCIIEncoding();
#endif
}

#if NETSTANDARD1_1
/// <summary>
/// Provides a basic implementation to replace <see cref="System.Text.ASCIIEncoding"/> (not available on Win8 Modern App).
/// </summary>
Expand Down Expand Up @@ -75,4 +77,5 @@ public string GetString(byte[] bytes)
return base.GetString(bytes, 0, bytes.Length);
}
}
#endif
}

0 comments on commit d330c38

Please sign in to comment.