Running custom build file

Oxygen general issues.
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Running custom build file

Post by anderszvensson »

Hi,

I'm trying to run a custom build file with Oxygen, so I have specified the file in the transformation scenario dialog, and I can see in the log that it is being used, so that's no problem.

But the problem is it doesn't seem to care about the properties I set there, which I assumed would override the parameters in the scenario dialog (which won't allow me to leave output.dir empty):

Code: Select all

<project name="multiple" default="linux" basedir=".">
<property name="dita.dir" value="${basedir}"/>
<import file="${dita.dir}${file.separator}integrator.xml"/>
<target name="windows" depends="integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<property name="output.dir" value="C:\DitaContent\out\windows"/>
<property name="dita.input.valfile"
value="${dita.dir}${file.separator}demo${file.separator}fo${file.separator}Customization${file.separator}filters${file.separator}windows_filter.xml"/>
<property name="transtype" value="eclipsecontent"/>
</ant>
</target>

<target name="linux" depends="windows, integrate">
<ant antfile="${dita.dir}${file.separator}build.xml" target="init">
<property name="output.dir" value="C:\DitaContent\out\linux"/>
<property name="dita.input.valfile"
value="${dita.dir}${file.separator}demo${file.separator}fo${file.separator}Customization${file.separator}filters${file.separator}linux_filter.xml"/>
<property name="transtype" value="eclipsecontent"/>
</ant>
</target>
</project>
What I want to do is run two consecutive runs, where the windows target is run first (set as depends on default target linux), and then the linux target should run. These have separate output.dir set, so I want the output in different directories.

But again, these output.dir parameters don't seem to come into play. The output ends up in the directory specified in the scenario dialog (c:\ditacontent\out). And strangely, one of them is filtered correctly, the other one has a double extension (perhaps something that happens because there already is a file with the same name after the first run?), but with no content at all, except the xml declaration...

What am I doing wrong?

Regards,

Anders
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Running custom build file

Post by Radu »

Hi Anders,

The parameters defined in the build files have lower priority than the parameters passed to the ANT process in the command line. This is how the ANT task works:
http://ant.apache.org/manual/Tasks/ant.html

Unfortunately Oxygen looks at the output directory value set in the Output tab of the scenario edit dialog and sends it to the ANT process as "-Doutput.dir="value..." thus overwriting the value in the build files. You can see this by searching for output.dir in the console output.
Unfortunately I cannot give you a workaround for this. We'll discuss this and if we find fix for this in a future version of Oxygen I'll update this post.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Re: Running custom build file

Post by anderszvensson »

Ok, I thought that was the whole point of being able to point to your own custom build file? So basically, the only point of specifying your own build file is if you want to specify other parameters than the ones already set in the dialog?

I guess I'll have to run these transformation outside of Oxygen then. Good to hear you might look at it for future releases though, because I think it would be very useful.

Regards,

Anders
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Running custom build file

Post by Radu »

Hi Anders,

The problem is that ANT considers parameters sent through the command line as having a very high priority which cannot be overwritten in any way in the build files. Maybe we can allow the output dir and other parameter fields in the Output tab to have empty values and not send those values to the ANT processor if empty.
We'll see what we can do, you can also set up an external tool in Oxygen to run ANT.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71
Joined: Wed Jul 14, 2010 11:38 am

Re: Running custom build file

Post by anderszvensson »

Ok, if you did add such possibilities for future releases that would be great. In either case, I just have to say that I think you've done a wonderful job so far, the editor just keeps getting better and better :-).

Regards,

Anders
Post Reply