Developing JSAGA engine

What are the pre-requisites for building JSAGA entirely ?
  • Install JDK 1.5 (or above)
  • Install Maven 2.2.1
  • Optional: releasing JSAGA requires SSH to be installed
  • Optional: some adaptors requires gcc compiler to be installed (these adaptors must either be built on both windows and linux platforms, or you can build everything from windows by installing cygwin, cross-compiler for linux and JNI header files for linux)

[top]


How to build JSAGA from source ?
  • Install and configure SSH according to these instructions
  • Download bootstrap POM file
  • Build from latest source code
    mvn scm:bootstrap
    Or build an old release
    TAG={release_tag}
    mvn scm:bootstrap -DscmVersionType=tag -DscmVersion=$TAG -Dgoals=deploy,site-deploy

[top]


How to release JSAGA ?
  • Update the release notes

  • Update from GIT and select the branch "master"
    git pull
    git checkout master
  • From a ccdevli host, run:
    export MAVEN_OPTS=-Xmx256m
    mvn -f pom-unreleased.xml deploy
    
    mvn release:prepare
    mvn install ; mvn release:prepare   # workaround
    mvn release:perform -P release

[top]


How to deploy a snapshot of JSAGA ?
  • Update from GIT and select the branch to build
    git pull
    git checkout <yourBranch>
  • From a ccdevli host, run:
    export MAVEN_OPTS=-Xmx256m
    mvn -f pom-unreleased.xml deploy
    
    mvn deploy site-deploy

[top]


How to test web site generation without deploying it ?
From a ccdevli host, run:
export MAVEN_OPTS=-Xmx256m
mvn site-deploy -P local

[top]


How to configure apache for maven repository ?
Create file .htaccess with the following content:
Options +Indexes
IndexOptions +NameWidth=* +DescriptionWidth=*
AddDescription " " .md5
AddDescription " " .sha1
AddDescription "Tarball distribution" .tar.gz
AddDescription "ZIP distribution" .zip
AddDescription "GUI Installer" .jar

[top]

GIT

How to merge a contribution into the reference repository ?
# Get branch name
git ls-remote ssh://git.in2p3.fr/jsaga-contrib

# Pull contribution in branch "mergedBranch"
git checkout -b mergedBranch master
git pull ssh://git.in2p3.fr/jsaga-contrib <branch name>

# Merge it in branch "master"
git checkout master
git merge mergedBranch

# Cleanup
git branch -d mergedBranch

[top]


How to merge a branch without detailed history ?
Use unix diff instead of "git format-patch":
# Update local repository
git pull

# Create patch
git checkout workingBranch
git diff origin/master > mydiff.patch

# Apply patch
git checkout -b mergedBranch master
git apply --stat myDiff.patch
git apply --check myDiff.patch
git apply myDiff.patch

# Merge
git checkout master
git merge mergedBranch

# Delete remote and local branches
git push origin :workingBranch
git branch -D workingBranch
git branch -d mergedBranch
git branch -al
WARNING: This does not work if some binary files have been modified.

[top]


How to apply and merge a patch ?
Use "git apply-patch" or "git am":
# Update local repository
git pull

# Apply patch
git checkout -b mergedBranch master
git am --ignore-space-change --ignore-whitespace patch.mbox

# Check changes with IDE (GIT -> Push Active Branches...)

# Merge
git checkout master
git merge mergedBranch

# Delete local branch
git branch -d mergedBranch
git branch -al

[top]


How to apply and merge a conflicting patch ?
Checkout a non-conflicting (past) version of branch 'master':
$ git rev-list -n 1 --before="2011-12-27 00:00" master
e0ad6b79cc64d5720a9754231146438ceb1ddaf3

$ git checkout -b new_branch_name e0ad6b79cc64d5720a9754231146438ceb1ddaf3
HEAD is now at e0ad6b7... log message of patch
  • Apply patch (see above)
  • Interactively rebase 'new_branch_name' onto 'master'
  • Configure 'master' as the tracked branch
  • Push active changes

[top]


How to rebase a published branch
Note: you should not rebase a branch if it has been modified by other contributors.
# Update local repository
git pull

git checkout workingBranch
# perform interactive rebasing onto branch "master"
# in case of conflict, add the conflicting file(s) to GIT (but do not commit them)

# replace old branch (remote) with rebased branch (local)
git push origin :workingBranch
git push workingBranch
               

[top]


How to fix a small problem (e.g. typo in generated web page) in a release, without creating a new release ?
# Update the release tag
git checkout <release_tag>
git show
git checkout -b <release_tag>
git show
vim pom.xml
git diff
git commit -m 'tag bis' pom.xml
git tag -f <release_tag>
git push origin --tags
git branch -D <release_tag>
               
DO NOT FORGET TO DO THE SAME FIX IN BRANCH 'master' ! DO NOT FORGET TO FETCH TAGS (git fetch --tags) ON ALL REPOSITORY CLONES !

[top]