开发者

Easy Eclipse project import for new users?

开发者 https://www.devze.com 2023-04-12 15:17 出处:网络
I\'m work开发者_JAVA百科ing on an open-source cross-platform C++ project that supports Make and Xcode builds.I\'d like to add an Eclipse project as well, but there seems to be no double-clickable way

I'm work开发者_JAVA百科ing on an open-source cross-platform C++ project that supports Make and Xcode builds. I'd like to add an Eclipse project as well, but there seems to be no double-clickable way to import a project into Eclipse. Consequently, my "project" consists of fact that I have .project and .cproject files checked into the repository.

torc/
    trunk/
        eclipse/
            ??
        sandbox/
            .project
            .cproject
            ...
        src/
            .project
            .cproject
            ...
        xcode/
            torc.xcodeproj/
            ...
        ...

Suppose somebody downloads the code but doesn't use Xcode. They can build the code with Make, but many people will probably want to peruse the code structure and sources, and Eclipse would provide a great way to do that.

Unfortunately, the user may not be familiar with Eclipse or how to import projects, and I'd like to make things easier for them, not harder. I was hoping to provide something double-clickable or draggable that would get them started with minimal grief. Can anybody suggest a good way to do this? Or is there an alternate approach that would feel natural to current or prospective Eclipse users?

I am aware of this approach, using org.eclipse.cdt.managedbuilder.core.headlessbuild, but that seems to work primarily with never versions of Eclipse and CDT.


I have an answer, but it's not very pretty.

You could create a workspace directory for your project in your repository and check it in with the project already added to the workspace. Then, you could create a script which launches Eclipse and tells it to use the workspace directory in the repository. (For example, eclipse -data ./eclipse/workspace.) You should make sure the workspace has been cleaned first because a workspace that has been built can contain quite a lot of extra metadata.

That said, this is not a great solution. Experienced Eclipse users will probably not want to use your workspace because preferences are stored in the workspace, and besides, if they see a .project and .classpath file, they're already going to know how to import it into their own workspace. People unfamiliar with Eclipse are likely not to have Eclipse installed at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消