default.build

来自「NANT 用于在.NET 平台上自动编译工具」· BUILD 代码 · 共 40 行

BUILD
40
字号
<?xml version="1.0"?>
<project name="NAnt" default="run">
    <!-- Compile the test task and add it then use it. -->
    <target name="build">
        <mkdir dir="bin" />
        <csc target="library" output="bin/ReplaceCharacter.dll">
            <sources>
                <include name="ReplaceCharacter.cs"/>
            </sources>
            <references basedir="${nant::get-base-directory()}">
                <include name="NAnt.Core.dll" />
            </references>
        </csc>
    </target>

    <target name="run" depends="build">
        <!-- dynamically load the filter in the assembly. -->
        <loadtasks assembly="bin/ReplaceCharacter.dll" />
        <!-- 
            copy the 'ReplaceCharacter.cs' file to 'out.txt' and use our custom
            filter to replace all 'a' characters with '-'.
        -->
        <copy file="ReplaceCharacter.cs" tofile="out.txt">
            <filterchain>
                <replacecharacter from="a" to="-" />
            </filterchain>
        </copy>
    </target>

    <target name="clean">
        <!-- delete the build output. -->
        <delete>
            <fileset>
                <include name="bin/ReplaceCharacter.dll" />
                <include name="out.txt" />
            </fileset>
        </delete>
    </target>
</project>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?