Skip to content

Commit

Permalink
Updated for the latest Visual Studio 2022
Browse files Browse the repository at this point in the history
Added a 2022 specific plug in
  • Loading branch information
burgerbecky committed Nov 15, 2022
1 parent a679c4d commit 45fadd3
Show file tree
Hide file tree
Showing 12 changed files with 254 additions and 56 deletions.
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# This file tells Git about engine files that never really belong in source control. They are usually build products, log
# files and intermediate files generated from a compiler or the engine runtime.
#
#
# NOTE:
# Paths that start with / match paths relative to the root (where the .gitignore file is)
# Paths that end with / will match a folder and all files under it (but not a regular file with no extension)
# Use * for wildcards. Wildcards stop at path separators
# Use ** for a wildcard that spans path separators
# Paths in this file should use forward slash characters, not back slashes
# Use \ to escape special characters like ! and #
# Use ! to negate a previous pattern. But it doesn't work if the parent sub-folder was masked out already.
#


# Ignore project files in the root
**/bin
**/temp
**/ipch
**/* Data
**/*_Data
**/xcuserdata
**/.vs
**/obj
**/build

# IDE droppings
*.snk
*.suo
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Please?

--------------------------------------------

Copyright (c) 2015 Rebecca Ann Heineman
Copyright (c) 2015-2022 Rebecca Ann Heineman

--------------------------------------------

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ IDE and the [June 2010 or later Direct X SDK](https://www.microsoft.com/en-us/do

Download it directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=BurgerBecky.hlslvs2012)

### For Visual Studio 2019 and later
### For Visual Studio 2019

Download it directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=BurgerBecky.hlslvs2019)

### For Visual Studio 2022

Download it directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=BurgerBecky.hlslvs2022)

## How to use it

After installation, open a project file and select BuildCustomizations as shown:
Expand All @@ -43,11 +47,15 @@ All files that end with the suffix of *.hlsl will automatically map to this tool

The source code to the tool is in the folder "BuildCustomizations" on [Github](https://github.com/burgerbecky/hlslvisualstudio). Pull requests and bug reports are encouraged.

## Build prerequisite

In the extensions, install *Microsoft Visual Studio Installer Projects* so Visual Studio can load the \*.vdproj files

-------

## License

Copyright 2015-2019 by Rebecca Ann Heineman becky@burgerbecky.com
Copyright 2015-2022 by Rebecca Ann Heineman becky@burgerbecky.com

It is released under an MIT Open Source license. Please see LICENSE.txt for license details. Yes, you can use it in a commercial title without paying anything, just give me a credit.

Expand Down
71 changes: 34 additions & 37 deletions build_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
Copy up the HLSL visual studio plug in to sdks/visualstudio
Copyright 1995-2014 by Rebecca Ann Heineman becky@burgerbecky.com
Copyright 1995-2022 by Rebecca Ann Heineman becky@burgerbecky.com
It is released under an MIT Open Source license. Please see LICENSE
for license details. Yes, you can use it in a
Expand All @@ -16,50 +16,47 @@

import os
import sys
from burger import clean_files, clean_directories
from burger import clean_directories, clean_files

# Unused arguments
# pylint: disable=W0613
# ``cleanme`` will process any child directory with the clean() function if
# True.
CLEANME_GENERIC = True

# ``cleanme`` will assume only the function ``clean()`` is used if True.
CLEANME_PROCESS_PROJECT_FILES = False

def rules(command, working_directory=None, root=True, **kargs):
"""
Main entry point for build_rules.py.
When ``makeprojects``, ``cleanme``, or ``buildme`` is executed, they will
call this function to perform the actions required for build customization.
The parameter ``working_directory`` is required, and if it has no default
parameter, this function will only be called with the folder that this
file resides in. If there is a default parameter of ``None``, it will be
called with any folder that it is invoked on. If the default parameter is a
directory, this function will only be called if that directory is desired.
The optional parameter of ``root``` alerts the tool if subsequent processing
of other ``build_rules.py`` files are needed or if set to have a default
parameter of ``True``, processing will end once the calls to this
``rules()`` function are completed.
Commands are 'build', 'clean', 'prebuild', 'postbuild', 'project',
'configurations'
Arg:
command: Command to execute.
working_directory: Directory for this function to operate on.
root: If True, stop execution upon completion of this function
kargs: Extra arguments specific to each command.
Return:
Zero on no error or no action.
# Process listed folders using their rules before processing this folder.
DEPENDENCIES = ['install_pre_2017', 'install_2017',
'install_2019', 'install_2022']

########################################


def clean(working_directory):
"""
Delete temporary files.
if command == 'clean':
clean_directories(
working_directory, ('bin', 'obj', 'Properties', '.vs'))
clean_files(working_directory, ('Key.snk', '*.user', '*.suo'))
This function is called by ``cleanme`` to remove temporary files.
On exit, return 0 for no error, or a non zero error code if there was an
error to report.
Args:
working_directory
Directory this script resides in.
Returns:
None if not implemented, otherwise an integer error code.
"""

clean_directories(
working_directory,
('bin', 'temp', 'obj', 'Properties', '.vs', '.vscode', 'build'))
clean_files(working_directory, ('Key.snk', '*.user', '*.suo'))
clean_files(working_directory, ('*.msi', ), True)
return 0


# If called as a command line and not a class, perform the build
if __name__ == "__main__":
sys.exit(rules('build', os.path.dirname(os.path.abspath(__file__))))
sys.exit(clean(os.path.dirname(os.path.abspath(__file__))))
4 changes: 2 additions & 2 deletions install_2017/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="hlsl2012.burgerbecky.e8a63418-a961-46fa-9c75-e25ecdcaae42" Version="1.0.3" Language="en-US" Publisher="Rebecca Ann Heineman" />
<Identity Id="hlsl2012.burgerbecky.e8a63418-a961-46fa-9c75-e25ecdcaae42" Version="1.0.5" Language="en-US" Publisher="Rebecca Ann Heineman" />
<DisplayName>HLSL Visual Studio 2017 fxc Compiler</DisplayName>
<Description xml:space="preserve">This is a plug in for Visual Studio 2017 that will allow files with the HLSL extension to automatically be compiled with the fxc tool found in the DirectX SDK. Requires the DirectX SDK to be installed https://www.microsoft.com/en-us/download/details.aspx?id=6812 The tool will be listed as "Effect-Compiler Tool" Versions compatible with earlier versions of Visual Studio can be found here: https://github.com/burgerbecky/hlslvisualstudio</Description>
<MoreInfo>https://github.com/burgerbecky/hlslvisualstudio</MoreInfo>
Expand All @@ -11,7 +11,7 @@
<Tags>hlsl, directx, fxc, shader, build, buildcustomizations, compiler, game, graphics</Tags>
</Metadata>
<Installation AllUsers="true">
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,16.0)" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.IntegratedShell" />
Expand Down
12 changes: 6 additions & 6 deletions install_2019/hlsl_2019.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,37 +52,37 @@
<Content Include="..\BuildCustomizations\hlsl.xml">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v150\BuildCustomizations\hlsl.xml</TargetPath>
<TargetPath>VC\v160\BuildCustomizations\hlsl.xml</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.props">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v150\BuildCustomizations\hlsl.props</TargetPath>
<TargetPath>VC\v160\BuildCustomizations\hlsl.props</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.targets">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v150\BuildCustomizations\hlsl.targets</TargetPath>
<TargetPath>VC\v160\BuildCustomizations\hlsl.targets</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.xml">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v160\BuildCustomizations\hlsl.xml</TargetPath>
<TargetPath>VC\v170\BuildCustomizations\hlsl.xml</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.props">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v160\BuildCustomizations\hlsl.props</TargetPath>
<TargetPath>VC\v170\BuildCustomizations\hlsl.props</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.targets">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v160\BuildCustomizations\hlsl.targets</TargetPath>
<TargetPath>VC\v170\BuildCustomizations\hlsl.targets</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\LICENSE.txt">
Expand Down
6 changes: 3 additions & 3 deletions install_2019/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="hlsl2019.burgerbecky.ac430f7e-0643-4120-b427-06fed4a16678" Version="1.0.3" Language="en-US" Publisher="Rebecca Ann Heineman" />
<DisplayName>HLSL Visual Studio 2019+ fxc Compiler</DisplayName>
<Description xml:space="preserve">This is a plug in for Visual Studio 2019 or higher that will allow files with the HLSL extension to automatically be compiled with the fxc tool found in the DirectX SDK. Requires the DirectX SDK to be installed https://www.microsoft.com/en-us/download/details.aspx?id=6812 The tool will be listed as "Effect-Compiler Tool" Versions compatible with earlier versions of Visual Studio can be found here: https://github.com/burgerbecky/hlslvisualstudio</Description>
<Identity Id="hlsl2019.burgerbecky.ac430f7e-0643-4120-b427-06fed4a16678" Version="1.0.5" Language="en-US" Publisher="Rebecca Ann Heineman" />
<DisplayName>HLSL Visual Studio 2019 fxc Compiler</DisplayName>
<Description xml:space="preserve">This is a plug in for Visual Studio 2019 that will allow files with the HLSL extension to automatically be compiled with the fxc tool found in the DirectX SDK. Requires the DirectX SDK to be installed https://www.microsoft.com/en-us/download/details.aspx?id=6812 The tool will be listed as "Effect-Compiler Tool" Versions compatible with earlier versions of Visual Studio can be found here: https://github.com/burgerbecky/hlslvisualstudio</Description>
<MoreInfo>https://github.com/burgerbecky/hlslvisualstudio</MoreInfo>
<GettingStartedGuide>https://github.com/burgerbecky/hlslvisualstudio/blob/master/README.md</GettingStartedGuide>
<Icon>Resources\burgericon.png</Icon>
Expand Down
87 changes: 87 additions & 0 deletions install_2022/hlsl_2022.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{C816318B-C56B-4FB2-9392-531B811BFB25}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>hlsl_vs2022</RootNamespace>
<AssemblyName>hlsl-vs2022</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<StartAction>Program</StartAction>
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
<StartArguments>/rootsuffix Exp</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\bin\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DeployExtension>False</DeployExtension>
<CopyVsixExtensionFiles>False</CopyVsixExtensionFiles>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Content Include="..\Resources\burgericon.png">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\BuildCustomizations\hlsl.xml">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v170\BuildCustomizations\hlsl.xml</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.props">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v170\BuildCustomizations\hlsl.props</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\BuildCustomizations\hlsl.targets">
<IncludeInVSIX>true</IncludeInVSIX>
<InstallRoot>MSBuild</InstallRoot>
<TargetPath>VC\v170\BuildCustomizations\hlsl.targets</TargetPath>
<VSIXSubPath>Microsoft</VSIXSubPath>
</Content>
<Content Include="..\LICENSE.txt">
<TargetPath>LICENSE.txt</TargetPath>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
<None Include="Key.snk" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup>
<PreBuildEvent>if not exist $(ProjectDir)Key.snk ("$(TargetFrameworkSDKToolsDirectory)\x64\sn.exe" -k $(ProjectDir)Key.snk)</PreBuildEvent>
</PropertyGroup>
</Project>
22 changes: 22 additions & 0 deletions install_2022/hlsl_2022.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hlsl_2022", "hlsl_2022.csproj", "{C816318B-C56B-4FB2-9392-531B811BFB25}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C816318B-C56B-4FB2-9392-531B811BFB25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C816318B-C56B-4FB2-9392-531B811BFB25}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD0FC803-C28B-4327-A129-CFB35C873897}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 45fadd3

Please sign in to comment.