Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Xtext/Contributor Guide"

m (Updating changes with new patches)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Xtext}} {{:DocumentationGuidelines/DraftHeader}}
+
{{Xtext}}
== Prerequisites ==
+
=== [[User Account]] ===
+
  
We use eclipse [https://git.eclipse.org/r/ eclipse gerrit review server] to review and manage new contributions. Hence, you need to perform the following few steps to be able to use the Gerrit server:
+
The Xtext Contributor Guide is now maintained in the [https://github.com/eclipse/xtext/blob/master/CONTRIBUTING.md Xtext GitHub repository].
 
+
*Register an Eclipse.org account at [https://dev.eclipse.org/site_login/createaccount.php dev.eclipse.org]. The same account is used for [https://bugs.eclipse.org/bugs Bugzilla] and [https://git.eclipse.org/r Gerrit]. If you are an Eclipse committer you already have one.
+
*[https://git.eclipse.org/r/#settings,http-password Define a username]
+
*[https://git.eclipse.org/r/#settings,ssh-keys Upload your public ssh-key] for authentication. For more information about ssh authenticatoin and how to generate an ssh key, refer to [https://help.github.com/articles/generating-ssh-keys this site].
+
*Make sure that you use the same mail address for your ssh key as you did for your eclipse account to avoid authentification issues
+
*You need to sign Eclipse's new [http://wiki.eclipse.org/CLA CLA] to be able to push on Gerrit. You can do that after you log in at the [https://projects.eclipse.org/user/2541 Eclipse projects forge] site, using your eclipse account.
+
 
+
=== Eclipse Distribution ===
+
Download "Full eclipse" from [http://www.eclipse.org/Xtext/download.html Xtext website] or use the [http://www.eclipse.org/downloads/ eclipse DSL Package]
+
<br><br>
+
 
+
== Let Buckminster setup your Xcontributor environment ==
+
 
+
We provide an [http://ant.apache.org/manual/install.html ant] script which installs and runs [[Buckminster]]. Buckminster will do the most off necessary steps to crete a contributor workspace for you.
+
 
+
What does [[Buckminster|buckminster]] do in detail:
+
 
+
*creates an eclipse workspace
+
*clones the Xtext git repository
+
*imports necessary projects in created workspace
+
*creates and sets [http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Ftasks%2Fapi_tooling_baseline.htm api baseline]
+
*creates and sets a [http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fconcepts%2Ftarget.htm target platform]
+
*sets some important workspace settings
+
*performs gerrit setup
+
 
+
=== Run the script  ===
+
 
+
Run the ant script located [http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/plain/devtools/org.eclipse.xtext.contributor/workspace.ant here]. In unix you can use following commands:
+
<source lang="bash">
+
wget -N http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/plain/devtools/org.eclipse.xtext.contributor/workspace.ant
+
ant -f workspace.ant
+
</source>
+
 
+
You might want to tweak the Ant <property ...> at the top of the workspace.ant file to customize the directories where the xtext-sources/ workspace or git clone will be created, and/or where the buckminster and director binaries will be installed.
+
 
+
If it's the first time you are cloning Xtext repository, the script will ask you to input your bugzilla/gerrit [[Xtext/Contributor_Guide#User_Account|username]] in order to create the necessary entries in the git configuration file, so you can push to gerrit review server. You can also skip this step by leaving your input empty and manually set up your local git repository. [[Gerrit|Here]] you can find a good description.
+
 
+
=== Start eclipse ===
+
Start your eclipse and choose ${user.home}/workspaces/xtext-sources as eclipse workspace
+
=== Setup working sets ===
+
* In "Package Explorer" - view,  select "Top level elements -> Working sets"
+
* Select File -> Import -> Team -> Team Project Set.
+
* Point to the following URL http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/plain/devtools/org.eclipse.xtext.contributor/projectSet.psf
+
* Perform import
+
<br> <br>
+
== Using git  ==
+
 
+
As git client you may use whatever you want. The important thing is, that finally, your git configuration should look similar to this:
+
 
+
<code>
+
[core]
+
      repositoryformatversion = 0
+
      filemode = true
+
      logallrefupdates = true
+
[remote "origin"]
+
        url = git://git.eclipse.org/gitroot/tmf/org.eclipse.xtext.git
+
        pushurl = ssh://<your account id>@git.eclipse.org:29418/tmf/org.eclipse.xtext.git
+
        fetch = +refs/heads/*:refs/remotes/origin/*
+
        push = HEAD:refs/for/master
+
[branch "master"]
+
        remote = origin
+
        merge = refs/heads/master
+
</code>
+
 
+
You can find the configuration file (called "config") in root of your local repository, in the hidden folder ".git".
+
 
+
=== Pulling changes from server  ===
+
To fetch the last changes run:<br>
+
<code>git pull origin master</code>
+
 
+
=== Committing your changes  ===
+
 
+
After you made your changes to the source code, you have to commit them locally:<br> <code>git commit -a -s -m "[390852] my first contribution"</code><br> -a performs 'add' and 'remove' operations to modified and removed files (new files git does not know about won't be affected)<br> -s necessary to 'sign-off' your commit; refer to section [http://wiki.eclipse.org/Xtext/Contributor_Guide#User_Account User Account] to make sure you signed the CLA!<br> -m stands for message. It's common to refer to an existing bug report, in this example [https://bugs.eclipse.org/bugs/show_bug.cgi?id=390852 390852] in your commit message <br> Now if you call <code>git status</code>, you will see one outgoing change:<br> <source lang="bash">MacHuebner:org.eclipse.xtext-test dhuebner$ git status
+
# Auf Zweig master
+
# Ihr Zweig ist vor 'origin/master' um 1 Version.
+
#  (benutzen Sie "git push" um lokalen Versionen herauszubringen)
+
#
+
nichts einzutragen, Arbeitsverzeichnis sauber
+
</source>
+
 
+
=== Pushing to review server  ===
+
After you committed the changes to the local git repository, you can push them to gerrit, just run:<br>
+
<code>git push origin master</code>
+
 
+
=== Updating changes with new patches ===
+
In case a patch has problems and you want to provide an updated patch, you need
+
to
+
# go to the gerrit website with your change and copy the Change-Id into your clipboard
+
# update the commit and paste the Change-Id from your clipboard into the commit message
+
# push again and the amended commit will be added as an update o the gerrit change
+
 
+
== Contribution monitoring ==
+
After you pushed your first commit to gerrit, it will be reviewed on the [https://hudson.eclipse.org/sandbox/job/xtext.gerrit/ hudson review server].
+
If all tests pass a manuel review will be done by one of the Xtext committers. If all looks good, your contribution will be pushed to the master repository and you can install it from the regular [https://hudson.eclipse.org/hudson/job/Xtext-nightly-HEAD/ eclipse hudson server].
+
 
+
== Browse Sources Online  ==
+
Xtext and Xtend are hosted in Git. You can browse the repository in cgit here [http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/ Xtext/Xtend repository].
+
<br>
+
== Helpful sites  ==
+
 
+
[[Gerrit|Using Gerrit hosted at eclipse]]
+

Latest revision as of 03:42, 21 July 2016

The Xtext Contributor Guide is now maintained in the Xtext GitHub repository.

Back to the top