View executed commands in eclipse - eclipse

I am working on a eclipse based product. Basically it's a plugin built over eclipse which adds multiple functionalities, buttons, menu entries, a new interface and other stuff. I would like to automate some daily tasks but I don't know what commands are running behind the scenes. Is there a log with the running commands or something similar? I don't have acces to the source code neither can contact the product owners.

There is no simple log of commands.
You can enable tracing for a lot of different components of Eclipse but the trace output generally assumes you know a lot about Eclipse internals.
Recent releases of Eclipse have a preference page to enable tracing in 'General > Tracing'. This is described in the Eclipse help here.
You can also enable tracing using command line options as described here

Related

How to debug JavaFX application with jdk14/javafx14/Eclipse v.2020-03?

I'm trying to run a JavaFX application to test some custom controls based on jdk14 and JavaFX14. My operating system is Windows 10, the IDE is Eclipse 2020-03, and I use m2e Maven plugin. The controls are exact copies of controls developed under jdk8 and JavaFX8; the earlier controls pass all tests, there was no problem with debugging.
There is no problem getting a test application to run using jdk14 and JavaFX14, but breakpoints are ignored regardless of whether I run in debug mode, or run mode, or whether I modify the Maven command from javafx:run to javafx:debug (that did NOT work) or to javafx:run#debug.
This issue seems to have been addressed several times in the context of a Netbeans IDE (see stackoverflow discussion, and I copied in the text from the modified plugin as suggested, but to no effect.
I have the following questions:
What must be done in order to debug a JavaFX application under the conditions described above?
Who is responsible for dealing with this? Eclipse? OpenJFX? Somebody else?
Based on the principle that whatever solution is developed, it should be as user friendly as the debugging process under jdk8 and JavaFX8 (i.e. before JavaFX and everything else got decoupled from Oracle), is it reasonable to expect that a solution along those lines will be available in the near future? Is anybody working on it now?
Thanks for feedback.

Apama 10.3: Add pysys nature to projects

I am working with Apama 10.3, in Software AG Designer. I have a project that I'd like to add the Pysys nature to my project, but the usual attempts (right-click on project name, project > properties, etc.) don't help. I couldn't find anything in the documentation either.
How can I work with Pysys in Designer, please? I'd like to be able to build my tests via the IDE, for consistency and convenience.
Currently eclipse/Designer doesn't have a PySys nature, but what you can do is add a generic eclipse "Python" nature – which you can do using "PyDev".
And then to launch pysys from eclipse you’ll need to add a launch configuration. There are various options but the most convenient for this purpose is the “external tool” eclipse feature.
You need to invoke pysys.py with the right environment for locating python and also Apama if you want to use it with the Apama extensions. If you’re using PySys with Apama 10.3.1+ this is easy as you can use the new capability of the apama_env.bat script to execute a command e.g. ${apama_home}\bin\apama_env pysys run –n 0 –purge. If you’re on an earlier version I’m afraid you probably need to create a trivial .bat script of your own that first runs apama_env and then pysys %*
You'll want to set the working directory in the eclipse launch config go ${project_loc}/tests so it runs all tests. Or alternatively, ${selected_resource_loc}, to invoke a specific test subtree. You could create separate launch configs for both use cases.

Why are my Eclipse project builds so slow?

We use Eclipse (Indigo, with STS). Certain of our projects take inordinately long to build. Often the progress indicator sticks on, say, 87%, for 30 seconds.
I'm trying to find out what Eclipse is spending it's time on during the build cycle. I hope to be able to optimize the build or disable components that are causing it to be so slow. I'd like to see a log file saying ("compiling java code", "processing resources", etc).
I've poked around the log files in the .metadata directory. I've looked on the Eclipse site for tips. I've tried using "-debug" when starting Eclipse. I still can't find the information I'm looking for.
Is there any way to get Eclipse to spit out a log of what activities it is spending its time on when it builds a project?
What kind of projects are these? Java? Dynamic Web? Two things to look at for hints about what's going on are in the project Properties dialog; look at the Builders section and the Validation section. Try disabling the validations to see if that makes a difference in your build times.
To get some insight into what's happening at the times when the build seems to hang, try setting the -debug and -consoleLog options, as described here.
Disable your virus scanner software for your workspace and project directories. I increased the speed of my build in that way.
You can go to edit Windows->preference->general->workspace->build order to edit the default that exist according to your project need.
And check the maximum number of iteration when building with cycle.
I hope it works.
Since eclipse is a Java application, the usual debugging tools are at your disposal. In particular, you might try connecting to eclipse with JConsole and inspect the thread dump taken when the build "hangs", or run eclipse within a profiler.
You might find out things like a validator trying to download an xml schema, and waiting for the timeout since eclipse is not configured to use the corpoate proxy server - something which is very hard to find out by other means ;-)
Look into Apache Ant build scripts. Eclipse has support to auto generate them as a starting point instead of coding the whole thing by hand. The shop I worked in used tuned ANT scripts to optimize and control build order. We then piped output to log files using shell scripts.
You can try and replace with this aapt . My build for a particular project went from 3 minutes to 41 seconds....
This is an old post but thought of sharing my solution. I was using eclipse Luna and I noted that when you keep on working on a GIT branch without checking into git over the time the build becomes very slow. In my case I just deleted the folder .git and the file .gitignore and the build was very fast. Please note that this will disconnect eclipse from git, therefore use this aproach only if you know how to connect back to git branch using git commands.

A good development environment setup for Web2Py

Have been trying out Web2Py for a couple of days now and I decided it to be a keeper. But there is one thing that concerns me a lot and that might be a showstopper in the end. I need a nice development environment & setup I can trust and be productive with. Coming from the MS Visual Studio world I'm looking for something with good autocomplete / intellisense + functions for versioning and deployment.
I did some attempts to edit my code in Eclipse but it needs additional setup to run with autocomplete, and for debugging I dont know if it's possible. (Noticed there was a Django project template in Eclipse which is a bit tempting I must say.)
Wing Ide has a instruction on how to get web2py up and running and I am up to testing that one. Not free, but very cheap compared to much in the Windows world.
I also want a good versioning (hg) setup, and preferably a semi-automatic FTP-deployment-method.
What IDE do Web2Py developers use, and how do your setup look like?
A complete setup script for a project in a good IDE would be awesome! (Just like the installation is, one click to get it running 100%).
Pycharm looks good, perhaps that one can add web2py support http://youtrack.jetbrains.net/issue/PY-1648
Thanks a lot!
OS: Windows 7/Windows XP
IDE: NetBeans
Version control: TortoiseHg/NetBeans
Debugger: winpdb
Shell: IPython
Publish: WinSCP/PuTTY/TortoiseHg
Scripts
Once I create a new project in web2py I add a few scripts to my main app folder:
web2py\applications\myapp\DebugWinpdb.bat:
C:\Python25\Scripts\winpdb.bat ..\..\web2py.py -i 127.0.0.1 -p8000 -mypassword
web2py\applications\myapp\DebugShell.bat:
C:\Python25\Scripts\winpdb.bat ..\..\web2py.py -S myapp -M
web2py\applications\myapp\Shell.bat:
python ..\..\web2py.py -S myapp -M
IDE
As others have stated you need to do some extra stuff to get autocomplete/intellisense for web2py no matter what IDE you use.
For me NetBeans was a good compromise between does-everything-if-only-you-can-figure-out-how (Eclipse/PyDev) and does-the-basics-but-few-extras (PyScripter).
NetBeans Setup (Project Properties):
Python Category
Python Platform: Python 2.x (default is Jython)
Run Category
Main Module: web2py.py
Application Arguments: -i 127.0.0.1 -p 8000 -a mypassword
NetBeans Pros:
Tight Mercurial integration
Highlights which lines have been added, changed, or deleted in your source file as you edit it
Selective rollback of individual changes you've made since your last commit
One of the nicest visual diff viewers I have used
Python PEP8 style hints (fully customizable)
Name "foo" is not a valid class name according to your code style (CapitalizedWords)
Name "Bar" is not a valid function name according to your code style (lowercase_with_underscores)
Auto-format hotkey (corrects spacing around operators, etc)
Navigation within source file
semantically indexes current source file
organizes alphabetically by type (Class, method, attribute, etc)
makes even enormous style sheets manageable
NetBeans Cons:
Integrated Debugger doesn't work with web2py (that one really hurts)
Long startup time (but acceptably snappy for me once up and running)
Version Control
I use and highly recommend Mercurial for source control. As mentioned earlier, NetBeans has great support for Mercurial but there are some things I'd just rather do in TortoiseHg.
TortoiseHg Pros:
Shell overlay icons
Repository Explorer
view repos history with graphical display of branching/merging
one stop shop for Incoming, Outgoing, Push, Pull, Update, etc with button for Commit tool
Commit tool
Hunk Selection: cherry pick changes from within a file for more focused Commits
Add, Remove, Diff, Revert, Move, Remove, Forget
TortoiseHg Cons:
No easy way to drop directly into a command line
Bug that regularly prevents files from being removed during commit (waits indef for a lock to be released; running hg addremove from command line is a reliable workaround)
Publishing
I use a combination of WinSCP (for browsing), PuTTY (for terminal commands), and TortoiseHg (for push/pull of my repos) to work with my shared hosting account on Webfaction.
The first thing I do is set up public/private key encryption. If you are having trouble getting this set up between Windows and Linux, try these instructions from Andre Molnar. Short story is you need to generate your private key using ssh-keygen on Linux, copy it down to your Windows machine using WinSCP, then convert it for use with WinSCP and PuTTY.
Then add the following lines to your global mercurial.ini file:
[ui]
ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "c:\path\to\your\privatekey.ppk"
Even if you have to connect to multiple servers, you need only copy your public key to each of the different servers. You'll also want to let WinSCP and PuTTY know where your private key is located, but those are fairly easy to figure out.
Try the new web2py admin interface in trunk. It has a web based mercurial interface and a google deploy interface.
In web2py you can edit applications/admin/models/0.py and set
TEXT_EDITOR = 'amy'
And you will get the web based Amy editor with autocompletion. It is not default because because it does not work with some browsers and because autocompletion is not as good as eclipse. It may work for you.
You can use web2py with Eclipse but you need a minor workaround to let Eclipse know about the web2py environment. It is explained here.
I know other users have used other IDEs with web2py, for example WinIDE and pyCharm. I suggest you ask on the web2py mailing list where people are very helpful.
I'm pretty sure that the 'one-click setup script' to do all that you are looking for does not exist (at the moment). But don't be put off - you can achieve a nice development environment to suit your needs and there are lots of choices.
Although I develop on Windows, I like the setup I have as it's more of a 'Unixy' way of thinking whereby I have a number of tools each doing a specific task. Once you get a workflow setup you can be very productive - although I realise it may look a bit confusing initially coming from a Visual Studio world.
Below I outline what I've settled on. I'm sure others will have their own recommendations. Pick the options you like best.
(There should be hyperlinks to useful software below but I don't have enough reputation to include more than 1 link...)
For developing on Windows I'm enjoying using Pyscripter. It's free, fast (compared to Aptana / Eclipse / Netbeans etc) and has some nice features (dark theme, integrated python console and code explorer to name a few).
To get code completion / intellisense to work for web2py you need to add some code to your model / controller files because of the way web2py works. There are some instructions in this discussion topic on the web2py group.
web2py has a great error ticketing system built in (see the web2py book chapter 3). For more comprehensive debugging, pydb seems to be the way to go. Just put the code below as a breakpoint:
import pydb
pydb.debugger()
and it'll take you to the debugger.
I use TortoiseHg for Mercurial integration and it works wonderfully. Combine that with winscp and you can deploy easily.
Caveats: I work in OS X, and do most of my coding in BBEdit.
That said, I've used both Wing and Komodo IDE for web2py debugging, and they've both worked quite well for me. I haven't tried NetBeans in a while now; when I did the Python support seemed a little rough around the edges. And I've never had the time or patience to come up to speed with Eclipse; it's filed in my mental file cabinet with Emacs, no doubt unjustly to Eclipse and/or Emacs.
(And I'll echo mdipierro's recommendation to try the web2py mailing list; it's really indispensable--one of web2py's strongest points.)
Have you considered using fewer tools? Both Python and web2py don't require a whole lot of code to get a lot accomplished. web2py only adds 10 or 15 new function calls (besides the HTML helpers and validators). You might find that Eclipse and other IDEs actually get in the way. Setting up new apps in web2py is simple through the admin system. Since the new app scaffolding copies the welcome app, you can customize new app setup by editing the welcome app. With Mercurial (or Git, Subversion or Bazaar) you can set up a server on your machine or with one of the public sites and either push or pull updates to your production server. Keep it simple, I say.
we are using web2py framework for all our web application needs and this is our setup :
OS - Ubuntu up-to-date
IDE - Aptana Studio 3.0 with pyDev
Version Control - git
Python 2.7
Browser for developing phase : Chrome
I've found the Wing IDE debugger to be very useful. It's a powerful debugger across the board, and also can be configured to do remote debugging, which is really important when you are running web2py on a no-GUI remote machine (e.g. at Amazon Web Services).

What is the best way to integrate an external build tool into Eclipse?

I've just started using Eclipse for Python development since we can make use of a lovely plugin I've found to enable distributed pair-programming. Anyway, the next step to getting Eclipse to integrate properly with our existing environment, would be finding a way to drive our current build tool (Waf) from within the IDE.
So the question is, is there a way I can set up Eclipse to drive Waf in a Make-like fashion? I see for Make it has some quite advanced functionality, such as being able to work out what targets are available etc. Bonus points for telling me if there is a way I could go as far as this! (I suspect the answer is that this is all built in to the Make plugin for Ecplipse).
In eclipse CDT I run waf by simply changing the build program in
ProjectPreferences->C/C++ Build->BuilderSettings
Choose External builder and then put in the path to waf
for example I use
/Users/mark/bin/waf -v -k -j2
Note that waf and make do not agree on the -j setting and you have to give i explicitly and not use the eclipse dialog.
You can use the Make targets view add the targets to call waf e.g. configure, build etc.
One issue I had is that Eclipse is hard coded to see the output from Make say Make when i changes directory so I had to patch waf
see waf issue
You could try and define a Custom builder, calling Waf with the appropriate options for the python compilation step.
(From eclipsejdt alcatel-lucent manual)
That picture (not related to Waf at all) illustrates the fact a builder can be defined as an external tool (meaning any .bat or shell you may want to call)
In that "eclipsejdt" example, the custom builder was configured like so:
To set up the builder, bring up the property dialog for project "jex1p" by selecting the project in the Package Explorer and selecting Project > Properties > Builders. Then click New..., select Program, and click OK.
Configure the builder Main tab using values:
Name : nmbldr_pre
Location : ${system_path:ksh}
Working Directory: ${build_project}
Arguments : nmbldr -p 2 -t ${build_type} -s jpre
As VonC says, the elegant way is to use a Custom builder.
Alternatively it is less work (in the short term) to hack together an ant script to do the heavy lifting and define an external builder to configure it onto the project. You may find the drawbacks of an external builder (e.g. no incremental support) mean it is worth investing the effort to do it "properly".