Hello everyone!
I have been using buildr successfully for quite a while now. Everything works
fine so far, however, now with some more experience I wanted to clean my build
files. But this turned out not to be so easy.
Here a short overview of what I am building:
An EAR with some WARs inside. The WARs use a JAR artifact, the framework. This
artifact contains a template properties file along with a YAML file which
contains default values. For each WAR this file must be run through a filter to
set WAR specific settings and be included in the WAR.
Here are my questions:
1. Right now I have a few "require" directives in my buildfile which run a
couple of pre-build tasks:
- unzip the properties template and its default YAML file
- merge the default YAML file with WAR specific YAML file
What I do not like about the current approach:
The unzipping and merging is done no matter what, even for the clean task where
I dont need it. I would like to run this unzipping and merging like that:
- before the actual building
- only for the build task
- only once for the whole build process
I tried this by enhancing the build task, but...
2. consider this very simple buildfile:
--------------- snip --------------
# Generated by Buildr 1.3.5, change to your liking
# Version number for this release
VERSION_NUMBER = "1.0.0"
# Group identifier for your projects
GROUP = "buildr-test"
COPYRIGHT = ""
desc "The Buildr-test project"
define "buildr-test" do
project.version = VERSION_NUMBER
project.group = GROUP
manifest["Implementation-Vendor"] = COPYRIGHT
build do
puts "main"
end
define "app-war" do
build do
puts "my app"
end
package(:war)
end
end
--------------- snap --------------
If you run buildr with it, you will notice that it outputs in the following
order:
Building buildr-test
my app
main
If "main" came before "my app" I would put the stuff I want to do there and be
happy. But since it is not like that I am a little bit stuck.
3. Including/Excluding files
I have seen issue BUILDR-335, but I still have a questions about excluding
files:
Let's say I want to exclude a folder called "dummy" with all its contents from
my webapp folder:
package(:war).exclude("**/dummy")
Now this will remove ALL folders called "dummy" somewhere in my directory tree.
Clearly I do not want this.
So I tried:
package(:war).exclude("**/webapp/dummy")
Now this worked. It is a workaround I can live with, but I never found out what
the full path to my dummy folder would be. I must say, the whole process of
including and excluding is still very mysterious to me.
Thanks in advance for any help!
Cheers, Ingo =;->