linux eclipse go插件,Goclipse - 一个Go语言的Eclipse插件

68747470733a2f2f7472617669732d63692e6f72672f476f436c697073652f676f636c697073652e7376673f6272616e63683d6d617374657268747470733a2f2f6261646765732e6769747465722e696d2f476f436c697073652f676f636c697073652e737667

Developers Guide

Building the IDE:

You will need Maven for building Goclipse.

To build, run mvn clean verify at the root of the repository. This will run the test suite, and afterwards produce a p2 repository (an Eclipse Software Site) at bin-maven/features.repository/repository.

To just build without running tests, invoke mvn clean package.

Setting up a development environment:

You need Eclipse PDE to develop Eclipse plugins. Download and start it.

Clone the Git repository.

In Eclipse, click "File / Import... ", and then "General / Existing projects into workspace". Select the Git repository folder as the "root directory", enable "Search for nested projects", and select all the Eclipse projects that show up. Click finish to import those projects.

121df6cba826871d6a3dcd498250b41c.png

Note: The actual project names will be different from those in the screenshot above.

Note: Java compiler settings will be automatically configured, since Eclipse compiler settings are stored in source version control.

Setup the target platform. Unfortunately due to limitations in Tycho/PDE tooling (more info) some manual steps are required:

Open a shell on target-platform/ and run mvn package. This should create a deps-repository/repository directory.

Copy the target platform file: target-platform/IDE-base.target to target-platform/IDE-gen.target. (this last filename is already git-ignored).

Open target-platform/IDE-gen.target in Eclipse, so that it opens under the PDE editor.

Click "Add", then select "Software Site".

On the "Add Software Site" dialog, click "Add...", then "Local...", navigate to Git repo directory, then choose the target-platform/deps-repository/repository directory.

On the "Add Software Site" dialog, the new repository should be selected. Click "Select All" to select all deps, then click "Finish". It should look more or less like this:

Set_As_Target_Platform.png

Then finally click "Set as Target Platform".

Build the workspace ( "Project / Build All"). Everything should build fine now, there should be no errors.

To start the IDE from your workspace: Open "Run / Run Configurations ...". Click on "Eclipse Application" to create a new launch for the plugins in your workspace. The default new configuration that is created should already be ready to be launched.

Additional tip: Locate the bin-maven folder in the top-level project, open its Properties from the Project Explorer context menu, and mark that directory as "Derived" in the "Resources" property page. This will prevent those folder resources to appear in UI operations such as "Open Resource" for example.

Running the tests in Eclipse:

In releng/launches there is one or several Eclipse launch files for running the tests, so if this project is added to your Eclipse workspace, the launches will show up automatically in Run Configurations..., as "JUnit Plug-in Tests".

Creating and deploying a new release:

A release is a web site with an Eclipse p2 update site. The website may contain no web pages at all, rather it can be just the p2 site. To create and deploy a new release:

Ensure the version numbers of all plugins/features/etc. are properly updated, if they haven't been already.

Run mvn clean verify to perform the Tycho build (see section above). Ensure all tests pass.

To create a signed release the sign-build Maven profile must be activated, and the required properties set.

Create and push a new release tag for the current release commit.

Go to the Github releases page and edit the newly present release. Add the corresponding (ChangeLog.md) entries to the release notes.

Locally, run ant -f releng/ CreateProjectSite. This last step will prepare the project web site under bin-maven/ProjectSite.

To actually publish the project site, run ant -f releng/ PublishProjectSite -DreleaseTag=. What happens here is that the whole project site will be pushed into a Git repository, to then be served in some way (for example Github Pages). If projectSiteGitURL is not specified, the default value in releng-build.properties will be used.

For more info on the Release Engineering script, run ant -f releng/, this will print the help.

A branch or tag named latest should also be created in Github, pointing to the latest release commit. The previous latest tag can be deleted/overwritten. The documentation pages use this tag/branch in their links.

Project design info and notes

LangEclipseIDE

This project uses the LangEclipseIDE framework, which is designed to have its source embedded in the host IDE. See this section for more info on how this should be managed.

Extensive Compile-Time type and contract checking

Code style:

Indent with tabs (tab size is 4 spaces)

Max line width: 120

Block style:

if(foo.blah()) {

doThis();

}

Indentation for function arguments: 1 indent unit (= 1 tab):

foo(one, two, three,

four, five, six);

There is also an Eclipse formatter profile settings file you can use, although you are not obliged to format with all rules of that formatter settings. If you make a minor source change, don't format the whole file, but only around the changes you are contributing.

Unit tests double-method wrapper:

This code idiom is often used in this project's JUnit tests:

@Test

public void testXXX() throws Exception { testXXX$(); }

public void testXXX$() throws Exception {

This is donely solely as an aid when debugging code, so that the "Drop to frame" functionality can be used on the unit-test method. It seems the Eclipse debugger (or the JVM) cannot drop-to-frame to a method that is invoked dynamically (such as the unit-test method). So we wrap the unit-test method on another one. So while we now cannot drop-to-frame in testXXX, we can do it in testXXX$, which basically allows us to restart the unit-test.

TODO: investigate if there is an alternate way to achieve the same. I haven't actually checked that.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值