-
Notifications
You must be signed in to change notification settings - Fork 82
Setting up the development environment
Please join our slack group
- Install IntelliJ IDEA or Eclipse
- Install SBT
- Install JDK 8.
- Install
git lsf
to transfer the large files on github - Scala
- Akka Actor (middleware requisite)
- PlayFramework (front-end and JSON request requisite)
- AnuglarJS 1 (optional)
This section introduces how to set up cloudberry in IntelliJ IDEA or Eclipse. You can choose one of them as your development environment.
If you do not have JDK 8 installed, add the address of SDK bin to IntelliJ. File -> Project Structure -> Project Settings -> Project -> Project SDK. You could refer to official guideline for more details.
-
Fork the repository to your own namespace repository.
-
Clone your own repository into your local disk.
git clone https://github.com/YOURACCOUNT/cloudberry.git
-
Import the cloudberry directory by Import Project ->
cloudberry/cloudberry
. Choose Import project from external model and select SBT. Click Next and finish to import the cloudberry project. -
Import the twittermap directory by File -> New -> Module from Existing Sources ->
cloudberry/examples/twittermap
. Choose Import module from external model and select SBT. Click Next and finish to import the twittermap module. -
Install Scala plugin on IntelliJ. Preference -> Plugins -> Install JetBrain Plugins -> Install -> Restart IntelliJ
-
If you do not have SBT toolwindow, click on build.sbt file in IntelliJ and import project. If SBT tool window does not appear automatically, check View -> Tool Windows -> SBT.
-
Open SBT toolwindow (on the right side of IDE) and press refresh button (left-up corner) to force reload sbt.
-
Run the project from command line by using
sbt "project neo" "run"
.
-
Install Scala-IDE plugin (http://scala-ide.org/download/current.html). Make sure the version you download supports scala 2.11 (currently the latest version of the plugin is 4.5.0).
-
Generate eclipse project files by running command line
sbt eclipse
. -
Go to eclipse and load projects. File->Import->Existing Projects into Workspace, and then set the root directory as the Cloudberry directory, and load the projects listed.
- Now wait eclipse to finish the building process. If errors happens, try to refresh the project and clean/rebuild.
-
Use the following lines to add remote repository:
-
git remote add name_of_your_remote_rep https://github.com/ISG-ICS/cloudberry.git
-
git fetch name_of_your_remote_rep
-
git remote -v
-
-
If your remote rep and the origin rep are the same, use git remote set-url origin your_SSH
-
Update you local with ISG master branch or get changes from ISG master branch: git pull name_of_your_remote_rep master
-
More information is available Here
git lfs pull
-
Go to git command line
-
Check modified files: git status. Green files are ready to be committed.
-
Commit added files: git commit -m "your commit message".
-
Pull from ISG master to update your branch: git pull name_of_ISG_repo (step 2) master.
-
Push commit to your branch: git push origin branch_name.
-
Go to your repository and click on "New Pull Request" to ISG repository.
Conflicts are totally normal. It means someone's previous work touched the same place as you did. Then you will need to understand their logic and decide how to accommodate the new changes.
On your local machine, you should use git pull isg master
to merge with the most recent ISG master. (assume isg
is the name of the ISG/Cloudberry
remote reop).
Then in Intellj, you can use the tool VCS -> git -> resolve conflicts
to watch the difference and pick the correct one or rewrite the local code.
This post shows an example. And this one.
Once the PR get closed, the feature branch that you were working on should never be used. To work on a new feature branch, you should checkout a new branch from the most recent master by the following commands.
git checkout master
git pull isg master // assume isg is the upstream repo name
git checkcout -b fix-for-issue-x // choose a good branch name.
https://github.com/blog/1943-how-to-write-the-perfect-pull-request
- Install the
Codecoverage Chrome Plugins
to identify which lines haven't been tested. -
- Debug Scala in IntelliJ
-
Learn Scala
- A good online book: Programming in Scala
- Effective Scala
- A good blog (
strongly recommend
): The Neophyte's Guide to Scala - Official Documentation of Scala
- Official Documentation of Akka
- Scala by Example
- Learn Akka