Ant by default excludes vssver.scc file from all filesets. This is very convenient.
But VSS2005 uses vssver2.scc file for the same purpose :(
Can I modify Ant's default excludes somehow?
I do not like an idea to add <exclude name="vssver*.scc"/> to each fileset...
It's right there in the documentation:
defaultexcludes indicates whether default excludes should be used or
not (yes | no); default excludes are used when omitted.
which links to
This is the default list; note that you can modify the list of default
excludes by using the defaultexcludes task.
which links to
Alters the default excludes for all subsequent processing in the
build, and prints out the current default excludes if desired.
Related
We need to output some logging entries into a file, but only when the filename is specified. The current task reads:
<echo fileName="${debugLog}" message="${message}"/>
Currently, when the debugLog-property is not set, it creates a file named, literally "${debugLog}". How can I make it simply skip the task, when the property is not defined?
Our ant is old (1.6.5 - and cannot be upgraded), and the if:set="debugLog" attribute is simply ignored, but we use ant-contrib already, and <if> is available.
I want to run ant -emacs for only a certain target
can i add something like
<property name="build.compiler.emacs" value="true" />
to do this?
You can define a property like that anywhere in your build file. But once it is set, e.g. when containing target is invoked, it remains set.
Yes, either to your ant buildfile or to a build.properties file in this Java properties format, according to the these rules specified by ant.
Possibly one of those really terrible beginner questions where the manual will tell you everything, but, anyway, take this line below:
ant -Dfoo=bar buildme
in my build script, what is the property that holds "buildme"?
The list of targets invoked is available in the property
ant.project.invoked-targets
If there is a default target specified, then that will be the invoked target. If one or more targets are specified on the command line, these appear comma-separated in the property. Note that the property only becomes set once execution passes to a target - if you try to read the property outside of any target, it will be unset.
So, if the project has a default target 'zero':
$ ant one two
# ant.project.invoked-targets is set to:
one,two
and
$ ant
# ant.project.invoked-targets is set to (default):
zero
Seems like ant.project.invoked-targets is not available in ant 1.7.1
Not sure I understand your question, but "buildme" is the target to execute, not a property.
ant [options] [target [target2 [target3] ...]]
You "pick it" by creating the corresponding target:
<target name="buildme">
<!-- tasks that will execute here -->
</target>
As for the foo property, you "pick it" by using ${foo}.
How do you call a specific target in all build.xml located in all subdirectories using wildcards (ie not hard coding the subdirectory names)? The below answer is hardcoded. Is there a way to do it without hardcode?
Similar to this question: Pass ant target to multiple build.xml files in subdirectories
Use the Ant subant task like this:
<subant target="sometarget">
<fileset dir="." includes="*/build.xml" />
</subant>
If you include an "inheritall" attribute (same as how it's used in but defaults the opposite), you can share all your current project's properties and everything too. This also makes it very easy to overwrite tasks defined in your main build.xml file if you need to.
Read more about it here.
I'll setup different properties within my build.properties file. I use these to dynamically build paths in my targets.
Define the location of your build.properties file:
<!-- all properties are in build.properties -->
<property file="build.properties" />
Use those properties in your targets:
Properties in the build properties are similar to setting up an .ini file:
project.rootdir=c:/Deploy
project.tempbuilddir = c:/Deploy/Temp/Inetpub
project.builddir=c:/Deploy/Inetpub
# Build prefix will be added to that tags urls (.../tags/${project.buildprefix}Build_${today.date})
project.buildprefix=ACA_
I guess you could use a dynamic file as your properties file, if necessary, as long as you define the proper path to the file. You could point it to a server-side file to dynamically write your properties file (ColdFusion, PHP, JSP, whatever).
I've used ant-contrib's foreach task to do something like this.
http://ant-contrib.sourceforge.net/tasks/tasks/foreach.html
Sounds like a perfect candidate for the <subant> task.
Is there a way to have an Ant Fileset->IncludesFile attribute take a property file OR any other file that contains a list of Java class files to exclude?
Eg:
File A.properties OR A.java contains listing
abc.class
mno.class
xyz.class
Is there a way to say to point excludesFile to file A.properties.
<fileset dir="...">
<excludesFile file="A.properties" />
</fileset>
The behavior that I want is when Java runs, it excludes the Java files listed in this file (A.properties)
Hmm...not sure if it's case sensitive. The documentation at http://ant.apache.org/manual/Types/fileset.html shows "excludesfile", all lowercase, as with other ant directives.
I'm not sure exactly what you are asking. If you have a fileset which is including files you would like to exclude, and you want to specify that list of files to exclude in an external file, "excludesfile" is the correct way to do it.