Hi all,
I'm trying to add a build rule for Jison (http://zaach.github.io/jison/) and everything works except the command line in the property sheet.
When I insert a .jison file in a VS project and go to its properties, the parameters are there, but when I click on the Command Line option, an error pops up:
"String cannot be of zero length. Parameter name: oldValue"
The tool XML that goes into BuildRules.[props|targets|xml] was copied from another tool that works ok. Does someone know what I'm doing wrong?
<!-- BuildRules.props --><PropertyGroup Condition="'$(JisonBeforeTargets)' == '' and '$(JisonAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'"><JisonBeforeTargets>Midl</JisonBeforeTargets><JisonAfterTargets>CustomBuild</JisonAfterTargets></PropertyGroup><PropertyGroup><JisonDependsOn Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(JisonDependsOn)</JisonDependsOn></PropertyGroup><ItemDefinitionGroup><Jison><FileOut>%(Filename).js</FileOut><Grammar>0</Grammar><Debug>false</Debug><ModuleType>0</ModuleType><AlgorithmType>0</AlgorithmType><CommandLineTemplate>jison %(FullPath) [FileOut] [Grammar] [Debug] [ModuleType] [AlgorithmType]</CommandLineTemplate><Outputs>[FileOut]</Outputs><ExecutionDescription>Generating parser from %(FullPath)</ExecutionDescription><ShowOnlyRuleProperties>false</ShowOnlyRuleProperties></Jison></ItemDefinitionGroup>
<!-- BuildRules.targets --><Target Name="_Jison" BeforeTargets="$(JisonBeforeTargets)" AfterTargets="$(JisonAfterTargets)" Condition="'@(Jison)' != ''" DependsOnTargets="$(JisonDependsOn);ComputeJisonOutput" Outputs="%(Jison.Outputs)" Inputs="%(Jison.Identity);%(Jison.AdditionalDependencies);$(MSBuildProjectFile)"><ItemGroup Condition="'@(SelectedFiles)' != ''"><Jison Remove="@(Jison)" Condition="'%(Identity)' != '@(SelectedFiles)'" /></ItemGroup><Message Importance="High" Text="%(Jison.ExecutionDescription)" /><Jison Condition="'@(Jison)' != '' and '%(Jison.ExcludedFromBuild)' != 'true'" FileOut="%(Jison.FileOut)" Grammar="%(Jison.Grammar)" Debug="%(Jison.Debug)" ModuleType="%(Jison.ModuleType)" AlgorithmType="%(Jison.AlgorithmType)" CommandLineTemplate="%(Jison.CommandLineTemplate)" Inputs="%(Jison.Identity)" /><WriteLinesToFile Overwrite="true" Condition="'@(Jison_tlog)' != '' and '%(Jison_tlog.ExcludedFromBuild)' != 'true'" File="$(IntDir)%(FileName).write.1.tlog" Lines="^%(Jison_tlog.Source);@(Jison_tlog->'%(Fullpath)')" /></Target><PropertyGroup><ComputeLinkInputsTargets> $(ComputeLinkInputsTargets); ComputeJisonOutput;</ComputeLinkInputsTargets><ComputeLibInputsTargets> $(ComputeLibInputsTargets); ComputeJisonOutput;</ComputeLibInputsTargets></PropertyGroup><Target Name="ComputeJisonOutput" Condition="'@(Jison)' != ''"><ItemGroup><HashDirsToMake Condition="'@(Jison)' != '' and '%(Jison.ExcludedFromBuild)' != 'true'" Include="%(Jison.Outputs)" /><Link Include="%(JisonDirsToMake.Identity)" Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /><Lib Include="%(JisonDirsToMake.Identity)" Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /><ImpLib Include="%(JisonDirsToMake.Identity)" Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /></ItemGroup><MakeDir Directories="@(JisonDirsToMake->'%(RootDir)%(Directory)')" /></Target>
<!-- BuildRules.xml --><Rule Name="Jison" PageTemplate="tool" DisplayName="Jison" Order="200"><Rule.DataSource><DataSource Persistence="ProjectFile" ItemType="Jison"/></Rule.DataSource><Rule.Categories><Category Name="General"><Category.DisplayName><sys:String>General</sys:String></Category.DisplayName></Category><Category Name="Command Line" Subtype="CommandLine"><Category.DisplayName><sys:String>Command Line</sys:String></Category.DisplayName></Category></Rule.Categories><StringListProperty Name="Inputs" Category="Command Line" IsRequired="true" Switch=" "><StringListProperty.DataSource><DataSource Persistence="ProjectFile" ItemType="Jison" SourceType="Item"/></StringListProperty.DataSource></StringListProperty><StringListProperty Name="Outputs" DisplayName="Outputs" Visible="False" IncludeInCommandLine="False"/><StringProperty Name="ExecutionDescription" DisplayName="Execution Description" Visible="False" IncludeInCommandLine="False"/><StringProperty Name="CommandLineTemplate" DisplayName="Command Line" Visible="False" IncludeInCommandLine="False"/><StringProperty Name="FileOut" DisplayName="Output File" Description="The JS generated parser" Switch="-o [value]"/><EnumProperty Name="Grammar" DisplayName="Input Grammar Format" Description="Select the format of the grammar"><EnumValue Name="0" DisplayName="Bison/Flex" Switch=""/><EnumValue Name="1" DisplayName="JSON" Switch="-j" /></EnumProperty><BoolProperty Name="Debug" DisplayName="Debug" Description="Debug mode" Switch="-t"/><EnumProperty Name="ModuleType" DisplayName="Module Type" Description="The type of module to generate"><EnumValue Name="0" DisplayName="JavaScript" Switch="-m js"/><EnumValue Name="1" DisplayName="CommonJS" Switch="-m commonjs"/><EnumValue Name="2" DisplayName="Asynchronous Module Definition" Switch="-m amd"/></EnumProperty><EnumProperty Name="AlgorithmType" DisplayName="Algorithm Type" Description="The type of algorithm to use in the parser"><EnumValue Name="0" DisplayName="LR(0)" Switch="-p lr0"/><EnumValue Name="1" DisplayName="Simple LR (SLR)" Switch="-p slr"/><EnumValue Name="2" DisplayName="Look-Ahead LR (LALR)" Switch="-p lalr"/><EnumValue Name="3" DisplayName="LR" Switch="-p lr"/></EnumProperty></Rule><ItemType Name="Jison" DisplayName="Jison"/><FileExtension Name="*.jison" ContentType="Jison"/><ContentType Name="Jison" DisplayName="Jison" ItemType="Jison"/>
Thanks,
Andre