The Cordova .jsproj project .jsproj is a regular assembly file that is processed by MSBuild, so you can apply any processing logic by adding custom targets. You can even run tools from the world of Node.js, such as Grunt or Gulp, by installing the appropriate VS extensions.
Regarding code sharing between ASP.NET and Cordova projects, I suggest adding links to your .jsproj as follows:
<PropertyGroup> <AspNetProject>C:\YourAspNetProject</AspNetProject> </PropertyGroup> <ItemGroup> <Content Include="$(AspNetProject)\Views\**\*.cshtml"> <Link>views\%(RecursiveDir)%(FileName).html</Link> </Content> </ItemGroup>
In this way, VS displays related files in Solution Explorer and allows you to edit them as if they were local.
Unfortunately, the current version of VS Tools for Apache Cordova, CTP3, does not support related items, so in your .jsproj you need to make the following change:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CordovaTools\vs-mda-targets\Microsoft.MDA.targets" /> <PropertyGroup> <BuildDependsOn>PreBuild;$(BuildDependsOn)</BuildDependsOn> </PropertyGroup> <Target Name="PreBuild"> <ItemGroup> <LinkedFiles Include="@(Content)" Condition="'%(Content.Link)' != ''" /> </ItemGroup> <Copy SourceFiles="%(LinkedFiles.Identity)" DestinationFiles="%(LinkedFiles.Link)" /> </Target>
The PreBuild task PreBuild called before any Build subtask and copies the related files to your project in Cordoba. The rest of the build process runs as usual.
source share