[
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2016 Marc Goodner\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# vclinux\nUnofficial scripts and stuff related to the [Visual C++ for Linux Development extension](http://aka.ms/vslinux). \n\nYes I'm the program manger for that but this is stuff I've made on the side. Think about it. If this was good enough to ship it'd be in the box right?\n\nI hope you find this useful, especially for modifying to fit for your needs. If you have any comments or suggestions I'd love to hear them.\n\n## Project generation bash scripts\n\n### genvcxproj.sh\nThis script generates a VC Linux project file that includes your source files from the directory specified. The project type is makefile and it is set to not copy sources since the assumption here is the files have been mapped to a Windows drive.\n\nThis leaves your source in a flat list. To organize your files as seen in your directory use genfilters.sh to generate an accompanying filter file.\n\nThe assumption this script has is that your source code is on a Linux machine and that this directory has been mapped to Windows so the code can be edited in Visual Studio.\n\nInput for this script is:\n1. is the directory of source code to create a project file for\n2. is file name to create, should be projectname.vcxproj\n\nExample usage:\n```\n$ ./genvcxproj.sh ~/repos/preciouscode/ preciouscode.vcxproj\n```\n\nOnce you have your project open in Visual Studio connect to your Linux machine using the extension, [as shown here](https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/#consoleapp).\nNow add any paths needed for your includes to light up intellisense, and setup your remote build command line on the property page. This is specific to your project but would be something like:\n```\ncd ~/repos/preciouscode/; make\n```\nAs you can see multiple commands can be used ; seperated.\n\n### genfilters.sh\nThis script generates a filter file for organizing source files in a VC Linux project based on the directory structure. The filter file must be the same name as your project file + .filters. So if your project file is preciouscode.vcxproj your filter file needs to be named preciouscode.vcxproj.filters. \n\nThe assumption this script has is that your source code is on a Linux machine and that this directory has been mapped to Windows so the code can be edited in Visual Studio.\n\nTo generate a project file for your source code see genvcxproj.sh\n\n1. is the directory of source code to create project filters from\n2. is file name to create, should be projectname.vcxproj.filters\n\nExample usage:\n```\n$ ./genfilters.sh ~/repos/preciouscode/ preciouscode.vcxproj.filters\n```"
  },
  {
    "path": "bash/genfilters.sh",
    "content": "#!/bin/bash\n# Here for latest: https://github.com/robotdad/vclinux\n#\n# This script generates a filter file for organizing source files in a VC Linux project based on the directory structure.\n# The filter file must be the same name as your project file + .filters. \n# So if your project file is preciouscode.vcxproj your filter file needs to be named preciouscode.vcxproj.filters. \n#\n# The assumption this script has is that your source code is on a Linux machine and that\n#  this directory has been mapped to Windows so the code can be edited in Visual Studio.\n# To generate a project file for your source code see genvcxproj.sh\n#\n# You can find out more about VC++ for Linux here: http://aka.ms/vslinux\n#\n# Usage:\n# $1 is the directory of source code to create project filters from\n# $2 is file name to create, should be projectname.vcxproj.filters\n# $3 is the root of your Windows fodler where these files will be mapped\n# the meat of this is after the printheader/footer functions\n\nfunction printheader(){\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\n<Project ToolsVersion=\\\"4.0\\\" xmlns=\\\"http://schemas.microsoft.com/developer/msbuild/2003\\\">\"\n}\n\nfunction printfooter(){\n echo \"</Project>\"\n}\n\nfunction listfilters(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type d)\n do\n   f=${i##./}\n   f=${f//\\//\\\\}\n   uuid=\"$(uuidgen)\"\n   printf \"    <Filter Include=\\\"%s\\\">\\n\" \"$f\"\n   printf \"      <UniqueIdentifier>{%s}</UniqueIdentifier>\\n\" \"$uuid\"\n   printf \"    </Filter>\\n\"\n done\n echo \"  </ItemGroup>\"\n}\n\nfunction listothers(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f ! -iname \"*.c\" ! -iname \"*.cpp\" ! -iname \"*.h\" ! -iname \"*.txt\" ! -iname \"*.o\" ! -iname \"*.vcxproj\")\n do\n   d=${i%/*}\n   fd=${d##*/}\n   fp=${d##./}\n   fp=${fp//\\//\\\\}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   if [ $fd = \".\" ]\n   then\n     printf \"    <None Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n   else\n     printf \"    <None Include=\\\"%s\\\\%s\\\" >\\n\" \"$d\" \"$f\"\n     printf \"      <Filter>%s</Filter>\\n\" \"$fp\"\n     printf \"    </None>\\n\"\n   fi\n done\n echo \"  </ItemGroup>\"\n}\n\nfunction listtxt(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.txt\")\n do\n   d=${i%/*}\n   fd=${d##*/}\n   fp=${d##./}\n   fp=${fp//\\//\\\\}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   if [ $fd = \".\" ]\n   then\n     printf \"    <Text Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n   else\n     printf \"    <Text Include=\\\"%s\\\\%s\\\">\\n\" \"$d\" \"$f\"\n     printf \"      <Filter>%s</Filter>\\n\" \"$fp\"\n     printf \"    </Text>\\n\"\n   fi\n done\n echo \"  </ItemGroup>\"\n}\n\nfunction listcompile(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.c\" -or -iname \"*.cpp\")\n do\n   d=${i%/*}\n   fd=${d##*/}\n   fd=${d##*/}\n   fp=${d##./}\n   fp=${fp//\\//\\\\}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   if [ $fd = \".\" ]\n   then\n     printf \"    <ClCompile Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n   else\n     printf \"    <ClCompile Include=\\\"%s\\\\%s\\\">\\n\" \"$d\" \"$f\"\n     printf \"      <Filter>%s</Filter>\\n\" \"$fp\"\n     printf \"    </ClCompile>\\n\" \"$d\" \"$f\"\n   fi \ndone\n echo \"  </ItemGroup>\"\n}\n\n\nfunction listinclude(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.h\")\n do\n   d=${i%/*}\n   fd=${d##*/}\n   fd=${d##*/}\n   fp=${d##./}\n   fp=${fp//\\//\\\\}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   if [ $fd = \".\" ]\n   then\n     printf \"    <ClInclude Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n   else\n     printf \"    <ClInclude Include=\\\"%s\\\\%s\\\">\\n\" \"$d\" \"$f\"\n     printf \"      <Filter>%s</Filter>\\n\" \"$fp\"\n     printf \"    </ClInclude>\\n\" \n   fi\n done\n echo \"  </ItemGroup>\"\n}\n\ncd $1 || exit 2;\ntouch $2 && test -w $2 || exit 2;\nprintheader > $2\nlistfilters >> $2\nlistothers >> $2\nlisttxt >> $2\nlistcompile >> $2\nlistinclude >> $2\nprintfooter >> $2\nexit\n"
  },
  {
    "path": "bash/genvcxproj.sh",
    "content": "#!/bin/bash\n# Here for latest: https://github.com/robotdad/vclinux \n#\n# This script generates a VC Linux project file that includes your source files from the directory specified.\n# The project type is makefile and it is set to not copy sources since the assumption here is the files have \n#  been mapped to a Windows drive.\n#\n# This leaves your source in a flat list. \n# To organize your files as seen in your directory use genfilters.sh to generate an accompanying filter file.\n#\n# The assumption this script has is that your source code is on a Linux machine and that\n#  this directory has been mapped to Windows so the code can be edited in Visual Studio.\n#\n# You can find out more about VC++ for Linux here: http://aka.ms/vslinux\n# Usage:\n# $1 is the directory of source code to create a project file for\n# $2 is file name to create, should be projectname.vcxproj\n# $3 is the root of your Windows fodler where these files will be mapped\n# the meat of this is after the printheader/footer functions\n\nfunction printheader(){\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\n<Project DefaultTargets=\\\"Build\\\" ToolsVersion=\\\"14.0\\\" xmlns=\\\"http://schemas.microsoft.com/developer/msbuild/2003\\\">\n  <ItemGroup Label=\\\"ProjectConfigurations\\\">\n    <ProjectConfiguration Include=\\\"Debug|ARM\\\">\n      <Configuration>Debug</Configuration>\n      <Platform>ARM</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\\\"Release|ARM\\\">\n      <Configuration>Release</Configuration>\n      <Platform>ARM</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\\\"Debug|x86\\\">\n      <Configuration>Debug</Configuration>\n      <Platform>x86</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\\\"Release|x86\\\">\n      <Configuration>Release</Configuration>\n      <Platform>x86</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\\\"Debug|x64\\\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\\\"Release|x64\\\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <PropertyGroup Label=\\\"Globals\\\">\n    <ProjectGuid>{d14472f1-e80c-4d22-a2b5-6694cdc04c48}</ProjectGuid>\n    <Keyword>Linux</Keyword>\n    <RootNamespace>makefile</RootNamespace>\n    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>\n    <ApplicationType>Linux</ApplicationType>\n    <ApplicationTypeRevision>1.0</ApplicationTypeRevision>\n    <TargetLinuxPlatform>Generic</TargetLinuxPlatform>\n    <LinuxProjectType>{FC1A4D80-50E9-41DA-9192-61C0DBAA00D2}</LinuxProjectType>\n  </PropertyGroup>\n  <Import Project=\\\"\\$(VCTargetsPath)\\Microsoft.Cpp.Default.props\\\" />\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|ARM'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|ARM'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|x86'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|x86'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|x64'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|x64'\\\" Label=\\\"Configuration\\\">\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <ConfigurationType>Makefile</ConfigurationType>\n  </PropertyGroup>\n  <Import Project=\\\"\\$(VCTargetsPath)\\Microsoft.Cpp.props\\\" />\n  <ImportGroup Label=\\\"ExtensionSettings\\\" />\n  <ImportGroup Label=\\\"Shared\\\" />\n  <ImportGroup Label=\\\"PropertySheets\\\" />\n  <PropertyGroup Label=\\\"UserMacros\\\" />\n    <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|ARM'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|x64'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Debug|x86'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\n    <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|ARM'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|x64'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\n  <PropertyGroup Condition=\\\"'\\$(Configuration)|\\$(Platform)'=='Release|x86'\\\">\n    <LocalRemoteCopySources>false</LocalRemoteCopySources>\n  </PropertyGroup>\"\n}\n\nfunction printfooter(){\n echo \"  <ItemDefinitionGroup />\n  <Import Project=\\\"\\$(VCTargetsPath)\\Microsoft.Cpp.targets\\\" />\n  <ImportGroup Label=\\\"ExtensionTargets\\\" />\n</Project>\"\n}\n\nfunction listothers(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f ! -iname \"*.c\" ! -iname \"*.cpp\" ! -iname \"*.h\" ! -iname \"*.txt\" ! -iname \"*.o\" ! -iname \"*.vcxproj\" ! -iname \"*.filters\")\n do\n   d=${i%/*}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   printf \"    <None Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n done\n echo \"  </ItemGroup>\"\n}\n\nfunction listtxt(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.txt\")\n do\n   d=${i%/*}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   printf \"    <Text Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n done\n echo \"  </ItemGroup>\"\n}\n\nfunction listcompile(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.c\" -or -iname \"*.cpp\")\n do\n   d=${i%/*}\n   d=${d//\\//\\\\}\n   f=${i##*/}\n   printf \"    <ClCompile Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n done\n echo \"  </ItemGroup>\"\n}\n\n\nfunction listinclude(){\n echo \"  <ItemGroup>\"\n for i in $(find . -not -path '*/\\.*' -type f -iname \"*.h\")\n do\n   d=${i%/*}\n   d=${d//\\//\\\\}\n   d=${d/.}\n   f=${i##*/}\n   printf \"    <ClInclude Include=\\\"%s\\\\%s\\\" />\\n\" \"$d\" \"$f\"\n done\n echo \"  </ItemGroup>\"\n}\n\ncd $1 || exit 2;\ntouch $2 && test -w $2 || exit 2;\nprintheader > $2\nlistothers >> $2\nlisttxt >> $2\nlistcompile >> $2\nlistinclude >> $2\nprintfooter >> $2\nexit\n"
  }
]