Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ca5deadafe
Fetching contributors…

Cannot retrieve contributors at this time

165 lines (159 sloc) 8.218 kb
<?xml version="1.0"?>
<project name="Cooper" default="rebuild">
<!--<loadtasks assembly="..\work-tool\nant\extensions\common\2.0\yui\Yahoo.Yui.Compressor.Build.Nant.dll" verbose="true" />-->
<property name="args0" value="" dynamic="true"/>
<property name="args1" value="" dynamic="true"/>
<property name="project.config" value="${args0}" dynamic="true" />
<!--path-->
<property name="dir" value="."/>
<property name="dir.tools" value="..\work-tool"/>
<property name="build.base" value="build\${project.config}"/>
<property name="build.absolutepath" value="${path::get-full-path(build.base)}" />
<property name="xpath.flag" value="/configuration/appSettings/add[@key='EnvironmentVersionFlag']/@value"/>
<property name="xpath.flag_refresh" value="/configuration/appSettings/add[@key='AutoRefreshSettingsFlag']/@value"/>
<property name="xpath.compilation" value="/configuration/system.web/compilation/@debug"/>
<property name="xpath.customErrors" value="/configuration/system.web/customErrors/@mode"/>
<!--nuget-->
<property name="nuget" value="${path::get-full-path(dir.tools)}" />
<property name="nuget.packages" value="${dir}\packages" />
<property name="nuget.cache" value="C:\Users\${environment::get-user-name()}\AppData\Local\NuGet\Cache" />
<property name="nuget.install" value="${dir}\nuget.install.bat" />
<property name="nuget.params.install" value="${nuget} ${path::get-full-path(nuget.packages)}" />
<!--msbuild-->
<property name="msbuild" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" />
<property name="msbuild.config" value="Debug" dynamic="true"/>
<if test="${project.config=='Release'}">
<property name="msbuild.config" value="Release"/>
</if>
<property name="msbuild.params"
value="/t:rebuild
/p:Configuration=${msbuild.config}
/t:ResolveReferences" />
<property name="msbuild.params.weboutput" value="/t:_CopyWebApplication /p:WebProjectOutputDir=${build.absolutepath}" />
<property name="msbuild.params.mvcoutput" value="/t:_CopyWebApplication /p:mvcbuildviews=true /p:WebProjectOutputDir=${build.absolutepath}" />
<property name="msbuild.params.output" value="/p:OutputPath=${build.absolutepath}" />
<!--NUnit-->
<property name="nunit" value="${path::get-full-path(dir.tools)}\nunit\nunit-console.exe" />
<!--clean-->
<target name="clean" description="clean build folder">
<delete dir="${build.absolutepath}"></delete>
</target>
<target name="nuget" description="nuget install and update">
<delete dir="${nuget.packages}"></delete>
<delete dir="${nuget.cache}"></delete>
<exec program="${nuget.install}"
commandline="${nuget.params.install}"
workingdir="${dir}" />
</target>
<target name="web">
<exec program="${msbuild}"
commandline="${msbuild.params}
${msbuild.params.mvcoutput}\cooper_web
${msbuild.params.output}\cooper_web\bin"
workingdir="${dir}\src\Cooper.Web" />
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.flag}"
value="${project.config}" />
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.flag_refresh}"
value="true" />
<if test="${msbuild.config=='Release'}">
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.compilation}"
value="false" />
<xmlpoke file="${build.absolutepath}\cooper_web\web.config"
xpath="${xpath.customErrors}"
value="Off" />
<!--RemoteOnly will no error message shown-->
</if>
<!--change scripts-->
<echo file="${build.absolutepath}\cooper_web\scripts\common.js" append="true" if="${msbuild.config=='Release'}">
<![CDATA[
debuger.isProfileEnable = debuger.enable && false;
debuger.isDebugEnable = debuger.enable && false;
debuger.isInfoEnable = debuger.enable && false;
debuger.isWarnEnable = debuger.enable && true;
debuger.isErrorEnable = debuger.enable && true;
]]>
</echo>
<!--compress-->
<!--third-->
<javaScriptCompressor outputFile="${build.absolutepath}\cooper_web\scripts\third.js"
encodingType="UTF8">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery-1.7.2.min.js" />
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery-ui-1.8.22.custom.min.js" />
<include name="${build.absolutepath}\cooper_web\content\jquery\jquery.json-2.3.min.js" />
<include name="${build.absolutepath}\cooper_web\content\bootstrap\js\bootstrap.min.js" />
</sourceFiles>
</javaScriptCompressor>
<!--base-->
<javaScriptCompressor outputFile="${build.absolutepath}\cooper_web\scripts\base.js"
encodingType="UTF8"
deleteSourceFiles="True">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\common.js" />
<include name="${build.absolutepath}\cooper_web\scripts\lang.js" />
<include name="${build.absolutepath}\cooper_web\scripts\account.js" />
</sourceFiles>
</javaScriptCompressor>
<!--taskui-->
<javaScriptCompressor deleteSourceFiles="True"
outputFile="${build.absolutepath}\cooper_web\scripts\taskui.js"
compressionType="Standard"
obfuscateJavaScript="True"
preserveAllSemicolons="False"
disableOptimizations="False"
encodingType="UTF8"
lineBreakPosition="-1"
loggingType="Info"
isEvalIgnored="false">
<sourceFiles>
<include name="${build.absolutepath}\cooper_web\scripts\task.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_common.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_row.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_bind_shortcuts.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_priority.js" />
<include name="${build.absolutepath}\cooper_web\scripts\task_due.js" />
<include name="${build.absolutepath}\cooper_web\scripts\taskpage.js" />
</sourceFiles>
</javaScriptCompressor>
<!--change refer via md5-->
<echo file="${build.absolutepath}\cooper_web\views\shared\scripts.cshtml"></echo>
<property name="tofile" value="scripts" />
<property name="js" value="third" />
<call target="md5_js"></call>
<property name="js" value="base" />
<call target="md5_js"></call>
<!--change refer via md5-->
<echo file="${build.absolutepath}\cooper_web\views\shared\scripts_task.cshtml"></echo>
<property name="tofile" value="scripts_task" />
<property name="js" value="taskui" />
<call target="md5_js"></call>
<!--hybrid-->
</target>
<target name="test_model">
<exec program="${msbuild}"
commandline="${msbuild.params} ${msbuild.params.output}\cooper_model_test"
workingdir="${dir}\src\Cooper.Model.Test" />
<exec program="${nunit}" commandline="Cooper.Model.Test.dll" workingdir="${build.absolutepath}\cooper_model_test"/>
<!--/exclude=concurrent-->
</target>
<target name="md5_js">
<checksum algorithm="MD5" fileext="MD5">
<fileset>
<include name="${build.absolutepath}\cooper_web\scripts\${js}.js"/>
</fileset>
</checksum>
<loadfile file="${build.absolutepath}\cooper_web\scripts\${js}.js.md5" property="md5" />
<copy outputencoding="utf-8"
file="${build.absolutepath}\cooper_web\scripts\${js}.js"
tofile="${build.absolutepath}\cooper_web\scripts\${js}-${md5}.js"/>
<echo file="${build.absolutepath}\cooper_web\views\shared\${tofile}.cshtml" append="true">
<![CDATA[
<script type="text/javascript" src="@Url.Content("~/scripts/${js}-${md5}.js")"></script>
]]>
</echo>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.