Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
- <UsingTask
- TaskName="CompressorTask"
- AssemblyFile="C:\Repository\DotNet\Yahoo.Yui.Compressor.dll" />
- <!-- Define the output locations. These can be set via the msbuild command line using
- /p:SourceLocation="$(ProjectDir)"
- /p:CssOutputFile=$(ProjectDir)../whatever...
- /p:JavaScriptOutputFile=$(ProjectDir)../whatever...
- If they are not supplied or are empty, then we use the values supplied below.
- -->
- <PropertyGroup>
- <CssOutputFile Condition=" '$(CssOutputFile)'=='' ">styles.min.css</CssOutputFile>
- <JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">scripts.min.js</JavaScriptOutputFile>
- </PropertyGroup>
- <Target Name="MyTaskTarget">
- <Message Text="Compressing JS and Css" Importance="high" />
- <!--
- ItemGroup\CssFiles or ItemGroup\JavaScriptFiles: add zero to many files you wish to include in this compression task.
- Don't forget, you can use the wildcard (eg. *.css, *.js) if you feel up to it.
- Finally, at least one item is required - either a css file or a js file.
- CssFiles/JavaScriptFiles data format: Please do not touch this.
- DeleteCssFiles: [Optional] True | Yes | Yeah | Yep | True | FoSho | Fo Sho. Default is False. Anything else is False. (eg. blah = false, xxxx111 = false, etc)
- CssCompressionType: YuiStockCompression | MichaelAshsRegexEnhancements | HaveMyCakeAndEatIt or BestOfBothWorlds or Hybrid; Default is YuiStockCompression.
- ObfuscateJavaScript: [Optional] refer to DeleteCssFiles, above.
- PreserveAllSemicolons: [Optional] refer to DeleteCssFiles, above.
- DisableOptimizations: [Optional] refer to DeleteCssFiles, above.
- EncodingType: [Optional] ASCII, BigEndianUnicode, Unicode, UTF32, UTF7, UTF8, Default. Default is 'Default'.
- DeleteJavaScriptFiles: [Optional] refer to DeleteCssFiles, above.
- LineBreakPosition: [Optional] the position where a line feed is appened when the next semicolon is reached. Default is -1 (never add a line break).
- 0 (zero) means add a line break after every semicolon. (This might help with debugging troublesome files).
- LoggingType: None | ALittleBit | HardcoreBringItOn; Hardcore also lists javascript verbose warnings, if there are any (and there usually is :P ).
- ThreadCulture: [Optional] the culture you want the thread to run under. Default is 'en-gb'.
- IsEvalIgnored: [Optional] compress any functions that contain 'eval'. Default is False, which means a function that contains
- 'eval' will NOT be compressed. It's deemed risky to compress a function containing 'eval'. That said,
- if the usages are deemed safe this check can be disabled by setting this value to True.
- -->
- <ItemGroup>
- <!-- Single files, listed in order of dependency -->
- <CssFiles Include="$(SourceLocation)..\Content\css\Site.css"/>
- <CssFiles Include="$(SourceLocation)..\Content\css\masterpage.css"/>
- <CssFiles Include="$(SourceLocation)..\Content\css\page_home.css"/>
- <CssFiles Include="$(SourceLocation)..\Content\css\page_about.css"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery-1.5.1.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery-ui-1.8.11.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.maskedinput-1.3.min.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.unobtrusive-ajax.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.unobtrusive.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\jquery.validate.custom.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\MicrosoftAjax.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\MicrosoftMvcValidation.js"/>
- <JavaScriptFiles Include="$(SourceLocation)..\Scripts\modernizr-1.7.js"/>
- </ItemGroup>
- <CompressorTask
- CssFiles="@(CssFiles)"
- DeleteCssFiles="false"
- CssOutputFile="$(CssOutputFile)"
- CssCompressionType="YuiStockCompression"
- JavaScriptFiles="@(JavaScriptFiles)"
- ObfuscateJavaScript="True"
- PreserveAllSemicolons="False"
- DisableOptimizations="Nope"
- EncodingType="Default"
- DeleteJavaScriptFiles="false"
- LineBreakPosition="-1"
- JavaScriptOutputFile="$(JavaScriptOutputFile)"
- LoggingType="ALittleBit"
- ThreadCulture="nl-BE"
- IsEvalIgnored="false"
- />
- </Target>
- </Project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement