NAnt + Project with GUID must be included - nant

I just started using NAnt today, I followed some of the examples. I am having a hard time with one issue:
Its saying: "Project with GUID '{32845370-6F32-411F-B4C5-383F9C3EDE29}' must be included for
the build to work."
Now I was able to track down the project. Here is my directory structure:
c:\dev\stockclockbuild -> this is where the solution and build file is located.
So I run the command:
nant -buildfile:c:\dev\stockclockbuild\stocks.build
I have a project that it located in c:\dev\_sharedlibs\mdrlibs called "MDR.StockPlatform" which seems to get included, but within that project file I found the project (dependency) that has the GUID mentioned in the error.
That project is called "MDR.Base" but its located in the same folder as MDR.StockPlatform.
Also if I were to open this solution and build it in visual studio it builds without errors.
Here is the complete verbose output:
c:\Dev\_Misc\Tools\nAnt\bin>nant -buildfile:c:\dev\stockclockbuild\stocks.build
NAnt 0.92 (Build 0.92.4543.0; release; 6/9/2012)
Copyright (C) 2001-2012 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///c:/dev/stockclockbuild/stocks.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: rebuild
clean:
build:
build.stockclock:
[solution] Starting solution build.
[solution] Loading projects...
[solution] Loading project 'c:\dev\stockclockbuild\StockClock.Common\StockClock
.Common.csproj'.
[solution] Using MSBuild version 4.0.30319.1.
[solution] Loading referenced project 'c:\dev\_SharedLibs\MDRLibs\MDR.StockPlat
form\MDR.StockPlatform.csproj'.
BUILD FAILED
Project with GUID '{32845370-6F32-411F-B4C5-383F9C3EDE29}' must be included for
the build to work.
Total time: 0.6 seconds.
Here is a copy of the build file:
<project name="Solution Build Example" default="rebuild">
<property name="configuration" value="release"/>
<target name="clean" description="Delete all previously compiled binaries.">
<delete>
<fileset>
<include name="**/bin/**" />
<include name="**/obj/**" />
<include name="**/*.suo" />
<include name="**/*.user" />
</fileset>
</delete>
</target>
<target name="build" description="Build all targets.">
<call target="build.stockclock"/>
</target>
<target name="rebuild" depends="clean, build" />
<target name="build.stockclock">
<solution configuration="${configuration}" solutionfile="Stockclock.sln" verbose="true">
</solution>
</target>
</project>

I'm assuming you're using a modern IDE, and from the NAnt Documentation:
Note: Right now, only Microsoft Visual Studio .NET 2002 and 2003 solutions and
projects are supported. Support for .NET Compact Framework projects is also not
available at this time.
In my NAnt scripts I use the NauckIT MSBuild task:
<msbuild projectFile="${solution.file}" targets="Build" verbosity="Quiet">
<property name="Configuration" value="${build.configuration}" />
<property name="Platform" value="${build.platform}" />
<arg value="/flp:NoSummary;Verbosity=normal;LogFile=${build.log}" />
<arg value="/p:SignAssembly=true" if="${isReleaseBuild}" />
<arg value="/p:AssemblyOriginatorKeyFile=${solution.keyfile}" if="${isReleaseBuild}" />
<arg value="/p:DelaySign=false" if="${isReleaseBuild}" />
</msbuild>
However that is a personal preference as you could also use the NAnt exec task and call msbuild directly.

Related

Sencha CMD Ant integration for custom web application

We are trying to integrate the Sencha CMD to our custom application ant script( build.xml) inorder to do minification of js files. Could you please let us know the steps needs to be followed for minifcation of js files . It could be useful if you could provide sample file to achieve this. We tried the following steps as per the manual to just include the sencha.jar which resulted in error "init-sencha-cmd:
[taskdef] Could not load definitions from resource com/sencha/ant/antlib.xml."
I have added the target "init-sencha-cmd" as dependency to target "build" and a property build.dir (basedir="." configured in the start of xml)
<target name="build" depends="init, dependencies, pre-compile, compile, post-compile,init-sencha-cmd" description="Builds the project." />
<property name="build.dir" location="${basedir}"/>
<target name="init-antcontrib">
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${Bundles.WebCharts.lib}/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
</target>
<target name="init-sencha-cmd" depends="init-antcontrib">
<taskdef resource="com/sencha/ant/antlib.xml" classpath="/Users/hatamm/bin/Sencha/Cmd/5.0.3.324/sencha.jar"/>
</target>

How to copy assets to build folder in FDT?

Flash Builder has an option to "Copy non-embedded files to output folder", which will copy resources loaded at runtime / not compiled into the application from source folders into the /bin-debug (build) folder.
How can I do this with FDT? Do I have to use an Ant task? If so -- I'm not familiar with Ant, how would I set this up?
I guess Ant's not so hard...the following did the trick:
<project default="copy">
<property name="from" value="./assets"/>
<property name="to" value="./bin/assets"/>
<target name="copy">
<echo message="Copying assets..."/>
<copy todir="${to}" >
<fileset dir="${from}"/>
</copy>
</target>
And I ran it via a Debug Configuration:

NAnt and build version

I use Nant for automating ClickOnce build. So after building the application I need to know what is its version (for purpose of folder creation). Also I need build autoincrementing.
For building I use msbuild.exe /t:publish
For this you can use your source code repository revision number/hash as that is often used when using subversion or git repositories.
You can also make use of a buildserver like cruisecontrol (ccnet) this will do this build version incrementing for you.
As far as I understood, you would like to do version detection/management with minimal effort.
Why don't you use AssemblyInfo auto-increment capabilities. Putting [assembly: AssemblyVersion("1.0.*")] into your AssemblyInfo.cs will increment the build number with every build. Find more information in this answer.
After compilation you can detect the assembly version via NAnt function assemblyname::get-version:
assemblyname::get-version(assemblyname::get-assembly-name('MyAssembly.dll'))
Update:
If you can't use Assembly info auto-increment capabilities, you might let NAnt create AssemblyInfo.cs with every build using NAntContrib's <version>-task.
<loadtasks assembly="C:\PathToNAntContibTasks\NAnt.Contrib.Tasks.dll" />
<target name="assemblyinfo" description="generates AssemblyInfo.cs">
<property
name="working.dir"
value="C:\src\foo" />
<property
name="build.number.path"
value="${path::combine(working.dir, 'build.number')}" />
<echo
file="${build.number.path}"
message="0.0.0.0"
unless="${file::exists(build.number.path)}" />
<version
buildtype="Increment"
path="${build.number.path}"/>
<foreach
item="File"
property="assemblyinfo.path">
<in>
<items>
<include name="${path::combine(working.dir, '**\AssemblyInfo.cs')}" />
</items>
</in>
<do>
<asminfo output="${assemblyinfo.path}" language="CSharp">
<imports>
<import namespace="System.Reflection" />
</imports>
<attributes>
<attribute type="AssemblyVersionAttribute" value="${buildnumber.version}" />
</attributes>
</asminfo>
</do>
</foreach>
</target>

How to setup xampp, phpunit, ant, zend framework

First post here, so take it easy please.
I'm working through the first chapter of Zend Framework 1.8 Web Application Development by Keith Pope in an effort to learn PHP and the MVC framework.
I thought I included all the paths correctly and installed PHPUnit 3.3 correctly as well as Zend 1.8 and 1.7.4 Xampp. with Ant version 1.8.2. However, I can't seem to get the first simplest build to build.
From looking at other q's and a's on this site I can tell some of the calls in the build.xml file for PHPunit aren't correct and I've tried to correct them, but now I'm getting the error that C:\xampp\htdocs\zendStoreFront/library/Zend does not exist and when I add the Zend directory in I get lots and lots of errors which is telling me that's probably not the right answer.
I understand there's a lot going on in the whole project and I'm willing to take the time to learn, but one question- On the line that says " --log-xml ${basedir}/build/logs/phpunit.xml ", is this file expected to be in this directory already, or does the build process create the file? On some attempts an error that's echo'd back say that file doesn't exist and currently there is no file in that directory.
Thanks,
hestes
cmd line output
*****************
C:\xampp\htdocs\zendStoreFront\build>ant
Buildfile: C:\xampp\htdocs\zendStoreFront\build\build.xml
buildPreparation:
getProps:
[echo] ---- Build Properties ----
[echo]
[echo] OS is Windows XP
[echo] Basedir is C:\xampp\htdocs\zendStoreFront
[echo] Property file is C:\xampp\htdocs\zendStoreFront/build/ant.properties
[echo] Script-suffix is .bat
[echo]
[echo] ---- Storefront Properties ----
[echo]
[echo] Environment is development
configure:
[copy] Copying 1 file to C:\xampp\htdocs\zendStoreFront\application
test:
[exec] The filename, directory name, or volume label syntax is incorrect.
[exec] PHPUnit 3.3.10 by Sebastian Bergmann.
[exec]
[exec] C:\xampp\htdocs\zendStoreFront/library/Zend does not exist
BUILD FAILED
C:\xampp\htdocs\zendStoreFront\build\build.xml:28: exec returned: 1
Total time: 1 second
C:\xampp\htdocs\zendStoreFront\build>cd ..
C:\xampp\htdocs\zendStoreFront>ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Build.xml File
<target name="getProps">
<property file="${basedir}/build/ant.properties" />
<condition property="script-suffix" value=".bat" else="">
<os family="windows" />
</condition>
<echo message="---- Build Properties ----" />
<echo message="" />
<echo message="OS is ${os.name}" />
<echo message="Basedir is ${basedir}" />
<echo message="Property file is ${basedir}/build/ant.properties" />
<echo message="Script-suffix is ${script-suffix}" />
<echo message="" />
<echo message="---- Storefront Properties ----" />
<echo message="" />
<echo message="Environment is ${environment}" />
</target>
<target name="test" depends="getProps">
<exec dir="${basedir}/tests" executable="phpunit${script-suffix}" failonerror="true">
<arg line="--colors --coverage-html ${basedir}/build/report
--log-xml ${basedir}/build/logs/phpunit.xml
--log-pmd ${basedir}/build/logs/phpunit.pmd.xml
--log-metrics ${basedir}/build/logs/phpunit.metrics.xml
--coverage-clover ${basedir}/build/logs/phpunit.coverage.xml
AllTests.php"/>
</exec>
</target>
<target name="configure" depends="getProps">
<copy file="${basedir}/application/application.php.dist"
tofile="${basedir}/application/application.php" overwrite="true" />
<replace file="${basedir}/application/application.php" token="#ENVIRONMENT#" value="${environment}" />
</target>
<target name="buildPreparation">
<mkdir dir="${basedir}/build/logs" />
<mkdir dir="${basedir}/build/report" />
</target>
<target name="clean">
<delete dir="${basedir}/build/logs" />
<delete dir="${basedir}/build/report" />
</target>
<target name="build" depends="buildPreparation,configure,test"/>

Problem with .cod deployment to simulator

This is a re-post of a topic on the Blackberry Development Forums, but I wasn't getting any answers there, so I thought I would try SO.
I have an in-house library that I developed called Ichabod that is required by one of our applications, Spyder, which runs on the Blackberry 4.5.0 operating system (our original target was for 8330 devices). I had everything working with bb-ant-tools to compile the library, which is in a separate project, and deploy it to C:\Program Files\eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.21\components\simulator. The Spyder application debugged just fine in the eclipse plugin (I am using Galileo with the 1.1.2 version of the RIM plugin).
Today, however, I went to debug the Spyder application after making a couple of changes to the code (no code changes were made in Ichabod), and found that the application couldn't find the Ichabod module all of a sudden. I noticed that there was now a net.rim.ejde.componentpack4.5.0_4.5.0.28\ directory in my eclipse plugins folder, so thinking that perhaps I updated the component packs without realizing it, I adjusted the target path of the Ichabod library, and rebuilt it with bb-ant-tools. Same problem. So, I tried removing the .cod and all associated files from both the 4.5.0.21 and 4.5.0.28 directories, recompiled the Ichabod library to deploy to both locations, and found that it works with 4.5.0.21, but not with 4.5.0.28 (it's not listed in the modules screen under Settings, either).
I have verified that the .cod file is present in the components\simulator folder, but I can't seem to figure out why the simulators don't recognize the file.
Any suggestions?
My bb-ant-tools build.xml script is attached.
Thanks,
~Scott
<taskdef resource="bb-ant-defs.xml" classpath="lib/bb-ant-tools.jar" />
<property name="jdehome" value="C:\Program Files\eclipse\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components" />
<property name="simulator" value="${jdehome}\simulator" />
<property name="bin" value="${jdehome}\bin" />
<target name="deploy" depends="build" description="Builds and Deploys Project (installs to simulator)">
<copy todir="${simulator}" overwrite="true">
<fileset dir="output">
<include name="*.cod" />
<include name="*.debug" />
<include name="*.csl" />
<include name="*.cso" />
</fileset>
</copy>
</target>
<target name="clean" description="Cleans the output directory">
<delete dir="output"/>
<mkdir dir="output"/>
</target>
<target name="build" depends="clean" description="Builds Project">
<rapc jdehome="${jdehome}"
destdir="output"
output="Ichabod"
quiet="false">
<jdp type="library"
title="Ichabod Library"
vendor="My Company"
version="0.3"
description="Ichabod Library for Mobile Applications"
arguments=""
systemmodule="false"
runonstartup="false"
startuptier="7"
ribbonposition="0">
</jdp>
<src>
<fileset dir=".">
<include name="src/**/*.java" />
<!-- <include name="resource/**/*.*" /> -->
</fileset>
</src>
</rapc>
</target>
</project>
So it appears, after removing the 4.5.0.28 plugin from Eclipse and reinstalling it, that this was what was causing my troubles. I don't know whether this has anything to do with it, but I also removed the JDE 4.5.0 library (which was correctly set at version 28) from the build path of the Ichabod project and replaced it with the same JDE.
After all of this nonsense, my library now shows up in the simulator. Thanks to all who looked at this. Hopefully this will help someone else.