Question

As it's now, paths to natives are workspace-relative.

That's a bad thing, since when someone connects to it using git and names the project differently, the paths won't work. I'd like them to be relative to the project folder, regardless of it's name.

If you have any idea to achieve this, please suggest.

For illustration, here's a .classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

    <classpathentry kind="lib" path="lib/lwjgl.jar" sourcepath="lib">
        <attributes>
            <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Rogue/lib"/>
        </attributes>
    </classpathentry>

    <classpathentry kind="output" path="bin"/>
</classpath>
Was it helpful?

Solution

The key here for success, is that you do not add .classpath to the GIT. Instead you put it in Git Ignore.

There is a couple of those files that you do not want in to your Version Controlled System.

Example on a .gitignore file

.*
!.gitignore
*~
.svn/
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath

target/
*~
*.log
logs/
*.iml
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top