Hi!
I have yet another problem:
I have a few projects that are most of the time all the same, so they can be
built from a template and in the end just a few files will be overwritten with
project specific ones.
MY_TEMPLATE is a WAR file installed in local repository and contains:
jsp/screens/de/main.jsp
jsp/screens/de/page1.jsp
jsp/screens/de/page2.jsp
MY_PROJECT contains:
src/main/webapp/jsp/screens/de/page1.jsp
So as final result I want to have main.jsp and page2.jsp from MY_TEMPLATE and
page1.jsp from MY_PROJECT. So my first try was sth like this:
----------------------------
desc "My Project"
define "my_project" do
define "my_war-war" do
package(:war).merge(artifacts(MY_TEMPLATE))
end
[...]
end
----------------------
But this doesn't work. All files will be taken from MY_TEMPLATE. And I am not
too surprised. So let's change the merge line like so:
package(:war).merge(artifacts(MY_TEMPLATE)).exclude("jsp/screens/de/page1.jsp")
Now I got what I want. So where is the problem?
The problem is, that my real life project is not that simple. It contains many
jsp files that should replace the ones in the template. I was hoping to use
something like this:
jsp = FileList[_("src/main/webapp/**/*.jsp")].map { |fn|
fn.gsub(_("src/main/webapp")+"/","")}
package(:war).merge(artifacts(MY_TEMPLATE)).exclude(jsp)
Very unfortunately, the exclude method doesn't seem to accept arrays. So I
tried it like this:
jsp = FileList[_("src/main/webapp/**/*.jsp")].map { |fn|
fn.gsub(_("src/main/webapp")+"/","")}
zip("temp.zip").merge(artifact(MY_TEMPLATE))
jsp.each do |file|
zip("temp.zip").exclude(file)
end
package(:war).merge(zip("temp.zip"))
But files cannot be excluded like this form a zip it seems.
I am a bit stuck now. How do I achieve what I want to do?
Again, thanks in advance for any help.
Cheers, Ingo =;->