Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Visual Studio shared project file #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions json-streaming-parser.vcxitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding ="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<PropertyGroup Label="Globals" >
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<ItemsProjectGuid>{bcb04585-d7e1-4109-859b-6d5a59f30dc8}</ItemsProjectGuid>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectCapability Include="SourceItemsFromImports" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)JsonListener.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)JsonStreamingParser.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)JsonListener.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)JsonStreamingParser.h" />
</ItemGroup>
<ItemGroup>
<Text Include="$(MSBuildThisFileDirectory)library.properties" />
<Text Include="$(MSBuildThisFileDirectory)vs-readme.txt" />
</ItemGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory).gitignore" />
<None Include="$(MSBuildThisFileDirectory).travis.yml" />
<None Include="$(MSBuildThisFileDirectory)library.json" />
<None Include="$(MSBuildThisFileDirectory)LICENSE" />
<None Include="$(MSBuildThisFileDirectory)README.md" />
</ItemGroup>
</Project>
30 changes: 30 additions & 0 deletions vs-readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Welcome to Visual Micro shared Arduino library projects

This file can be deleted after it has been read.

Normally, for Arduino, libraries have to exist in one of a few specified folder(s). However a Visual Studio shared project library can exist in any location.

Another benefit of shared library projects is that they support the standard Visual Micro debugging.

About shared Arduino library shared projects

A Visual Studio shared project library is one that simply contains a Visual Studio .vxitems file instead of the usual .vcxproj file. These are the "Project" files that contain the links to the source code shown in the Solution Explorer.

An existing ".vcxitems" file can be be added to any Visual Studio solution using "File>Add>Existing Project" or created using "File>New>Project>C++>Misc>Shared Project"

Visual Micro has created this one for you along with a .vcxitems file.

To ensure this library remains compatible with both Arduino and Visual Micro ensure that the library folder name, the .vcxitems file name and a .h name must all match. Also ensure that an Arduino format "library.properties" file exists in this folder.

If you would like this library to be organised into a virtual folder with other libraries the create a new "Solution Folder" using the Solution Explorer content menu and drag/move this library folder.

If you want to move/copy this library to a different location then remove it from this solution, physically move this folder using windows explorer and then use "File>Add>Existing Project" to re-add to this solution. Visual Studio will not auto detect the move so you will need to remove the "Shared Project Reference" you added to any arduino projects and then re-add the Reference.

!!IMPORTANT NOTE!!

To ensure that Visual Studio intellisense works correctly with a shared project or shared library it is IMPORTANT to add a "Reference" from your standard Arduino project(s) to this library. To this by right clicking the project, click "Add Reference". When the Add Reference window opens click "Shared Projects" and you will see your shared project in the list. Check it and click OK.

When editing shared project code, you will find that shared projects can not be started directly and are not associated to specific hardware, board or architecure. Instead, intellisense will dynamically adjust for the current "Visual Studio Startup Project".

More information is here https://www.visualmicro.com/post/2017/01/16/Arduino-Cross-Platform-Library-Development.aspx