ant and reducer

103 views
Skip to first unread message

krange

unread,
May 4, 2011, 3:57:28 AM5/4/11
to apparat-framework
Hi,

I installed apparat yesterday and downloaded the apparat-ant-example
to start to learn how to to get apparat integrated with our ant
builds. I can run the build script but it doesn't seem to compress.
Obviously I'm missing something here :)


What gets producted during build is that the apparat version is
actually larger than the regular version (8kb versus 4kb). I haven't
modified anything here. When the TDSI runs, I get this output that 7z
is not present on PATH. I installed the latest p7zip and can confirm
it's in my path. Any ideas?

[tdsi] [INFO] Apparat -- http://apparat.googlecode.com/
[tdsi] [INFO] Launching tool: Turbo Diesel Sport Injection
[tdsi] [INFO] Cpool rebuild required.
[tdsi] [WARNING] 7z is not present on PATH. Fallback to normal
compression.
[tdsi] [INFO] Completed in 936ms.


I also tried adding reducer to the ant build but it can't seem to find
it. What am I missing?
[reducer] Could not find apparat.tools.reducer.Reducer. Make sure you
have it in your classpath

Cheers,
Kris

Joa Ebert

unread,
May 4, 2011, 4:02:11 AM5/4/11
to apparat-...@googlegroups.com
Hi Kris,

please share your build script so we can help you. Which operationg
system are you using?

7-Zip on MAC might be problematic if I recall correct and you need so
specify the 7z executable manually using one of the hidden gems[1].

It is also hard to explain why something might get bigger if reducer
does not run, but some kind of TDSI. The 4kb added look like the LZMA
overhead.
The code for the LZMA decoder requires at least 4kb so you should only
use it for big SWF files.


Best,

Joa


[1] http://code.google.com/p/apparat/wiki/HiddenGems

Simon Richardson

unread,
May 4, 2011, 4:03:13 AM5/4/11
to apparat-...@googlegroups.com
It looks like you're missing 7z or have not made it available on your environmental PATH for tdsi in Apparat to see.

Also you need to add APPARAT_HOME/bin to your PATH as well.

si

kris range

unread,
May 4, 2011, 4:11:59 AM5/4/11
to apparat-...@googlegroups.com
Thanks for the quick replies! Sorry, forgot to mention that I'm on OSX...

Joa - Thanks I'll look into the hidden gems URL, sounds promising.
Will let you know the results. What you say about the LZMA overhead
makes complete sense. I was just running the "apparat-ant-example"
from googlecode as a test and those files it looks like are small.

Simon - I can confirm that I have the p7zip port in my path and can
run both 7z and 7za from command line. I also have apparat in my PATH
as I can call apparat (or reducer, tdsi, etc) from the command line
too.

Simon Richardson

unread,
May 4, 2011, 4:20:08 AM5/4/11
to apparat-...@googlegroups.com
This might sound strange, but are you running this from in eclipse or other IDE?

I've had problems where eclipse wouldn't pick up my PATH variables on OSX, try in the command line - just a thought.

Joa Ebert

unread,
May 4, 2011, 4:26:50 AM5/4/11
to apparat-...@googlegroups.com
If I recall correct you need to speficy the direct path to 7z on OSX.

kris range

unread,
May 4, 2011, 5:12:59 AM5/4/11
to apparat-...@googlegroups.com
Simon - Great, thanks for that idea. I was running the build from
within eclipse like you said but running the build file instead from
command line seemed to fix the "7z not found" issue. Rrunning TDSI,
file size is now 390kb instead of 406kb. Will have to investigate
getting those $PATH variables into eclipse somehow...

It still can't find reducer in ANT though...even running the build
from command line. TDSI works. For running reducer, I'm just using the
example ant build file and added the following:

<reducer in="${dir.bin}/example-apparat.swf"
out="${dir.bin}/example-reduced.swf" mergeABC="true" />

Simon Richardson

unread,
May 4, 2011, 5:28:02 AM5/4/11
to apparat-...@googlegroups.com
Either add a property file or add a property directly... either way it's annoying!
Screen shot 2011-05-04 at 10.27.12.png

kris range

unread,
May 4, 2011, 7:18:49 AM5/4/11
to apparat-...@googlegroups.com
Unfortunately, this doesn't seem to fix the issue. I still get the

"[WARNING] 7z is not present on PATH. Fallback to normal compression."
using this method in Eclipse...

Will have to do some more searching...it feels like Eclipse should be
able to pick up the PATH you have set and can access via the
terminal...

On Wed, May 4, 2011 at 11:28 AM, Simon Richardson <stick...@gmail.com> wrote:
> Either add a property file or add a property directly... either way it's annoying!
>
>

Alan Klement

unread,
May 4, 2011, 11:26:19 AM5/4/11
to apparat-...@googlegroups.com
I know a fair bit about Eclipse - but not an expert. If any exists here, and I'm wrong, please correct me.

In my experience, I've often had Eclipse not recognize global variables or my profile when executing. The best thing I can guess is that Java / Eclipse are running with it's own profile in it's own environment.

I also encounter this when using Ant.  I can use ant to call build in executables:

<target name="folder">

<exec executable="mkdir">

</exec>

</target>



But a custom one wont work:

<target name="apparat">

<exec executable="apparat">

</exec>

</target>



Event though I can run Apparat via the terminal just fine.

Alan
Reply all
Reply to author
Forward
0 new messages