Is it possible to create Eclipse-style folders (Project Folder, Package and so on) via the Terminal?
I once renamed an Eclipse package like this: mv oldname newname, and I noticed that after doing so, Eclipse no longer considered the folder a Package.
This possibly means that it is a matter of metadata, but I have so far been unsuccessful in locating the files containing the relevant information.
Eclipse does not provide anything to do this and it is not really possible manually.
For a project some information is stored in the .project file in the project folder. Depending on the type of project there may also be a .classpath file and there will also be data stored in the .metadata folder in the workspace and also in a .settings folder in the project.
All the file and folder names starting with . are considered to be hidden on Linux, Unix and Mac systems and are not shown by default. Use the -a flag of ls to see them.
Related
I've just ported a C++ system from codeblocks to eclipse. I now wish to put the workspace under source code control. I don't know if I have set this up correctly. The directory structure looks like
toplevel
+--.metadata
+--very big file structure
+--project1
+--.project
+--.cproject
+--various cpp/h files
+--project2
+--.project
+--.cproject
+--various cpp/h files
What I would like is to be able to checkout everything on a different machine, start up eclipse, point it to the workspace and pick up all the projects. I know I have to keep the .project and .cproject files but what do I need to keep in .metadata or have I got the entire structure wrong?
Edit I found Where in an Eclipse workspace is the list of projects stored? which recommends .metadata/.plugins/org.eclipse.core.resources/.projects but there is a structure under each project folder containing .markers .indexes and properties.index. Do all these need to be kept? I had a bad experience with codeblocks where I kept the layout file and even though I finally deleted it, it was stuck in the source code control system forever.
I would discourage you from putting .metadata folder into source code repository. It is a very complex and large folder that contains internal plug-in data. It is very hard to keep it in the repository.
The recommended way is to store only the project folders (project1 and project2) in the repo along with .project, .cproject and .settings. You can then import them using subversion or git on any other machine.
I'm working with a Python-Project with several subdirectories within the source folder.
The code analysis seems to work only on scripts directly in the src folder. All scripts in subfolders are not analyzed.
I have added the top-level source folder to the PYTHONPATH. Is it necessary to add all subdirectories as well? I'm using Eclipse Indigo with PyDev 2.4.0.
Thanks for your help!
Probably your file is beneath the PYTHONPATH but not under a python package (i.e.: a python package is a folder that has an __init__.py file in it -- note that all the folders up to your module need to have that __init__.py file) or your folder is not a valid python name (in which case it's also not treated as a package -- i.e.: folders with '.', '-', etc in the name).
If that's not the case, please post a snapshot of the PyDev package explorer.
(as a general rule, subdirectories of a source folder shouldn't be set as source folders... although you can do to support some exceptional use-cases)
Your files need not to be in PYTHONPATH to be code-analyzed,at least this is true for my PyDev 2.6.0.
I only add my project(not packages) root dir to PYTHONPATH in project properties, and the files in subdirectories are analyzed.
Be be sure to check the dir names and python file names. They must be valid python identifier for it to be imported to be analyzed. It cannot contain some innocent-looking characters, like dot and dash.
When I want to commit my project into svn, Eclipse displays a list of files in our tmp directory. Eclipse offers the possibility to add all these files to svn. But I don't want that, I want Eclipse to ignore the entire directory.
About the project
Our project contains a symlink 'tmp' where all our cache files are written to:
lrwxrwxrwx 1 tijmen tijmen 11 Oct 14 11:28 tmp -> ../tmp
The tmp symlink is already added to svn:ignore. The ../tmp directory is not in version control.
The ../tmp directory contains a lot of cache files (837 as of now). Every time I do Team->Commit it lists all the cache files as New in the Content column. Because the list is so long it is very hard to find the files I actually want to add and/or commit.
Is there a setting in Eclipse which enables me to ignore contents of a (symlinked) directory in the Team->Commit view?
I found a solution.
Right mouse on project -> Properties -> Resource -> Resource Filters. Here I created an exclude filter to exclude symbolic links. Luckily I have only one symbolic link in this project. For other projects a stricter filter can be created.
Add the selected tmp symlink to the svn:ignore property of its container folder. If it has not been added to the repository at all, simply right click on the folder, and select Team/Add to SVN Ignore (or something really similar name).
Otherwise you might have manually remove the existing folder, and add the corresponding property to its container folder.
EDIT: BTW. I am using the Eclipse Subversive plug-in; if you are using the Subclipse plug-in, search for option setting the svn:ignore properties.
Our team has just moved from Netbeans to IntelliJ 9 Ultimate and need to know what files/folders should typically be excluded from source control as they are not "workstation portable", i.e.: they reference paths that only exist on one user's computer.
As far as I can tell, IntelliJ wants to ignore most of the .idea project including
.idea/artifacts/*
.idea/inspectionProfiles/*
.idea/copyright/*
.idea/dataSources.ids
.idea/dataSources.xml
.idea/workspace.xml
However, it seems to want to check in the .iml files that exist in each module's root directory.
I originally checked in the entire .idea directory via the command line which is obviously not aware of what "should" be ignored by IDEA. Is the entire .idea directory typically ignored?
We have a FAQ article covering this question.
[The .idea] format is used by all the recent IDE versions by default.
Here is what you need to share:
All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)
Be careful about sharing the following:
Android artifacts that produce a signed build (will contain keystore passwords)
In IDEA 13 and earlier dataSources.ids, datasources.xml can contain database passwords. IDEA 14 solves this problem.
You may consider not to share the following:
.iml files for the Gradle or Maven based projects, since these files will be generated on import
gradle.xml file, see this discussion
user dictionaries folder (to avoid conflicts if other developer has the same name)
XML files under .idea/libraries in case they are generated from Gradle or Maven project
.idea directory is a replacement for the old .ipr (Idea Project) file and if you want to share the project between users, then you need to share .idea folder (with the exceptions mentioned in the FAQ) and all the .iml files.
Refer to GitHub's JetBrains.gitignore file to always have an updated listing of which files to ignore.
Not an exact answer to the question, but there are sample .gitignore files available here, including one for JetBrains which includes IntelliJ.
You might find this post interesting: Merges on IntelliJ IDEA .IPR and .IWS files
It seems to conclude that you should add all files except for: workspace.xml, dataSources.xml, sqlDataSources.xml and dynamic.xml. The answer there is focusing on having files that do not change simply from opening the editor or making ide specific changes.
I'm using PHPStorm.
Here is an example snippet for your .gitignore
# Ignore the following 2 PHPStorm files only workspace and tasks file
**/.idea/workspace.xml
**/.idea/tasks.xml
All other files in the .idea directory should be committed to your repository.
e.g: (commit everything else in the .idea directory)
new file: .idea/.name
new file: .idea/encodings.xml
new file: .idea/framework.iml
...
Docs: How to manage projects under Version Control Systems
Here is what you need to share:
All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)
So basically, commit everything except workspace.xml and tasks.xml.
Yes, I believe so. You can check the SVN configuration to see what's ignored and add anything that you think should be ignored.
IntelliJ now creates its own .gitignore file in the .idea folder so you can safely add it to repository.
What do you guys do, when you have huge project built with ant for instance, where the source folders are right bellow the root project folder, for building classpath from source files ?
Putting entire project as a source folder is nonsense.
Putting separate folders as source folders can't be done if they are part of the package hierarchy and the only thing I could think of, is to copy the source folders into a separate folder and add it then as source folder which is weird but I don't know how else to do it.
Having to duplicate sources just because of the eclipse way of making classpath and also because of somebody doing stupid project structure
It's really pain in the ass...because the ant scripts are written for this structure.
Even if it was just one folder, it's a problem anyway. There must be included the upper folder to the source classpath which means it is included with all the crap around and also it means that package explorer is flooded with the packages.
example:
Instead of /project/src/java/utils where we can put src folder into source classpath...
there is project/java/utils + lot of crap like /project/docs is in the project as well.
The trick is:
An Eclipse project root directory is defined by where the .project and .classpath are.
Two options here:
Those Eclipse project files are located in the workspace (and the 'project', the one with 'java/utils' inside, is not)
Then you can make a linked folder within the Eclipse project to reference 'project', calling that linked folder as 'src', using it as your source folder.
The ant script remains right where it originally is (in the 'project' directory, along with all the other sub-directories)
Those Eclipse project files are located directly within the 'project' directory (along with 'java' and 'docs': don't.
Delete that Eclipse project (not its content, only its definition, that will only remove the .eclipse and the .classpath), and recreate anywhere else.
Then go back to 1.
For each source folder in eclipse you can choose which subfolders of it you want to include or exclude as a source folder (you can also use patterns). If I understand correctly, in your situation you can add the project root folder as a source folder and include only those folders that contain source. So in your example only "java" would be included.