Category: Google Code

Google Code and Mylyn

Since I am using Eclipse with my Google Code projects(Project Shaphan & Project Sarah), I did some research to see if I could connect Mylyn and found this project: GoogleCode Mylyn Connector.

To install it, I had to add this URL to the install sites:

http://knittig.de/googlecode-mylyn-connector/update/

Then, it installs through the Eclipse installation tool.

Next, I added a repository with the “New Task” menu on the right side of the Tasks view.  This walks through the wizard.

  • Step 1: Select repository type: Google Code
  • Step 2: Repository Settings
    • Project URL: http://code.google.com/p/project-shaphan/
    • Label: Project Shaphan (I believe this is the label you will see on the category)
    • Unchecked “Anonymous” (since I am the owner of the project)
    • entered user name and password
    • clicked “Validate Settings”
    • Clicked Finish
  • Yes to create a new query
  • Use a predefined query — All open issues

For some reason, I get the following error: “could not execute query”.  Then, I found this Issue.  The solution is to use the regular Google Account user name and password that you would use to login to GMail as opposed to one you would use to connect via SVN.

Tip: Uploading to Google Code

I learned this the hard way: put a version number in your Google Code releases!

I kept receiving an error when I tried to upload my new Jar file.  It was the same 403 error as this person.  The problem is that you can’t overwrite files any more.  Each new download needs to have it’s own unique file name.

So, the easy fix is to include and incrementing version number in the file name.

From Ant, I was able to accomplish the version number is this manner:

  • I created a version.txt to hold a minor number and major number property — saves the version
  • In the destfile parameter of the Jar step, I use the ${major.number} and ${minor.number} properties in the file name.
  • In the release section, I use the propertyfile command to increment the version number

Here is the full Ant Build file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><project default="all" name="Create Runnable Jar for Project ProjectShaphan">    <target name="all" depends="clean,compile,create_run_jar"/>
<target name="clean">       <delete dir="bin"/>    </target>
<target name="compile">       <mkdir dir="bin"/>       <javac destdir="bin">          <src path="src"/>          <classpath>             <pathelement path="/home/skp/app/workspaces/pscompare/ProjectJob/demo-bin"/>          	<fileset dir="lib">          		<include name="**/*.jar"/>          	</fileset>          </classpath>       </javac>    </target>
<target name="create_run_jar">    <!--this part was created by Eclipse Runnable JAR Export Wizard-->    <!--ANT 1.7 is required                                        -->        <property file="./version.txt"/>        <jar destfile="project-shaphan-${major.number}.${minor.number}.jar" filesetmanifest="mergewithoutmain">            <manifest>                <attribute name="Built-By" value="${user.name}"/>                <attribute name="Main-Class" value="com.skp.shaphan.ShaphanApp"/>                <attribute name="Class-Path" value="."/>            </manifest>            <fileset dir="bin"/>            <zipfileset excludes="META-INF/*.SF" src="lib/derby.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/sqljdbc4.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/ojdbc6.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/grouplayout.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/iText-2.1.7.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/iText-rtf-2.1.7.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/iText-rups-2.1.7.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/mysql-connector-java-5.1.7-bin.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/ProjectJob.jar"/>            <zipfileset excludes="META-INF/*.SF" src="lib/jtds-1.2.5.jar"/>        </jar>    </target>
<target name="release">         <taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask" classpath="lib/ant-googlecode-0.0.2.jar" name="gcupload"/>        <property file="./version.txt"/><gcupload         username="${google.code.username}"         password="${google.code.password}"         projectname="project-shaphan"         filename="project-shaphan-${major.number}.${minor.number}.jar"         targetfilename="project-shaphan-${major.number}.${minor.number}.jar"         summary="Runnable Jar File"        labels="Featured, Jar, OpSys-All" />        <propertyfile file="./version.txt">	   <entry key="minor.number" type="int" operation="+" value="1" pattern="00"/>        </propertyfile>    </target></project>

Sword Bible on Android

I have been using the Sword Bible project for years, and so, it was only natural for me to ask if it exists on Android for my phone.  The short story is that a project exists at Google Code, but it doesn’t quite look like it is ready for prime time.

First, if you want to know a little more about the Sword project, you can read up on it at this Wikipedia article.  I think I first started with it when I bought a Bible program from our college bookstore.  Now, in Linux, I use a program called Xiphos, which is a Linux/Gnome frontend for the Sword Project.  The program used to be called Gnome Sword.  You can also find more information from the main Sword Website including a small list of sofware.

My first find was this post on Werx Limited.  The post mentions a project named Bishop, but that project is more of a tech test than an actual application for use.  So, I read through the whole conversation thread discussing Bishop and the development of an application.  To my delight, I hit Martin Denham’s message about his And-Bible project.

I haven’t had a chance to install it or anything.  For now, I just wanted to capture these links, but I hope to mess with it some more.  For now, I am just using Virtue Bible FE.  I will keep you updated.

svnsync

I have decided to try svnsync instead of using git directly as I posted here and here.  Since I am a single developer, I was hoping it would be easier this way.  I found another article with tips here.

First, let me just check my installation:

skp@pecan:~$ svnsync --version
svnsync, version 1.5.4 (r33841)
 compiled Aug  7 2009, 01:44:11

Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
 - handles 'http' scheme
 - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
 - with Cyrus SASL authentication
 - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
 - handles 'file' scheme

Here are some other quick discoveries that I found:

You can get help by typing

svnsync help

This will give the list of commands supported: init, sync, and copy-revprops.  Then, you can get help on a specific command, such as init, with:

svnsync help init

One of the things I noticed was this warning which has me worried because I have already started committing to the repository with git:

You should not commit to, or make revision property changes in,
the destination repository by any method other than 'svnsync'.
In other words, the destination repository should be a read-only
mirror of the source repository.

So, lets go for it.

First, I am going to make my local repository:

mkdir project-sarah
git svn clone --username myusername https://project-sarah.googlecode.com/svn/trunk

Now, I am going to try to initialize the syncing:

svnsync init --username myusername --password mypassword  https://project-sarah.googlecode.com/svn file://home/skp/app/git-workspace/project-sarah

Here is the message I got back:

svnsync: Cannot initialize a repository with content in it

So, I guess unless I want to try to get Google Code to delete the repository and start over, I am out of luck here.  Maybe this will help someone else though.

Resources

How I moved my code repository to Google Code

Adding a Project to Git and Google Code

This started because I wanted to share a program I had been working on through Google Code.

First, I created the git repository by:

skp@pecan:~/app/workspaces/pscompare$ cd ProjectSarah/
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ ls
bin  derby.log  export.xml  lib  src  timedb
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git init
Initialized empty Git repository in /home/skp/app/workspaces/pscompare/ProjectSarah/.git/
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git add .
skp@pecan:~/app/workspaces/pscompare/ProjectSarah$

Then, I did a commit:

skp@pecan:~/app/workspaces/pscompare/ProjectSarah$ git commit -m “First Release”Created initial commit 87fa855: First Release
196 files changed, 3456 insertions(+), 0 deletions(-)
create mode 100644 .classpath
create mode 100644 .project
create mode 100644 bin/com/skp/ProjectSarah/ChangeClientButton.class
create mode 100644 bin/com/skp/ProjectSarah/ClientListener.class
create mode 100644 bin/com/skp/ProjectSarah/CreateTimeViewExcel.class
create mode 100644 bin/com/skp/ProjectSarah/CreateTimesheetsButton.class
create mode 100644 bin/com/skp/ProjectSarah/DateField.class

Now, I created a new directory and started following these directions.  One of the problems I had was logging in.  I had to use the “My Profile” link on the upper right hand corner of Google Code.  That showed what my username was, and then, the password was on the Settings tab.

mkdir ~/app/git-workspace
cd ~/app/git-workspace
git svn clone –username <username> https://project-sarah.googlecode.com/svn/trunk
cd trunk
git fetch ~/app/workspaces/pscompare/ProjectSarah/
git branch tmp $(cut -b-40 .git/FETCH_HEAD)
git tag -a -m “Last fetch” last tmp
INIT_COMMIT=$(git log tmp –pretty=format:%H | tail -1)
git checkout $INIT_COMMIT .
git commit -C $INIT_COMMIT
git rebase master tmp
git branch -M tmp master
git svn dcommit

Now, I was able to browse the source of my program online!

Resources

git branch tmp $(cut -b-40 .git/FETCH_HEAD)