NAntュードベスト構築することが可能となるWindows、モノ/Linux
-
09-06-2019 - |
質問
今回が初めてNAntが経験Ant CruiseControl.
いきたいと思いはしてSVNプロジェクトを含むすべてのツールなど途、疑似など)を確認できますしかし、新鮮な機る。この戦略の概要J.P Boodhoo こちらです。
この場合だけで走らせたいというWindowsでは、こういうことができるようにチェックしかし、Linuxおよび構築-試験-実行をモノです。いない外部の依存関係のSVNます。い心を持つツールのプロジェクトがいつNAntビルドファイル
ことが必要ですがいかがですか?うさぎ/'トラップ若手選手
解決
このなど、特に難しい遠.いかなり類似のもの私のプロジェクト以来の半分でJavaを用いAnt走行に関連する目標の半分です。NetとC#のサンプルソースコードのポートします。の取得windows用の機械の開発、サーバー(Java)走linuxが、UAT環境(linux)必要がありますのnunits(インテグレーション)。実際のコツは本当に難しいトリック)の背後にあるべきであるNAntビルドファイルまたは両方の環境にしてようやく同じものをいいます。
もちろん実現する必要がありNAnt"モノ"には、最初の
$ export MONO_NO_UNLOAD=1
$ make clean
$ make
$ mono bin/NAnt.exe clean build
そしてビルドファイルのニーズに書き込まれるようでseperates。一部の構成ファイルの記述のためのwindowsで動作しませんlinuxです。だっく分けて伊藤具体的な目標の構築をファイルです。その後、多くの方法を実行できますが具体的な目標からョンをインストールして下さい。例このような
<project name="DualBuild">
<property name="windowsDotNetPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5" />
<property name="windowsSolutionPath" value="D:\WorkingDirectory\branches\1234\source" />
<property name="windowsNUnitPath" value="C:\Program Files\NUnit-Net-2.0 2.2.8\bin" />
<property name="monoPath" value="You get the idea..." />
<target name="BuildAndTestOnWindows" depends="WinUpdateRevision, WinBuild, WinTest" />
<target name="BuildAndTestOnLinux" depends="MonoUpdateRevision, MonoBuild, MonoTest" />
<target name="WinUpdateRevision">
<delete file="${windowsSolutionPath}\Properties\AssemblyInfo.cs" />
<exec program="subwcrev.exe" basedir="C:\Program Files\TortoiseSVN\bin\"
workingdir="${windowsSolutionPath}\Properties"
commandline="${windowsSolutionPath} .\AssemblyInfoTemplate.cs
.\AssemblyInfo.cs" />
<delete file="${windowsSolutionPath}\Properties\AssemblyInfo.cs" />
<exec program="subwcrev.exe" basedir="C:\Program Files\TortoiseSVN\bin\"
workingdir="${windowsSolutionPath}\Properties"
commandline="${windowsSolutionPath} .\AssemblyInfoTemplate.cs
.\AssemblyInfo.cs" />
</target>
<target name="WinBuild">
<exec program="msbuild.exe"
basedir="${windowsDotNetPath}"
workingdir="${windowsSolutionPath}"
commandline="MySolution.sln /logger:ThoughtWorks.CruiseControl.MsBuild.XmlLogger,
ThoughtWorks.CruiseControl.MsBuild.dll;msbuild-output.xml
/nologo /verbosity:normal /noconsolelogger
/p:Configuration=Debug /target:Rebuild" />
</target>
<target name="WinTest">
<exec program="NCover.Console.exe"
basedir="C:\Program Files\NCover"
workingdir="${windowsSolutionPath}">
<arg value="//x "ClientCoverage.xml"" />
<arg value=""C:\Program Files\NUnit-Net-2.0 2.2.8\bin
\nunit-console.exe"
MySolution.nunit /xml=nunit-output.xml /nologo" />
</exec>
</target>
<target name="MonoUpdateRevision">
You get the idea...
</target>
<target name="MonoBuild">
You get the idea...
</target>
<target name="MonoTest">
You get the idea...
</target>
</project>
簡潔、私は両です。はっきりものができる用途などNAntの両方の環境にやるもんやから依存する。それぞれ実行できるとの交換のためのその他の作業環境、例えば(xBuildのためのMSBuild、svnのためのタートルなど)
より詳しいヘ途などモノ、チェックアウト この幻想的なポスト.
いーす
声で
Rob G
他のヒント
@Rob G-こんにちは!これはまさに私にぴったり。;)
一部のその他の事例としては、必ず閲覧途にソースコード。って仕事をしていャーリーまでのとれていることを確認してくださいと試験に用いただけます:standardとexpress。彼は実行した際には常にできます。
ることから、多くのリーディングプロジェクトNantを走るモノが行き届いていボックス"、すなわち
mono nant.exe
作品
私は以下のテンプレートを作成します。できるシンプルな造りにプラットフォーム(build
に勝つ ./build.sh
linux)を最低限に抑え、重複の構築のためのイントロダクションです。
のNAnt実行ファイルが格納され、プロジェクト tools\nant
.
の設定ファイルを決定するビルドツールの使用は、MSBuildはxbuild(この場合、窓のVS2015MSBuild版に変更、パスが必要です。
の build-csproj
構築の目標で再利用するときにネットワークの構造とダイナミク内です。
の test-project
目標が必要となる場合があるが拡大時にお任せください。
ます。バット
@tools\nant\nant.exe %*
build.sh
#!/bin/sh
/usr/bin/cli tools/nant/NAnt.exe "$@"
デフォルトです。の構築
<?xml version="1.0"?>
<project name="MyProject" default="all">
<if test="${not property::exists('configuration')}">
<property name="configuration" value="release" readonly="true" />
</if>
<if test="${platform::is-windows()}">
<property name="BuildTool" value="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" readonly="true"/>
</if>
<if test="${platform::is-unix()}">
<property name="BuildTool" value="xbuild" readonly="true"/>
</if>
<property name="TestTool" value="tools/mytesttool.exe"/>
<target name="all" depends="myproject myprojectlib" />
<target name="build-csproj" description="Build a given csproj">
<!-- Must not be called standalone as it requires some properties set. -->
<exec program="${BuildTool}">
<arg path="src/${ProjectName}/${ProjectName}.csproj" />
<arg line="/property:Configuration=${configuration}" />
<arg value="/target:Rebuild" />
<arg value="/verbosity:normal" />
<arg value="/nologo" />
</exec>
</target>
<target name="test-project">
<!-- Must not be called standalone as it requires some properties set. -->
<exec program="${TestTool}">
<arg path="my/${ProjectName}/tests/path/for/tool" />
<arg value="/aproperty=value" />
</exec>
</target>
<target name="myproject" description="Build the project">
<property name="ProjectName" value="MyProject"/>
<call target="build-csproj" />
<call target="test-project" />
</target>
<target name="myprojectlib" description="Build the project's library dll">
<property name="ProjectName" value="MyProjectLib"/>
<call target="build-csproj" />
<call target="test-project" />
</target>
</project>