3

I'm using the "b-g" Processing build system for Sublime Text 2 (link) which works perfectly fine.

It's using the following command to initiate the build via the processing-java executable (I'm on Windows btw):

"cmd": ["processing-java", "--sketch=$file_path", "--output=$file_path/build-tmp", "--run", "--force"]

This will open the Processing application in a Java Environment.

Since I am targeting mobile devices I'd like to use JavaScript Mode though (the Processing IDE will fire up a server listening to some strange port serving a web page that you can access using any browser when exporting a sketch that way).

As I would like to avoid having to use the Processing Editor (usage of "foreign" editors has apparently been disabled in v2) I was wondering if I could trigger that behavior via my build system / the CLI?

Unfortunately I cannot find any information on that at all on the web and $ processing-java --help doesn't mention export modes as well.

morten.c
  • 3,414
  • 5
  • 40
  • 45
m90
  • 11,434
  • 13
  • 62
  • 112

1 Answers1

2

No, but you can concatenate your .pde files into one source file, and then run that through the "processing-helper" for processing.js. If you clone the Processing.js repo (links on https://github.com/processing-js/processing-js) then you can load the ./tools/processing-helper.html in a browser (ideally from localhost, not file), and then just paste in your code, hit "convert", and out comes the compiled JS source.

That said, there's not all that much benefit to precompiling, since Processing.js is a browser technology. It's not "an editor", a sketch running using Processing.js is just a webpage, and all mobile devices support web pages.

Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153
  • Thanks for the answer, I wasn't aware that the "build process" was as simple as concatenating the `.pde`s. I built my own build system now and it seems to be working most of the time, yet sometimes I get weird errors when concatenating a lot of files. Do you have any information on how (order, preprocessing) the IDE will concatenate the files? Thanks! – m90 Jun 11 '13 at 18:31
  • 2
    for the PDE (the pure Processing one), the order doesn't matter. All the code ends up inside a single class that extends PApplet, and then javac gets to play with it. For Processing.js, the files are loaded in "the order you give" (using `data-processing-sources`) and it performs the compile step after everything's been concatenated. – Mike 'Pomax' Kamermans Jun 11 '13 at 23:25