We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › Compile P5 from command line
Page Index Toggle Pages: 1
Compile P5 from command line (Read 2944 times)
Compile P5 from command line
May 24th, 2007, 9:04am
 
After a long break from P5, yesterday I started playing with one of my sketches I did with OpenGL and I ported it quite easily in Eclipse. To export as app I could use FatJar but I was wondering if there was a way to use the fantastic export possibilities P5 has (exporting for instance the executable for mac/linux/win).
Eventually I would create an Ant script to compile and copy my files to the scketch folder, where maybe I my sketch will just instantiate the main class. Does it sound silly? Will it have much more sense to do everything in Eclipse? These doubts because I definitely rely more on P5 capacity to create the whole package than mine Smiley

Any opinion/suggestion?

Thanks, chr
Re: Compile P5 from command line
Reply #1 - May 24th, 2007, 9:36am
 
you can check out the processing source from svn and alter it to be able to use it to compile from command-line (like opencode does serverside):
http://dev.processing.org/bugs/show_bug.cgi?id=219

a similar (modified) setup can do the same for exporting as application ... i guess.

F
Re: Compile P5 from command line
Reply #2 - May 25th, 2007, 1:30am
 
Thanks Fjen for the precious link. It doesn't look that straight forward but I'll give it a go.

Cheers, chr
Re: Compile P5 from command line
Reply #3 - Apr 9th, 2008, 7:55pm
 
give this a try (if you're using eclipse) -- needs a bit more more testing but mimics the processing export functions, handling applets & applications, with/w'out opengl -- feedback appreciated...
cheers,
-dch

http://www.rednoise.org/EclipseP5Exporter
Re: Compile P5 from command line
Reply #4 - Apr 16th, 2008, 12:21pm
 
This looks like a great solution. I tried it yesterday on my Eclipse/Ubuntu framework but didn't seem to work tho, it was giving an error saying "Reason:" and then blank. Is there a way I can get a log for you to know what's going on. Also, at first I didn't know where it was exporting, then I found out it was exporting on my user folder, I wonder if there is a way to set where you want to export.

Looking cool tho Cheesy
Re: Compile P5 from command line
Reply #5 - Apr 25th, 2008, 1:43am
 
Give it another try.. try to work out the last few bugs on linux (and os x)... -dch
Re: Compile P5 from command line
Reply #6 - Oct 29th, 2008, 4:13pm
 
Hello there!

After few months off I am visiting processing base again to find a lot of changes in new releases.. it is wonderful to see this project so alive!

First of all, many thanks for adding a command line option to processing, it is very good news for all bashers.

So, I have painlessly compiled on linux I tried to create few easy-rider bashscripts to ru the sketch and after while I managed to get working all well..

Well, everything except a library imports.. in fact every time I am trying to compile import-containing sketch within bash, it throws a nullpointer:  

Code:

Exception in thread "main" java.lang.NullPointerException

at processing.app.Sketch.preprocess(Sketch.java:1415)

at processing.app.Sketch.build(Sketch.java:1471)

at processing.app.Commander.<init>(Commander.java:201)

at processing.app.Commander.main(Commander.java:95)


...
I am running.
Ubuntu Hardy 32-bit, java 1.5 (sun)
./processing --sketch=path/to/sketch/ --out=/tempSomewhere/ --run  

The problem seems to be that processing is unable to locate right path to libraries folder..

on line 1415 in Sketch.java is
Code:

...= (File) Base.importToLibraryTable.get(entry) ;
which returns 'null'

I am quite confused where to put libraries now, where exactly the processing is looking for them..

anyway when I try to define argument preferences "preferences=/home/.prss/pref.txt" it seems to be unrecognized for me(?)

Anyone has experienced similar behaviour or even have some good advice?

Thanks a lot!
kof
Re: Compile P5 from command line
Reply #7 - Dec 10th, 2008, 3:07am
 
Heh, answering myself.

I know that command line option is not so well debugged and I am not sure if this discussion board is a right place where to write this post, the changes I made is completely non-standart, but it can helps someone, maybe.

Anyway, now after some dirty steps I am finally able to run any of sketch I made before including libraries support from command line.

basic how to follows:

the line which caused the problem before is pointing to something called "library hashtables".. as mentioned before, it seems that there is some difference between running PDE and shell script processing, simply these hashtables are not created on startup as it is in GUI-ed version;

so dirty change no.1 in Sketch.java @ line 1415 I have changed:
Code:
(file) importToLibraryTable(entry); 

to Code:
 new File("pathToLibraries") 



..I am not very sure what an effect it brings to processing itself; but anyway, compiler can now continue to work with this cosmetic modification.

dirty change no.2
after recompiling I have made very awful hack to executable processing script, to point it right way to my personnel collection of libraries
in processing script I have added the line were the processing is looking for java classpaths:
Code:

libraries/*/library/*.jar \

this mod is causing that every time you run any sketch it will browse up all of your library folder, even if you dont load any of them (so it is extremely bad solution!)
optionaly on linux you can create a symlink to your libraries folder somewhere

and the last and best of all, award winning ugly hack no.3
now, when you try to fire up for instance opengl-based sketch it will throws that processing cant locate gluegen-rt or something like that, this means processing cant locate other library componets as a required dll-s and jnlib-s and so on, so my solution was to simply copy all of them needed to a processing root folder (this is very messy!)

and that is it, now all of the sketches are running smoothly without any problems

/////////////////////////////////////

this is tested on linux only and as you can see it is not really elegant way, but for a script punkers as I think I am is good enough.

>> if anyone has better solution please let me know, I am trying to track down where the problem begins and I believe that solution can be very trivial.

processing beta is dead! long life the processing!

best,
kof
Page Index Toggle Pages: 1