简体   繁体   中英

Google App Engine Endpoints with Maven

I'm having trouble using the Google's Cloud endpoints with Android. I have one maven project, with two modules, Android app and Web app. The web app is generating the endpoints client library, but it's just a zip file with all the dependencies and the .jar file with complied classes and some pom file.

The problem is, how to make it included in the Android module? I need this in order to get the build fully automatized. Any ideas?

The solution I used is to extract the zip file, and from within that extract the sources.jar to your Android project's src/main/java directory. You can write a script that does this such as the following. Maybe someone knows a better way.

CLIENTTMP=/tmp/android-client
LIBNAME=helloworld
VER=v1
LIBZIP=${LIBNAME}-${VER}-java.zip
SRCJAR=${CLIENTTMP}/${LIBNAME}/*jar
ANDROIDSRC=../MyAndroidModule/src/main/java

rm -rf ${CLIENTTMP}
mkdir -p ${CLIENTTMP}

# -o == overwrite w/o asking
# -d == output dir
unzip -o -d ${CLIENTTMP} ${LIBZIP}
unzip -o -d ${ANDROIDSRC} ${SRCJAR}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM