grunt-vsembed
Include and embed files in Visual Studio projects
Getting Started
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-vsembed --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-vsembed');
The "vsembed" task
Overview
In your project's Gruntfile, add a section named vsembed
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
vsembed: {
src: ['to_embed/**/*'],
dest: 'Myproject.csproj'
},
});
Usage Examples
Default options
In this example, the default options are used to add all files matching 'src' selector as embedded resource. The directory structure used is described below.
+-- MyProject.csproj
+-- to_embed
¦ +-- rootpage.html
+-- resources
¦ +-- page1.html
grunt.initConfig({
vsembed: {
embed_files: {
src: ['to_embed/**/*'],
dest: 'MyProject.csproj'
},
},
});
Resulting items
<ItemGroup>
<EmbeddedResource Include="to_embed\rootpage.html"/>
<EmbeddedResource Include="to_embed\resources\page1.html"/>
</ItemGroup>
When the files matching 'src' are already found in the project, they are converted to EmbeddedResources.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
2016-04-11 v0.1.0 First version
2016-04-11 v0.1.2 Fixing typos
2016-04-11 v0.1.3 Simplified code
2016-04-16 v0.2.0 Changed to use GRUNT file logic and added including support
2016-04-16 v0.2.1 Updated README
2016-04-16 v0.2.2 Minor fixes