.classpath file not created when importing java project to eclipse from perforce - eclipse-classpath

In eclipse i was working with a java project which I had imported from perforce.
By mistake I deleted the .classpath file from my workspace, now again I imported the project from perforce but the .classpath file is not generated in my workspace.
Can someone please explain what is the reason behind this and how this can be resolved.

The .classpath is typically generated by Eclipse at the project setup or when adding new source directories. It is not created by Perforce.
If your .classpath was versioned in Perforce, and you deleted it from Eclipse, check to see if the file is marked for delete in the Pending changes. If so, revert the delete to recover the file.
If your .classpath was versioned in Perforce, and you Submitted the deleted, you will need to recover the deleted file from Perforce. Read the following KB article for details.
If you deleted the .classpath outside of Perforce or Eclipse, right click on the project, select 'Team' --> 'Get Revision...' --> check 'Get latest revision' and check 'Force operation'.
Finally, if the .classpath was never under version control you will need to rebuild it. Start by click on the source path and select 'Build Path' --> 'Configure Build Path'. Next, add all the source paths under your project and libraries (this is a bit tricky to get right). If it was a Maven project you may need to add additional containers.

Related

Project File Not Found while attempting build in Azure DevOps Pipeline

I have a solution that has 6 projects, some of which are in separate DevOps projects. I am attempting to setup a build pipeline in Azure DevOps and my repository is already located there. Regardless of location, I continue to get errors that the csproj file cannot be found for any of the projects. The build cannot continue without the csproj files (obviously).
I have tried to move the .SLN file to the root folder, inside the specific project file and still get this error. I have also looked at the relative paths in the .SLN and attempted to manually modify them without any change.
Additionally, I used the vanilla configuration for the build pipeline before attempting to change path locations etc.
Here is the structure of source control:
Source structure
The 6 projects highlighted yellow are included in this solution.
Here is the output errors from the build in DevOps:
Output errors
I also tried adding the locations explicitly without any luck. By default, the location path was just $/PermitInspector/PermitInspector which is the location of the .SLN file. (Which is where I started with the attempt to automate builds).
Any suggestions would be helpful and I would be happy to share additional information or screen grabs that might be useful, but this is all I can come up with so far.
I was able to resolve the path issues by applying path filters under the build configuration in DevOps. There is a single work space and 3 of the projects are located in a root folder within the work space and the other 3 projects were in a separate root folder. The main issue appeared to be that the solution file is located inside the second root folder so I had to explicitly define the path to the other project files. By default, the only mapped work space was to the location of the SLN file. Now if I can just get NuGet restore working for the sub-projects! Thanks again,
Correct mapping that fixed the issue

Git how to ignore untracked CDT files

I'm working on a C++ project, after imported this project to eclipse, there are 3 new files/folders generated, they are:
.cproject
.project
.settings/
Not every one is using eclipse, so I'm not allowed to push this files to the repository, but I need them in order to work on eclipse, what should I do in such a situation when do the pushing.
You could add rules to the .gitignore file (and push that change by itself) so that they won't appear in git's list of working directory changes when you are ready to stage files for a commit.
Git Ignore Documentation
I installed the EGit plugin for eclipse found here:
http://www.eclipse.org/egit/
In order to manage the hidden files in a C++ project I open the Navigator by selecting menu option:
Window -> Show View -> Navigator.
In the Navigator (on the left hand side) you can see all the files that are hidden from a C++ project (like .cproject).
Select all the files/folders you need to ignore, right-click on the selection and go to popup menu item:
Team -> Ignore.
When you first ignore files in a folder a new file may appear (if its not already there) called .gitignore. You need to decide if the .gitignore file is going to be shared project-wide or not. If it is not currently being tracked and it needs to be you can add it to the index by right-clicking it and selecting Team -> Add to index. If it is not going to be tracked in the repository then you can select that file and ignore it.
Hope that helps.

How to add existing project into Geany

I have an existing C++ project which is built with Gnu Make. I want to develop the source under Geany but am unable find a way to import it.
I know this i a rather old question, but it was first hit on my search for the exact question. Since I have figured it out now, I wanted to give an answer for future searchers.
One should create a new project. Select a name for the project, select a location for the project file, e.g. the root of the project directory and the the root of the project directory. That's it.
But - the documents tab is confusing, so I suggest installing a file browser plugin, by selecting Tools -> Plugin Manager and then select the plugin File Browser. This adds a tab that will enable browsing the files in the project.
Hope it helps.
You don't have to import your project.
In geany go to "Project/New" and you'll be able to create a new project. Select a name for your project, select a file to save its settings and select the base directory where your source files are.
Then you'll be able to build to project with "Build/Make". It will run make within the base directory you selected. You can customise the build commands if you go to "Build/Set build commands".

TFS Build Server with project with "custom build tool"

I'm setting up an TFS 2010 Build server.
But I currently have the problem that projects with an "custom build tool" won't build because of "no access".
The projects are C++.
The custom build tool is "Pro*C". Basically, you have an *.pc file, and it generates an *.cpp file.
But on the build server, the directory/files are readonly. So it will crash on "no access".
I have tried to remove the *.cpp file from TFS. So that the generated file does not exists. But apparently the folder is also readonly and won't allow to create a new file.
Does anyone has a workaround for this?
I would suggest one of these options:
Don't put the .cpp files in source control if they are generated by the build process
Change the settings for Pro*C to write its output files to a writable intermediate folder
Add a build step that copies the problem files to an intermediate location for processing
Add a build step that forces the file access on those files to be readable for processing
If you only need to build those files occasionally, then build them manually with Pro*C on your developer machine and check in the results, so you don't waste time unnecessarily rebuilding unchanging files with every desktop or build-server build.
There is a project called MSBuild Community Tasks, which can be downloaded from http://msbuildtasks.tigris.org/. I used it for my own for an automated tfs-build.
It provides you with several extensions for your msbuild-project. One of this is the so called Attrib task, which gives you the opportunity to change file (and probably folder) attributes out of you project. It's not listed in the table on the website, but its documented in their documentation. As a sample from their documentation, you can add the following line to a target of your choice:
<Attrib Files="Test\version.txt" ReadOnly="true" Hidden="true" System="true"/>
I think this will also work for an item-group as follows
<Attrib Files="#(AllYourFiles)" ReadOnly="true" Hidden="true" System="true"/>
If you want to use it, don't forget to install it on the build server. ;)

Project properties lost on external checkout

Our company might be moving from CVS to Subversion soon. This has brought about an issue for us, which I am trying to solve.
For CVS and Eclipse, we were able to use team project set files to gather various modules and check them out together (http://vpms.de.csc.com/projectset/). This made it very easy to manage projects, since there was no need to remember each module in the project.
However, project sets do not support SVN. I know there is an 'externals' property for SVN that does approximately (or possible exactly) the same thing. I tried this. Now, for the problem:
When I use the externals property and checkout 2 modules in eclipse, their C/C++ project properties are lost, and so I cannot right click on them to say "build project" or "clean project". They appear to Eclipse to be folders with files in them.
Is there something I am missing here?
EDIT
When I check out each module separately, they check out as projects, so they do have the individual .project/.cproject/settings stuff
You forgot to place Eclipse project metadata into your source control system. Make sure all files starting with '.' in project root make it in along with the entire contents of the .settings directory.
Subversion externals simply allows you to take files from one part of the repository and bring them in under a folder in your local checkout. At my last company, we had a java source directory that called "commonSrc" that was an SVN External for another project's main "src" directory, but in the project it was brought into, it simply acted as another folder (as you are experiencing).
I never really liked that method and wouldn't recommend it unless you have only one/two modules.
In order to do what you are trying to do with SVN, you might have to checkout each project separately, and use "Module Dependencies" in the project's properties to create the proper dependencies in Eclipse. You might be able to commit these project files so that the next person doesn't have to re-link them.
In case anyone needs this, here's what I found:
http://vpms.de.csc.com/projectset/
&
http://www.polarion.org/index.php?page=download&project=subversive
OR
http://www.giniality.com/old/update/projectset/
for Subversion + Project Set integration.
There is no need to break your project set. Once you have the integration plugins installed in Eclipse, all you need to do is change the source from the CVS server to SVN.