mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Classify builds, pkgproj, resx and sfproj as XML (#2954)
* Classify builds, pkgproj, resx and sfproj as XML * Disambiguate .builds for XML and Text
This commit is contained in:
		| @@ -86,6 +86,14 @@ module Linguist | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     disambiguate ".builds" do |data| | ||||||
|  |       if /^(\s*)(<Project|<Import|<Property|<?xml|xmlns)/i.match(data) | ||||||
|  |         Language["XML"] | ||||||
|  |       else | ||||||
|  |         Language["Text"] | ||||||
|  |       end | ||||||
|  |     end | ||||||
|  |  | ||||||
|     disambiguate ".ch" do |data| |     disambiguate ".ch" do |data| | ||||||
|       if /^\s*#\s*(if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b/i.match(data) |       if /^\s*#\s*(if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b/i.match(data) | ||||||
|         Language["xBase"] |         Language["xBase"] | ||||||
|   | |||||||
| @@ -3859,6 +3859,7 @@ XML: | |||||||
|   - .xml |   - .xml | ||||||
|   - .ant |   - .ant | ||||||
|   - .axml |   - .axml | ||||||
|  |   - .builds | ||||||
|   - .ccxml |   - .ccxml | ||||||
|   - .clixml |   - .clixml | ||||||
|   - .cproject |   - .cproject | ||||||
| @@ -3890,6 +3891,7 @@ XML: | |||||||
|   - .nuspec |   - .nuspec | ||||||
|   - .odd |   - .odd | ||||||
|   - .osm |   - .osm | ||||||
|  |   - .pkgproj | ||||||
|   - .plist |   - .plist | ||||||
|   - .pluginspec |   - .pluginspec | ||||||
|   - .props |   - .props | ||||||
| @@ -3897,8 +3899,10 @@ XML: | |||||||
|   - .psc1 |   - .psc1 | ||||||
|   - .pt |   - .pt | ||||||
|   - .rdf |   - .rdf | ||||||
|  |   - .resx | ||||||
|   - .rss |   - .rss | ||||||
|   - .scxml |   - .scxml | ||||||
|  |   - .sfproj | ||||||
|   - .srdf |   - .srdf | ||||||
|   - .storyboard |   - .storyboard | ||||||
|   - .stTheme |   - .stTheme | ||||||
|   | |||||||
							
								
								
									
										23
									
								
								samples/XML/Demo.sfproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								samples/XML/Demo.sfproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||||
|  |   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.props" /> | ||||||
|  |   <PropertyGroup Label="Globals"> | ||||||
|  |     <ProjectGuid>93d81507-bccc-43d6-8667-2d42473f0c32</ProjectGuid> | ||||||
|  |     <ProjectVersion>1.0</ProjectVersion> | ||||||
|  |   </PropertyGroup> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <None Include="Scripts\Deploy-FabricApplication.ps1" /> | ||||||
|  |   </ItemGroup> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <ProjectReference Include="..\ChaosTest.ChaosService\ChaosTest.ChaosService.csproj" /> | ||||||
|  |     <ProjectReference Include="..\ChaosTest.WebService\ChaosTest.WebService.csproj" /> | ||||||
|  |   </ItemGroup> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <Content Include="ApplicationPackageRoot\ApplicationManifest.xml" /> | ||||||
|  |     <Content Include="ApplicationParameters\Cloud.xml" /> | ||||||
|  |     <Content Include="ApplicationParameters\Local.xml" /> | ||||||
|  |     <Content Include="PublishProfiles\Cloud.xml" /> | ||||||
|  |     <Content Include="PublishProfiles\Local.xml" /> | ||||||
|  |   </ItemGroup> | ||||||
|  |   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Service Fabric Tools\Microsoft.VisualStudio.Azure.Fabric.ApplicationProject.targets" /> | ||||||
|  | </Project> | ||||||
							
								
								
									
										104
									
								
								samples/XML/Strings.resx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								samples/XML/Strings.resx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,104 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <root> | ||||||
|  | 	<!--  | ||||||
|  | 		Microsoft ResX Schema | ||||||
|  |  | ||||||
|  | 		Version 1.3 | ||||||
|  |  | ||||||
|  | 		The primary goals of this format is to allow a simple XML format  | ||||||
|  | 		that is mostly human readable. The generation and parsing of the  | ||||||
|  | 		various data types are done through the TypeConverter classes  | ||||||
|  | 		associated with the data types. | ||||||
|  |  | ||||||
|  | 		Example: | ||||||
|  |  | ||||||
|  | 		... ado.net/XML headers & schema ... | ||||||
|  | 		<resheader name="resmimetype">text/microsoft-resx</resheader> | ||||||
|  | 		<resheader name="version">1.3</resheader> | ||||||
|  | 		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | ||||||
|  | 		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | ||||||
|  | 		<data name="Name1">this is my long string</data> | ||||||
|  | 		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | ||||||
|  | 		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | ||||||
|  | 			[base64 mime encoded serialized .NET Framework object] | ||||||
|  | 		</data> | ||||||
|  | 		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | ||||||
|  | 			[base64 mime encoded string representing a byte array form of the .NET Framework object] | ||||||
|  | 		</data> | ||||||
|  |  | ||||||
|  | 		There are any number of "resheader" rows that contain simple  | ||||||
|  | 		name/value pairs. | ||||||
|  |  | ||||||
|  | 		Each data row contains a name, and value. The row also contains a  | ||||||
|  | 		type or mimetype. Type corresponds to a .NET class that support  | ||||||
|  | 		text/value conversion through the TypeConverter architecture.  | ||||||
|  | 		Classes that don't support this are serialized and stored with the  | ||||||
|  | 		mimetype set. | ||||||
|  |  | ||||||
|  | 		The mimetype is used for serialized objects, and tells the  | ||||||
|  | 		ResXResourceReader how to depersist the object. This is currently not  | ||||||
|  | 		extensible. For a given mimetype the value must be set accordingly: | ||||||
|  |  | ||||||
|  | 		Note - application/x-microsoft.net.object.binary.base64 is the format  | ||||||
|  | 		that the ResXResourceWriter will generate, however the reader can  | ||||||
|  | 		read any of the formats listed below. | ||||||
|  |  | ||||||
|  | 		mimetype: application/x-microsoft.net.object.binary.base64 | ||||||
|  | 		value   : The object must be serialized with  | ||||||
|  | 			: System.Serialization.Formatters.Binary.BinaryFormatter | ||||||
|  | 			: and then encoded with base64 encoding. | ||||||
|  |  | ||||||
|  | 		mimetype: application/x-microsoft.net.object.soap.base64 | ||||||
|  | 		value   : The object must be serialized with  | ||||||
|  | 			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | ||||||
|  | 			: and then encoded with base64 encoding. | ||||||
|  |  | ||||||
|  | 		mimetype: application/x-microsoft.net.object.bytearray.base64 | ||||||
|  | 		value   : The object must be serialized into a byte array  | ||||||
|  | 			: using a System.ComponentModel.TypeConverter | ||||||
|  | 			: and then encoded with base64 encoding. | ||||||
|  | 	--> | ||||||
|  | 	 | ||||||
|  | 	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||||||
|  | 		<xsd:element name="root" msdata:IsDataSet="true"> | ||||||
|  | 			<xsd:complexType> | ||||||
|  | 				<xsd:choice maxOccurs="unbounded"> | ||||||
|  | 					<xsd:element name="data"> | ||||||
|  | 						<xsd:complexType> | ||||||
|  | 							<xsd:sequence> | ||||||
|  | 								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||||||
|  | 								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||||||
|  | 							</xsd:sequence> | ||||||
|  | 							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> | ||||||
|  | 							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||||||
|  | 							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||||||
|  | 						</xsd:complexType> | ||||||
|  | 					</xsd:element> | ||||||
|  | 					<xsd:element name="resheader"> | ||||||
|  | 						<xsd:complexType> | ||||||
|  | 							<xsd:sequence> | ||||||
|  | 								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||||||
|  | 							</xsd:sequence> | ||||||
|  | 							<xsd:attribute name="name" type="xsd:string" use="required" /> | ||||||
|  | 						</xsd:complexType> | ||||||
|  | 					</xsd:element> | ||||||
|  | 				</xsd:choice> | ||||||
|  | 			</xsd:complexType> | ||||||
|  | 		</xsd:element> | ||||||
|  | 	</xsd:schema> | ||||||
|  | 	<resheader name="resmimetype"> | ||||||
|  | 		<value>text/microsoft-resx</value> | ||||||
|  | 	</resheader> | ||||||
|  | 	<resheader name="version"> | ||||||
|  | 		<value>1.3</value> | ||||||
|  | 	</resheader> | ||||||
|  | 	<resheader name="reader"> | ||||||
|  | 		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||||||
|  | 	</resheader> | ||||||
|  | 	<resheader name="writer"> | ||||||
|  | 		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||||||
|  | 	</resheader> | ||||||
|  |   <data name="Argument_InvalidPathChars" xml:space="preserve"> | ||||||
|  |     <value>Illegal characters in path.</value> | ||||||
|  |   </data> | ||||||
|  | </root> | ||||||
							
								
								
									
										12
									
								
								samples/XML/System.Buffers.pkgproj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								samples/XML/System.Buffers.pkgproj
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||||
|  |   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||||||
|  |  | ||||||
|  |   <ItemGroup> | ||||||
|  |     <ProjectReference Include="..\src\System.Buffers.builds"> | ||||||
|  |       <SupportedFramework>net45;netcore45;netstandardapp1.5;wpa81</SupportedFramework> | ||||||
|  |     </ProjectReference> | ||||||
|  |   </ItemGroup> | ||||||
|  |  | ||||||
|  |   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||||||
|  | </Project> | ||||||
							
								
								
									
										8
									
								
								samples/XML/src.builds
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								samples/XML/src.builds
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | |||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||||
|  |   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <Project Include="*\src\*.builds" /> | ||||||
|  |   </ItemGroup> | ||||||
|  |   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" /> | ||||||
|  | </Project> | ||||||
		Reference in New Issue
	
	Block a user