[ 
https://issues.apache.org/jira/browse/CB-8053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14221389#comment-14221389
 ] 

ASF subversion and git services commented on CB-8053:
-----------------------------------------------------

Commit 623233d099d7874be134fe4a9e0b645a7426eb57 in cordova-lib's branch 
refs/heads/master from [~TimBarham]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=623233d ]

CB-8053: Including a project reference in a plugin fails on Windows platform.

When working with the Windows platform, the existing logic to add a project 
reference was expecting two things:

1. There would only be one solution file.
2. That solution file would only contain a single project.

This is no longer true - there are now two solution files (one for VS 2012 and 
one for VS 2013). The VS 2013 solution is for a universal project, and contains 
five projects.

The change here is to make the code (in cordova-lib/src/util/windows/jsproj.js) 
which modifies the solution file more versatile by:

1. Handling any number of solution files (iterate all solution files we find).
2. Handling any number of projects in the solution (add the build depedency to 
every jsproj in the solution).

Includes matching changes to removeProjectReference(), and fixes a call in 
cordova-lib/src/plugman/platforms/windows.js to pass the correct path for 
plugin_dir.


> Including a project reference in a plugin fails on Windows platform
> -------------------------------------------------------------------
>
>                 Key: CB-8053
>                 URL: https://issues.apache.org/jira/browse/CB-8053
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows
>    Affects Versions: 3.5.0
>         Environment: Windows
>            Reporter: Tim Barham
>              Labels: plugin, windows
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Create a plugin that supports the Windows platform. In plugin.xml, include a 
> project reference - for example:
>   <platform name="windows">
>     <framework src="src/MyWinRTAPI/MyWinRTAPI.vcxproj" custom="true" 
> type="projectReference"/>
>   </platform>
> Add the plugin to a project, then add the Windows platform (or vice versa), 
> results in error "too many projects in solution" in 
> cordova-lib/src/util/windows/jsproj.js. For example, output from cordova 
> platform add windows --verbose:
> Writing out cordova_plugins.js...
> Installing plugin "cpp.plugin" following successful platform add of windows
> Installing "cpp.plugin" for windows
> Install start for "cpp.plugin" on windows.
> Beginning processing of action stack for windows project...
> Parsing windows project files...
> creating jsproj from project at : %USERPROFILE%\Documents\Visual Studio 
> 2013\Projects\WinRTCPP\WinRTCPP\bld\Debug\platforms\windows\CordovaApp.projitems
> windows8 framework install :: cpp.plugin
> adding project reference to %USERPROFILE%\Documents\Visual Studio 
> 2013\Projects\WinRTCPP\WinRTCPP\bld\Debug\plugins\cpp.plugin\src\MyWinRTAPI\MyWinRTAPI.vcxproj
> Error during processing of action! Attempting to revert...
> Failed to install 'cpp.plugin':Error: Uh oh!
> too many projects in solution.
>     at Object.jsproj.addProjectReference 
> (%APPDATA%\npm\node_modules\cordova\node_modules\cordova-lib\src\util\windows\jsproj.js:196:19)
>     at module.exports.framework.install 
> (%APPDATA%\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\platforms\windows.js:116:30)
>     at Object.ActionStack.process 
> (%APPDATA%\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\action-stack.js:72:25)
>     at handleInstall 
> (%APPDATA%\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:591:20)
>     at 
> %APPDATA%\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:340:28
>     at _fulfilled 
> (%APPDATA%\npm\node_modules\cordova\node_modules\q\q.js:798:54)
>     at self.promiseDispatch.done 
> (%APPDATA%\npm\node_modules\cordova\node_modules\q\q.js:827:30)
>     at Promise.promise.promiseDispatch 
> (%APPDATA%\npm\node_modules\cordova\node_modules\q\q.js:760:13)
>     at %APPDATA%\npm\node_modules\cordova\node_modules\q\q.js:526:49
>     at flush (%APPDATA%\npm\node_modules\cordova\node_modules\q\q.js:108:17)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to