Slide 1

Slide 1 text

Git submodule Android as an example Dec 2014, Rick Mak

Slide 2

Slide 2 text

Situation • I want to do a Swipe menu on Android • I find a repos do what I want at Github • But the repos don’t publish on maven (or other hosted package management platform) • Or want to use a specific fork/commit

Slide 3

Slide 3 text

One of the solution • Copy the project into libs or SupportProjects • Copy the jar

Slide 4

Slide 4 text

Pros and cons • git clone and go • Accessible and can easily modify the plugins • Mixed up lib and App code • Difficult to update the library

Slide 5

Slide 5 text

Use git submodule • Smaller main repos • Maintain the reusability of the module • Separation of concern, Application vs module • Contribute back of Open Source project • Upgrade of module become easy

Slide 6

Slide 6 text

How submodule look like

Slide 7

Slide 7 text

Actual usage • git clone git@github.com:oursky/project.git • Add • git submodule add Path git@github.com:oursky/module.git • Checkout • git submodule update --init --recursive

Slide 8

Slide 8 text

How many travis script we have now?

Slide 9

Slide 9 text

Idiom • Fork to oursky • Branch by project name