Skip to content

Commit

Permalink
Make server builds work offline.
Browse files Browse the repository at this point in the history
  • Loading branch information
zestyping committed Aug 4, 2015
1 parent 9e09a7f commit 5d4aa31
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/openmrs_build
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,27 @@ cd .. # go to the root of the Buendia repository
# Install the OpenMRS SDK.
mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk

# Preserve the xforms-api module if it's already downloaded, so openmrs_build
# can work offline. This module has to be downloaded with curl; see below.
XFORMS_API_DEST=$MODULE_DIR/xforms-api-4.3.5.omod
XFORMS_API_SAVED=/tmp/xforms-api.$$
cp $XFORMS_API_DEST $XFORMS_API_SAVED 2>/dev/null || true

# Clean out any old modules, then re-create the server module directory so that
# openmrs_build can run even if openmrs_setup hasn't set up the dev server yet.
rm -rf $MODULE_DIR
mkdir -p $MODULE_DIR

# TODO(ping): Figure out how to cache these module dependencies in the local
# Maven repository so that builds can work offline.

# Install the module dependencies in the OpenMRS development server.
$INSTALL -DartifactId=xforms -Dversion=4.3.5
$INSTALL -DartifactId=webservices.rest -Dversion=2.6

# openmrs-sdk-maven-plugin has a bug that looks up xforms-api as xforms-api-omod
# and can't find it, so we have to download xforms-api separately.
curl -o $HOME/openmrs/$SERVER_ID/modules/xforms-api-4.3.5.omod http://mavenrepo.openmrs.org/nexus/content/repositories/public/org/openmrs/module/xforms-api/4.3.5/xforms-api-4.3.5.jar
cp $XFORMS_API_SAVED $XFORMS_API_DEST 2>/dev/null || curl -o $XFORMS_API_DEST http://mavenrepo.openmrs.org/nexus/content/repositories/public/org/openmrs/module/xforms-api/4.3.5/xforms-api-4.3.5.jar

# Build the Buendia module, passing along any flags given to this script.
# Build the Buendia module, passing along any flags (e.g. -DskipTests)
# given to this script.
cd openmrs
mvn install "$@"

Expand Down

0 comments on commit 5d4aa31

Please sign in to comment.