fixed an issue in csproj and start of tests for it
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/d3ba3a51 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/d3ba3a51 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/d3ba3a51 Branch: refs/heads/master Commit: d3ba3a51be78e49e852b7e53bb2bc934371baa5e Parents: 05f52ab Author: Fil Maj <[email protected]> Authored: Fri May 17 15:47:11 2013 -0700 Committer: Fil Maj <[email protected]> Committed: Fri May 17 16:46:01 2013 -0700 ---------------------------------------------------------------------- spec/projects/FriendSting-Info.plist | 78 ---------- spec/projects/wp7/CordovaAppProj.csproj | 205 ++++++++++++++++++++++++++ spec/util/csproj.spec.js | 24 +++ src/util/csproj.js | 2 +- 4 files changed, 230 insertions(+), 79 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d3ba3a51/spec/projects/FriendSting-Info.plist ---------------------------------------------------------------------- diff --git a/spec/projects/FriendSting-Info.plist b/spec/projects/FriendSting-Info.plist deleted file mode 100644 index 6010b61..0000000 --- a/spec/projects/FriendSting-Info.plist +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<!-- -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---> -<plist version="1.0"> -<dict> - <key>CFBundleIcons</key> - <dict> - <key>CFBundlePrimaryIcon</key> - <dict> - <key>CFBundleIconFiles</key> - <array> - <string>icon.png</string> - <string>[email protected]</string> - <string>icon-72.png</string> - <string>[email protected]</string> - </array> - <key>UIPrerenderedIcon</key> - <false/> - </dict> - </dict> - <key>UISupportedInterfaceOrientations~ipad</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationLandscapeLeft</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - <string>UIInterfaceOrientationLandscapeRight</string> - </array> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - </array> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleDisplayName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleIconFile</key> - <string>icon.png</string> - <key>CFBundleIdentifier</key> - <string>com.example.friendstring</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>LSRequiresIPhoneOS</key> - <true/> - <key>NSMainNibFile</key> - <string></string> - <key>NSMainNibFile~ipad</key> - <string></string> -</dict> -</plist> http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d3ba3a51/spec/projects/wp7/CordovaAppProj.csproj ---------------------------------------------------------------------- diff --git a/spec/projects/wp7/CordovaAppProj.csproj b/spec/projects/wp7/CordovaAppProj.csproj new file mode 100644 index 0000000..560c1d7 --- /dev/null +++ b/spec/projects/wp7/CordovaAppProj.csproj @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>10.0.20506</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{3677C1B7-D68B-4CF9-BF8A-E869D437A6DF}</ProjectGuid> + <ProjectTypeGuids>{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>$safeprojectname$</RootNamespace> + <AssemblyName>$safeprojectname$</AssemblyName> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> + <TargetFrameworkProfile>WindowsPhone71</TargetFrameworkProfile> + <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> + <SilverlightApplication>true</SilverlightApplication> + <SupportedCultures> + </SupportedCultures> + <XapOutputs>true</XapOutputs> + <GenerateSilverlightManifest>true</GenerateSilverlightManifest> + <XapFilename>$safeprojectname$.xap</XapFilename> + <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate> + <SilverlightAppEntry>$safeprojectname$.App</SilverlightAppEntry> + <ValidateXaml>true</ValidateXaml> + <ThrowErrorsInValidation>true</ThrowErrorsInValidation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>Bin\Debug</OutputPath> + <DefineConstants>DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants> + <NoStdLib>true</NoStdLib> + <NoConfig>true</NoConfig> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>Bin\Release</OutputPath> + <DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE</DefineConstants> + <NoStdLib>true</NoStdLib> + <NoConfig>true</NoConfig> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Microsoft.Devices.Sensors" /> + <Reference Include="Microsoft.Phone" /> + <Reference Include="Microsoft.Phone.Interop" /> + <Reference Include="Microsoft.Xna.Framework" /> + <Reference Include="System.Device" /> + <Reference Include="System.Runtime.Serialization" /> + <Reference Include="System.Servicemodel.Web" /> + <Reference Include="System.Windows" /> + <Reference Include="system" /> + <Reference Include="System.Core" /> + <Reference Include="System.Net" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Xml.Linq" /> + </ItemGroup> + <ItemGroup> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + </Compile> + <Compile Include="cordovalib\BrowserMouseHelper.cs" /> + <Compile Include="cordovalib\CommandFactory.cs" /> + <Compile Include="cordovalib\Commands\BaseCommand.cs" /> + <Compile Include="cordovalib\ConfigHandler.cs" /> + <Compile Include="cordovalib\CordovaCommandCall.cs" /> + <Compile Include="cordovalib\CordovaView.xaml.cs"> + <DependentUpon>CordovaView.xaml</DependentUpon> + </Compile> + <Compile Include="cordovalib\DOMStorageHelper.cs" /> + <Compile Include="cordovalib\JSON\JsonHelper.cs" /> + <Compile Include="cordovalib\NativeExecution.cs" /> + <Compile Include="cordovalib\OrientationHelper.cs" /> + <Compile Include="cordovalib\PluginResult.cs" /> + <Compile Include="cordovalib\ScriptCallback.cs" /> + <Compile Include="MainPage.xaml.cs"> + <DependentUpon>MainPage.xaml</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </ApplicationDefinition> + <Page Include="cordovalib\CordovaView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="MainPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Plugins\UI\AudioRecorder.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Plugins\UI\ImageCapture.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Plugins\UI\NotificationBox.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Plugins\UI\VideoRecorder.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + </ItemGroup> + <ItemGroup> + <None Include="cordova\lib\build.js" /> + <None Include="cordova\lib\clean.js" /> + <None Include="cordova\lib\deploy.js" /> + <None Include="cordova\lib\log.js" /> + <None Include="cordova\lib\target-list.js" /> + <Content Include="www\**" /> + <Content Include="config.xml" /> + <Content Include="Images\**" /> + <Content Include="resources\notification-beep.wav" /> + <None Include="cordova\build.bat" /> + <None Include="cordova\clean.bat" /> + <None Include="cordova\lib\install-device.bat" /> + <None Include="cordova\lib\install-emulator.bat" /> + <None Include="cordova\lib\list-devices.bat" /> + <None Include="cordova\lib\list-emulator-images.bat" /> + <None Include="cordova\lib\list-started-emulators.bat" /> + <None Include="cordova\lib\start-emulator.bat" /> + <None Include="cordova\log.bat" /> + <None Include="cordova\run.bat" /> + <None Include="cordova\version.bat" /> + <None Include="VERSION" /> + <Content Include="CordovaSourceDictionary.xml"> + <SubType>Designer</SubType> + </Content> + <None Include="BuildManifestProcessor.js" /> + <None Include="Properties\AppManifest.xml"> + <SubType>Designer</SubType> + </None> + <None Include="Properties\WMAppManifest.xml"> + <SubType>Designer</SubType> + </None> + </ItemGroup> + <ItemGroup> + <Content Include="ApplicationIcon.png"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="Background.png"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + <Content Include="SplashScreenImage.jpg" /> + </ItemGroup> + <ItemGroup> + <WCFMetadata Include="Service References\" /> + </ItemGroup> + <ItemGroup> + <Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Plugins\*" /> + <Compile Include="Plugins\UI\*.cs" /> + </ItemGroup> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" /> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ProjectExtensions /> + <PropertyGroup> + <PreBuildEvent>CScript "$(ProjectDir)/BuildManifestProcessor.js" "$(ProjectPath)"</PreBuildEvent> + </PropertyGroup> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d3ba3a51/spec/util/csproj.spec.js ---------------------------------------------------------------------- diff --git a/spec/util/csproj.spec.js b/spec/util/csproj.spec.js new file mode 100644 index 0000000..b1bdcb2 --- /dev/null +++ b/spec/util/csproj.spec.js @@ -0,0 +1,24 @@ +var csproj = require('../../src/util/csproj'), + path = require('path'); + +var wp7_project = path.join(__dirname, '..', 'projects', 'wp7'), + example_csproj = path.join(wp7_project, 'CordovaAppProj.csproj'); + +describe('csproj', function() { + it('should throw if passed in an invalid xml file path ref', function() { + expect(function() { + new csproj('blahblah'); + }).toThrow(); + }); + it('should successfully parse a valid csproj file into an xml document', function() { + var doc; + expect(function() { + doc = new csproj(example_csproj); + }).not.toThrow(); + expect(doc.xml.getroot()).toBeDefined(); + }); + + describe('write method', function() { + + }); +}); http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d3ba3a51/src/util/csproj.js ---------------------------------------------------------------------- diff --git a/src/util/csproj.js b/src/util/csproj.js index 1fbe1b3..33ca3a7 100644 --- a/src/util/csproj.js +++ b/src/util/csproj.js @@ -1,4 +1,4 @@ -var xml_helpers = require('./xml_helpers'), +var xml_helpers = require('./xml-helpers'), et = require('elementtree'), fs = require('fs');
