How can I import perl scripts in a project using Epic? - eclipse

I am interested in using Epic for Perl development as my background is Java. So I have installed Epic in my Eclipse.
There is already a source code repository with perl scripts in a remote file system.
My question is, if I mount the remote file system how am I supposed to use Eclipse to work on the scripts?
In Java there files would be under a project (with the corresponding files).
I see that there is an equivalent Eclipse Project in the Eclipse menu after installing Epic.
So how would I access the perl scripts? Some how add them under a new project?

First map your network drive/mount your remote file system.
Go to File -> New -> Perl Project (or project and then select Perl from the list), name it, click Finish.
Right click on the project in your Navigator Tab and click Import...
Under General select File System, click next.
Click browse and select your file system, this will be the one on your remote machine.
Check the files you want to import.
Expand the Advanced Tab and check "Create links in workspace." (This part is the trick to edit the files on your remote machine instead of copying them locally and having two locations)
Click Finish.
Please comment if you have any questions, I set this up a while ago and I believe that's what I did but it's not currently working on my machine.

Related

Eclipse Project - need to have a copy locally and a copy on a remote server

I develop in PHP using Zend Studio - operating as an Eclipse plugin - has a really nice feature called "Automatic Upload" that can be configured on a per Project basis. This feature allows one to define a remote connection to a server for a Project, and also specify whether file copy to the remote server is "manual" or "on save".
We use the "on save" option extensively, as it allows us to edit a file via Eclipse, save it, and immediately see the file in play on our remote web server.
Specifically the functionality we are after is as follows:
Create or edit a local file in Eclipse
On Save of the local copy, automatically creates / updates the remote copy
On Delete of the local copy, deletes the remote copy
(cut/copy & paste behave in a conceptually equivalent way)
and
Manual batch "upload to remote" and "download from remote" menu options that allows full upload / download of all files as well as manual cherry picking of files to upload or download.
This feature is really nice and has very broad application so I expected it to be standard Eclipse functionality, however I have installed Eclipse Oxygen, and can't find it. I have subsequently done rather a lot of searching, and although there are some manual options that have appeared, the closest I can find to an automated copy equivalent is the Parallel Development Tools plug-in which provides a "Synchronized Project" option.
Synchronized Projects require git running on both local and remote and a git folder structure inserted into the Project. Additionally, hidden files are injected into every Project sub-folder.
The above renders Synchronized Projects too "heavy" and potentially problematic to manage for us.
So I am fairly desperately looking for an Eclipse Oxygen (or Neon is fine) plug-in that provides the functionality outlined above.
Your input is greatly welcomed. Thanks in advance!
While not exactly remote sync, a little lateral thinking has given me exactly what we need. What I did is as follows:
Remote (linux)
Install Samba
Use Samba to present the desired folder as a Windows share
Local (PC)
Windows File explorer
mapped the remote windows share to a local mapped drive
Eclipse
downloaded and installed the File Sync plug-in from Eclipse market place
right-clicked on my Project and selected Properties => File synchronisation, and configured the desired folders (setting the "remote" as the mapped drive)
and one final item (because we are mapping from a Windows local to a Linux remote) : Window => Preferences => General => Workspace Set "New text file line delimiter" to "Other => Unix"
And hey presto, everything is working 100%.
You can do this by a project builder Ant buildfile. Alternative, there are others build system that are implements the Eclipse project builder (to be executed on save), but which must be installed separately. You can also implement your own incremental project builder in Java.

Eclipse projects are not visible in workspace folder

The weird part is I can see my projects through package explorer.
I can also export them.
But when I want to access them elsewhere e.g windows explorer, they are not there.
All I see is .metadata folder.
An unexpected shutdown of the system occurred not too long ago.
Edit: When I switched the workspace, created and opened a project, they're still not visible/accessible outside of the eclipse project explorer.
Any ideas?
You most likely haven't ticked "Copy projects into workspace" checkbox option.
File -> Import -> Existing projects into workspace:
It is possible that the projects were not put into the default, workspace folder.
To check this, right click on such a project, select Properties (it is usually available at the bottom of the list), go to the Resources tab, where you have the location of the project files displayed.
Obviously, there is a problem with Windows explorer and OneDrive in particular.
When I navigate to C:/Users/username/OneDrive/Documents/workspace or through command line I do see my eclipse projects.
But when I try to use 'Open file..' option from any application or navigate through Windows explorer, projects are not recognized nor displayed.

How to move an eclipse (helios) project to a different workspace?

First, Eclipse is not my native IDE -- I'm barely a n00b with it. I set up a project in a workspace that was actually in the directory of another client's project (I didn't really follow the whole workspace/project thing) and, in fact, now I can't even find the Eclipse workspace file to open it.
What I'd like to do is:
Open my eclipse project (/workspace?) -- I know where all the files are on disk, just not what to open in order to see them in Eclipse -- and
Move my project to a new workspace, which I guess I will put in a generic Eclipse-y place, and have that one workspace reference all my Eclipse projects.
(Is that the right way to do it? Does Eclipse dislike me being a one-project == one-workspace kind of guy?)
Please educate me regarding The Eclipse Way so that I can get back to work writing code.
Thanks!
Roughly a workspace (which is a directory) in Eclipse contains:
configuration (installed JRE, Servers runtimes, code formatting rules, ...)
one or more projects
You can of course have as many workspaces as you want (but only one can be opened at a time) and a project can also be part of different workspaces.
If you know where your sources are and want to move them to a new workspace here is a possible solution:
Start Eclipse and when prompted for a workspace choose where you want the workspace to be created (if directory doesn't exist it will be created). For example you can choose C:/Dev/Workspace/.
If you are not prompted, go to File->Switch workspace->Other
Once you are in your workspace you can import your exisiting project with File->Import then General->Existing Projects into workspace
Navigate to the folder containing your project sources, select your project and click finish
I don't know if it's a best practice or not but what I usually do is the following:
I have one workspace for each of my customer (workspace_cust1, workspace_cust2)
Each workspace references my commons library projects and add client specific projects
This way each time I change my commons library it's up to date in every workspace.
If you want to apply
one workspace = one project
You could to the following:
1) Copy the eclipse desktop shorcut
2) Modify the shortcut by appending "-data workspaceLocation "

How do I open the GWT samples in eclipse Helios and GWT 2.1.1?

What is the straight-forward way of importing one of the GWT samples in eclipse Helios + GWT 2.1.1. It seems like the content of the zip file doesn't contain any project files for eclipse.
I tried the following:
create a GWT project 'bla'
Delete the src ad war folder and
replace it with the src and war
folder from the sample
refresh the project in eclipse
hit 'run'
[ERROR] Unable to find
'bla/bla.gwt.xml' on
your classpath; could be a typo, or
maybe you forgot to include a
classpath entry for source?
So I go to the run configuration and remove the path for the example projects from the arguments list. I also changed the name of hosted html page to the one in the sample. Hit 'run' and:
[ERROR] Invalid version number "2.0"
passed to external.gwtOnLoad(),
expected "2.1"; your hosted mode
bootstrap file may be out of date;
Now I need an out of date version of GWT to run these samples? What is going on, I just want to look at a sample to learn a new concept.
Reading the readme.txt in the GWT samples directory I came across a solution that works on Eclipse 3.7. Assuming you have ant installed on your machine, execute the following from the sample's directory:
ant eclipse.generate
This will generate both the .classpath and .project files needed to import the sample into Eclipse and run it.
Here the relevant excerpt from README.txt:
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into
Eclipse. We've tested against Eclipse 3.4 and 3.5. Later versions
will likely also work, earlier versions may not.
If the directory containing this file does not have a .classpath or
.project file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file, select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish. You can now browse the project in Eclipse.
To launch your web app in GWT development mode, go to the Run menu and
choose:
Run -> Open Debug Dialog...
Under Java Application, you should find a launch configuration
named "Mail". Select and click "Debug".
You can now use the built-in debugger to debug your web app in
development mode.
In eclipse 3.7, instead of Run -> Open Debug Dialog..., its Run -> Debug Configurations. I got both the showcase and mail samples running following those commands. Should work for all of the other samples as well.
The examples that come with GWT SDK were built in different ways. Some are Maven builds, others use Ant. Eclipse can handle these common builds directly, but you have to choose the right option.
So, if you want to open the Expenses project in eclipse, you would look in the projects root directory (i.e. ../gwt2.4/samples/Expenses) where you'll find a file called pom.xml. That is a Maven build file. To import it into your Work space select:
File->Import...
Open Maven->Existing Maven Projects, and click on Next > button
Browse your file system til you reach the Expenses folder. Click on it and Select OK.
At this point it will show you the Projects in that directory in the Projects: area of the window...only one in this case: /pom.xml com.google.gwt.sample.expenses:...etc.
click on the checkbox for that project, Next>
Finally, it ask you to map plugins. You'll need to select in the drop down menu under Actions the required plugins (such as m2e).
In other project folders you may find a build.xml file instead. That's an Ant build file. To import that you do something similar, but different (of course!):
File->New->Project...
Open the Java folder and select "Java Project from Existing Ant Buildfile", Next >
Click the Browse button, dig through your directory to the project folder and select the build.xml file, and Open it.
Project name should fill in automatically, just select the declaration to use in the middle window and click Finish.
Since those tutorial only include the src and war directory, the idea remains to:
create a new project following this tutorial
remove any created class part of the example files which are automatically added (see Issue 1547)
Unfortunately the Google Plugin does not allow to created a new Web Application Project without creating template files. The template files are nice for the first try but annoying if you want to start from scratch with a new GWT application.
copy the src and war directory in place within the now empty project
Following your ticket 5847 (No easy and straight-forward way to make examples work in eclipse),
as xo4yhamope comments, you need the right GWT option.
and did you consider the Issue 5038 about the error message:
Unable to find 'xxxx.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for source?
This message usually means you attempted to refresh the browser before dev mode has had a chance to finish loading the module.
The uppercase/lowercase confusion happens because the module has been renamed to 'stockwatcher', but dev mode cannot map 'stockwatcher' to "StockWatcher' until it has finished loading the entire module.
So, it's just a matter of waiting a few seconds longer after the Development Mode pane says I should go to http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997 ?
That seems a little messed up. It should wait until it's actually ready before telling me it's ok, because users (like me) are going to go there as soon as the UI says it's ready.
The other confusing part is that the server begins serving the host page as soon as that message in the UI comes up. Because this was happening, I assumed that the server was completely up, even though (as it turns out) it wasn't.
Anyway, waiting a few more seconds seems to resolve the "Unable to find 'stockwatcher.gwt.xml' on your classpath" problem. Thanks!
I'm beginning to suspect this is a bug in the samples. I am adding this answer so it can be marked as an answer when I get confirmation about that.
I was trying out some other samples and came across this page. At the top is a little explanation for how to download and import the sample.
Before you begin
The StockWatcher project
This tutorial builds on the GWT
concepts and the StockWatcher
application created in the Build a
Sample GWT Application tutorial.
If you have not completed the Build a
Sample GWT Application tutorial and
are familiar with basic GWT concepts,
you can import the StockWatcher
project as coded to this point.
Download the StockWatcher project.
Unzip the file.
Import the project into Eclipse
From the File menu, select the Import... menu option.
Select the import source General > Existing Projects into
Workspace. Click the Next button.
For the root directory, browse to and select the StockWatcher
directory (from the unzipped file).
Click the Finish button.
If you are using ant, edit the
gwt.sdk property in
StockWatcher/build.xml to point to
where you unzipped GWT.
Now this is what I call straight-forward and easy.
At that point I had already built the StockWatcher in a previous tutorial but I got intrigued by the fact that it was explained exactly as I tried it the first time. So I downloaded the project and it had the correct eclipse project structure. I tried to import it 'et voila' I have the project in eclipse. I runs out of the box (with warnings). That is how expected the samples to be.
This experience leads me into thinking that the sample projects are malformed (as eclipse projects) and need to be updated. Let's hope my issue report leads to results.
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into Eclipse.
We've tested against Eclipse 3.4 and 3.5. Later versions will likely also
work, earlier versions may not.
If the directory containing this file does not have a .classpath or .project
file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file,
select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish.
You can now browse the project in Eclipse.
Copy from readme.txt supplied by samples. I tried this method, it's OK.
To import GWT showcase(2.5.1) I did following steps:
Create a new Google Web Application Project
New –> Other –> Google –> Web Application Project
Provide the project name “Showcase” and the Package name is com.google.gwt.sample.showcase
Click Finish
Go to eclipse plugin folder and traverse to the gwt
Under that folder go to gwt-2.3.\samples\Showcase
Copy (Ctrl C) all the contents. The contents are
a. src
b. test
c. war
d. build.xml
e. README.txt
In the eclipse, right click on the Showcase project and paste. Overwrite all the files
The files should start copying without any problem
Right click on the Showcase and Run As “Web Application”
You should have your Showcase working like Gem!
For me it worked like a charm ;)
Ref : http://simplestepswebdev.wordpress.com/2011/05/16/import-gwt-samples-into-eclipse/

Setting up a cross-platform C++ project in Eclipse with cross-platform libraries

I am working on a cross-platform C++ project with 8 other people which uses the following libraries:
OpenCV Library
Boost C++ Library
The project is inteded to be cross-platform so all users have agreed not to use platform-specific code, and, to keep things as simple as possible, all users will be using Eclipse as their IDE. However, some will be using Eclipse for Windows while other will be using Eclipse for Linux.
Since the project will be hosted on SVN, we would like to avoid conflicts with different configuration files (like make files, eclipse project files etc..) which are shared. We would also like to share as much of the configuration files as possible through SVN, to keep the configuration as simple as possible.
Let's assume that all users have properly configured system variables and installed the required build tools (such as make, cmake etc.), and have configured their Eclipse settings configured properly (but not the project-specific settings).
How to configure the project once and what of the configuration files to share on the repository, so that both Windows and Linux users can compile it without modifying configuration files retrieved from the SVN repository?
(I am not looking for the complete solution which would specifically work for those 2 libraries I mentioned, so I would appreciate a general how-to step-by-step explanations which would enable me to easily add another library.)
General discussion:
You will need to install Cygwin or something similar to it to make GNU Autotools toolchain available to Eclipse on Windows:
How to deal with Eclipse CDT+Cygwin?
Once your toolchain, Eclipse, with CDT and SVN connectors are ready on your development machines, go through the following steps.
Open Eclipse and switch to CDT: Click Window->Open Perspective->Other... and select C/C++
Select: Eclipse->File->New->C++ Project
Project name: viewer
Select: Project type->GNU Autotools->Hello World C++ Autotools Project
Click: Next
Click: Finish
Right-click in Project Explorer: viewer->Reconfigure project
Click: Console->Display Selected Console submenu-># CDT Global Build Console. If "autoreconf -i" output is nominal, proceed to step 9. If Console reports: sh: autoreconf: command not found, then add the path to the autoreconf command to the Project Build Environment:
Right-click in Project Explorer: viewer->Properties->C/C++ Build->Environment->Add...
Name: PATH
Value: path_to_autoreconf:${env_var:PATH}
Click: OK
Click: Apply
Go back to step 8.
Double-click: Project Explorer->viewer->src->viewer.cpp
Add some code:
include <opencv/cv.h>
include <opencv/highgui.h>
include <cassert>
int main(int argc, char *argv[]) {
assert(argc > 1);
CvMat* img = cvLoadImageM(argv1);
cvNamedWindow("Picture", CV_WINDOW_AUTOSIZE);
cvShowImage("Picture", img);
cvWaitKey(0);
return 0;
}
Double-click: Project Explorer->viewer->configure.ac and enter the following code below AC_PROG_CXX.
AC_CHECK_LIB([opencv_core],[cvSetZero],[],[])
AC_CHECK_LIB([opencv_highgui],[cvShowImage],[],[])
AC_CHECK_LIB([boost_regex-mt],[regexecA],[BOOST_LIB_SUFFIX="-mt"],[BOOST_LIB_SUFFIX=""])
AC_SUBST(BOOST_LIB_SUFFIX)
Double-click: Project Explorer->viewer->src->Makefile.am and enter the following code.
>
bin_PROGRAMS=viewer
viewer_SOURCES=openCvFocusIssue.cpp
viewer_LDFLAGS = -lboost_regex#BOOST_LIB_SUFFIX# -lopencv_core -lopencv_highgui
Repeat step 8, autoreconf (Reconfigure project)
Click: Project Explorer->viewer
Build project by clicking the hammer in the toolbar. If you do not see the hammer, Window->Open Perspective->Other... and select C/C++. If C/C++ does not show up, install the CDT.
Click: Project Explorer->viewer and then Run->Run, then in the Run As window->Local C/C++ Application, then in the Launch Debug Configuration Selection window->gdb/mi and press enter. You should see Hello World.
Quit Eclipse and navigate to the viewer project directory.
On the command line, issue make dist
Ensure you got a viewer-1.0.tar.gz or similarly named file, and then remove it: rm viewer-1.0.tar.gz
On the command line, issue make clean
In the same place, issue make distclean.
Navigate to the workspace directory that contains the viewer project.
Move the entire viewer directory to the directory that contains the svn checkout you want to place the viewer project in.
Change directories to where you just moved the viewer.
svn add viewer && svn ci -m "Added eclipse-autotool project"
Open eclipse and make sure that you have an SVN connector installed.
Remove the "viewer" project from the Project Explorer view.
Open eclipse and add this SVN repository checkout to the Team perspective.
Import the viewer project from your SVN repository checkout.
Switch back to the C/C++ perspective and have fun.
Two suggestions:
Use cmake: I love this tool. There is a bit of a learning curve but
if you get it right all the project will include is the cmake files
and when a person first checks it out they run cmake to generate
their makefiles (or VC++ project files, etc) with all the different rules for linux or windows one
might need.
or
Check in a basic config for the project, then add those configs to the git/svn ignore so no one ever checks them in again, then when you checkout for the first time you have to get your config running but after that it won't be overwritten.