Advertisement
Guest User

MSBuildSettings

a guest
Aug 17th, 2011
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.02 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
  3.   <UsingTask
  4.      TaskName="CompressorTask"
  5.      AssemblyFile="C:\Repository\DotNet\Yahoo.Yui.Compressor.dll" />
  6.  
  7.   <!-- Define the output locations. These can be set via the msbuild command line using
  8.         /p:SourceLocation="$(ProjectDir)"
  9.         /p:CssOutputFile=$(ProjectDir)../whatever...
  10.         /p:JavaScriptOutputFile=$(ProjectDir)../whatever...
  11.        
  12.         If they are not supplied or are empty, then we use the values supplied below.
  13.    -->
  14.   <PropertyGroup>
  15.     <CssOutputFile Condition=" '$(CssOutputFile)'=='' ">styles.min.css</CssOutputFile>
  16.     <JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">scripts.min.js</JavaScriptOutputFile>
  17.   </PropertyGroup>
  18.  
  19.  
  20.   <Target Name="MyTaskTarget">
  21.  
  22.     <Message Text="Compressing JS and Css" Importance="high" />
  23.     <!--
  24.            ItemGroup\CssFiles or ItemGroup\JavaScriptFiles: add zero to many files you wish to include in this compression task.
  25.                                                             Don't forget, you can use the wildcard (eg. *.css, *.js) if you feel up to it.
  26.                                                             Finally, at least one item is required - either a css file or a js file.
  27.                                                            
  28.            CssFiles/JavaScriptFiles data format: Please do not touch this.
  29.            DeleteCssFiles: [Optional] True | Yes | Yeah | Yep | True | FoSho | Fo Sho. Default is False. Anything else is False. (eg. blah = false, xxxx111 = false, etc)
  30.            CssCompressionType: YuiStockCompression | MichaelAshsRegexEnhancements | HaveMyCakeAndEatIt or BestOfBothWorlds or Hybrid; Default is YuiStockCompression.
  31.            ObfuscateJavaScript: [Optional] refer to DeleteCssFiles, above.
  32.            PreserveAllSemicolons: [Optional] refer to DeleteCssFiles, above.
  33.            DisableOptimizations: [Optional] refer to DeleteCssFiles, above.
  34.            EncodingType: [Optional] ASCII, BigEndianUnicode, Unicode, UTF32, UTF7, UTF8, Default. Default is 'Default'.
  35.            DeleteJavaScriptFiles: [Optional] refer to DeleteCssFiles, above.
  36.            LineBreakPosition: [Optional] the position where a line feed is appened when the next semicolon is reached. Default is -1 (never add a line break).
  37.                               0 (zero) means add a line break after every semicolon. (This might help with debugging troublesome files).          
  38.            LoggingType: None | ALittleBit | HardcoreBringItOn;  Hardcore also lists javascript verbose warnings, if there are any (and there usually is :P ).
  39.            ThreadCulture: [Optional] the culture you want the thread to run under. Default is 'en-gb'.
  40.            IsEvalIgnored: [Optional] compress any functions that contain 'eval'. Default is False, which means a function that contains
  41.                           'eval' will NOT be compressed. It's deemed risky to compress a function containing 'eval'. That said,
  42.                           if the usages are deemed safe this check can be disabled by setting this value to True.
  43.        -->
  44.     <ItemGroup>
  45.       <!-- Single files, listed in order of dependency -->
  46.       <CssFiles Include="$(SourceLocation)..\Content\css\Site.css"/>
  47.       <CssFiles Include="$(SourceLocation)..\Content\css\masterpage.css"/>
  48.       <CssFiles Include="$(SourceLocation)..\Content\css\page_home.css"/>
  49.       <CssFiles Include="$(SourceLocation)..\Content\css\page_about.css"/>
  50.      
  51.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery-1.5.1.js"/>
  52.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery-ui-1.8.11.js"/>
  53.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.maskedinput-1.3.min.js"/>
  54.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.unobtrusive-ajax.js"/>
  55.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.js"/>
  56.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.unobtrusive.js"/>
  57.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.custom.js"/>
  58.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\MicrosoftAjax.js"/>
  59.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\MicrosoftMvcValidation.js"/>
  60.       <JavaScriptFiles Include="$(SourceLocation)..\Scripts\modernizr-1.7.js"/>
  61.     </ItemGroup>
  62.    
  63.     <CompressorTask
  64.        CssFiles="@(CssFiles)"
  65.        DeleteCssFiles="false"
  66.        CssOutputFile="$(CssOutputFile)"
  67.        CssCompressionType="YuiStockCompression"
  68.        JavaScriptFiles="@(JavaScriptFiles)"
  69.        ObfuscateJavaScript="True"
  70.        PreserveAllSemicolons="False"
  71.        DisableOptimizations="Nope"
  72.        EncodingType="Default"
  73.        DeleteJavaScriptFiles="false"
  74.        LineBreakPosition="-1"
  75.        JavaScriptOutputFile="$(JavaScriptOutputFile)"
  76.        LoggingType="ALittleBit"
  77.        ThreadCulture="nl-BE"
  78.        IsEvalIgnored="false"
  79.            />
  80.   </Target>
  81. </Project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement