Developer Notes for Lantern
SVN is used to upload changes to code.google.com
https://lantern.googlecode.com/svn/trunk
The code project site: http://code.google.com/p/lantern
Go to the "Sources" tab to locate the SVN password.
AppEngine sites:
app_id: k16-8888 http://k16-8888.appspot.com
This corresponds to the demo1/ and demo1-test/ directories
app_id: pythonshell1 http://pythonshell1.appspot.com
This corresponds to the ri directory.
Related AppEngine sites:
app_id: tempkhanacadquiz
This is a modified version of Khan exercises, currently not checked in.
AppEngine admin site:
See demo1/README for additional notes.
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
COPYING based on: http://www.apache.org/licenses/LICENSE-2.0.txt
GIT may be integrated with SVN for local revisions. For example:
~/src/lantern may be created for local development. From that directory, run:
git svn clone https://lantern.googlecode.com/svn lantern-svn \ --username vchen@google.com --stdlayout
Create .gitignore:
git svn show-ignore > .gitignore
Directories:
demo/ is an OBSOLETE demo AppEngine/Python application demo1/ is the current demo AppEngine/Django/Python application demo1-test/ is a the unit-test directory. It contains testing-only files and symlinks into demo1 to allow testing demo1 python directly.
See the following for set up of your development environment.
Install django-1.1.1 to local machine's Python site-packages
Install pymox: http://code.google.com/p/pymox 0.5.3 into site-packages
Need to symlink mox.py and stubout.py into the demo1-test directory or figure out how to add path:
cd demo1-test ln -s /usr/lib/python2.5/site-packages/mox.py ./site-packages ln -s /usr/lib/python2.5/site-packages/stubout.py ./site-packages
demo1-test/init.py adds ./site-packages to path. Deployment should probably skip site-packages.
Load and extract appengine SDK.
Create a symlink to the app-engine directory, e.g.,
ln -s /usr/local/apps/google_appengine .google_appengine
Download and extract GAEunit for Django, copying gaeunit into the test source tree (e.g., demo1-test).
There are two packages:
One can "install" each of these in /usr/local/google/home/
Closure Library:
$ mkdir /usr/local/google/home/
Closure Compiler:
Download the ZIP file
$ mkdir /usr/local/google/home/
To set up sym links in the development tree, e.g.,
$ ln -s /usr/local/google/home/
To run the demo1-test that contains the unit-testing infrastructure:
cd demo1-test make deploy_files make test
Then go to http://localhost:9094 in your browser
Click on the "login" link to log in with a dummy user
Go to http://localhost:9094/test to run the unit tests
To test changes usually does not require restarting the server:
From demo1-test directory, run the following to recompile JavaScript
make deploy_files
Reload the page in your browser. You may need to SHIFT-F5 to force refresh and sometimes clear your browser cache.
By default demo1/template/base.html loads the compiled JavaScript:
lanternJs.js
For debugging, you may want to change it temporarily to:
lanternJs-bundle.js
DO NOT submit this change.
To see remote branches: git branch -r
To see your local branches: git branch
To work on new features, based on trunk (git's master):
git checkout -b myfeature master
Make your changes, commits, etc to this branch.
Create a code-review branch in SVN when ready:
git svn branch -m 'Branch: Message' vchen-20100821 git checkout -b local/vchen-20100821 vchen-20100821
git format-patch --stdout --binary master..myfeature | git am -s3 git svn dcommit
Ask for review. Further review and commits and dcommits happen in local/vchen-20100821.
When complete, merge to trunk:
Determine version where branch was cut. From the local/vchen-20100821 branch, run 'git svn log':
Checkout a copy of trunk to a temporary location: svn checkout https://lantern.googlecode.com/svn/trunk lantern
Change to current working directory: cd lantern svn update
Merge it with the branch using svn merge svn merge -r XXX:HEAD \ https://lantern.googlecode.com/svn/branches/vchen-20100821
Commit the change(merging with the branch) to the trunk: svn commit -m 'Merging vchen-20100821 to trunk: rXXX:YYY'
If you were to merge again (not normal), you would merge from the second value (e.g., -r YYY:HEAD).
The directory may be removed now.
Once released, set a tag with the version:
git svn tag Lantern_2a
Delete SVN branches (after changes have been merged):
svn delete https://lantern.googlecode.com/svn/branches/vchen-20100821 git branch -D -r vchen-20100821 rm -rf .git/svn/refs/remotes/vchen-20100821
Garbage collect:
git gc
Get new revs from SVN into git:
git svn fetch
If someone else is also working on your branch and have submitted changes, update with:
git svn rebase
1) Creating a branch:
-To create a branch use svn copy: svn copy path_to_trunk path_to_new_branch -Branch name should be in the following format: username-date (eg. mukundjha-20100614) (eg. svn copy https://lantern.googlecode.com/svn/trunk \ https://lantern.googlecode.com/svn/branches/mukundjha-20100614 ) -Checkout the branch using svn checkout svn checkout https://lantern.googlecode.com/svn/branches/mukundjha-20100614 \ lantern_branch
2) Merging: To merge the branch back to trunk, follow the steps below. (NOTE:Make sure you have commited all changes to the branch before merging)
Checkout a copy of trunk: svn checkout https://lantern.googlecode.com/svn/trunk lantern
Change to current working directory: cd lantern
Merge it with the brach using svn merge svn merge https://lantern.googlecode.com/svn/trunk \ https://lantern.googlecode.com/svn/branches/mukundjha-20100614
Commit the change(merging with the branch) to the trunk: svn commit -m "merging with branch mukundjha-20100614"
Update Version in app.yaml.(Otherwise, you will trash the deployed app!)
If demo1-test/index.yaml has been updated, copy it to demo1/index.yaml
From demo1-test, run:
make deploy_files
Go to the directory above 'demo1', run:
.google_appengine/appcfg.py --email=yourname@google.com update demo1
To add ignores to directories:
svn propset svn:ignore -F ../.gitignore py public/images templates/app
where .gitignore contains patterns to ignore auto-generated files: