1+ #! /bin/bash
2+
3+ # I have being unable to find Google's repository from where Android Studio gets the wear
4+ # aar files. People have been trying to solve this in relation to using Eclipse to build
5+ # wear apps, for example:
6+ # http://stackoverflow.com/questions/27913902/dependencies-from-android-gradle-build-or-how-to-build-an-android-wear-app-wit
7+ # However, both JCenter and Maven Central don't seem to hold any wearable pacakges:
8+ # https://jcenter.bintray.com/com/google/android/
9+ # https://search.maven.org/#search%7Cga%7C1%7Cwearable
10+ # So far, only found two odd repostories with up-to-date versions of the aar packages:
11+ # http://uiq3.sourceforge.net/Repository/com/google/android/support/wearable/
12+ # http://mvn.sibext.com/com/google/android/support/wearable/
13+ # (one is maintained by a company in Siberia)
14+
15+ # Usage:
16+ # call with the version number of the wearable package to download and extract, i.e.:
17+ # ./wear-update.sh 1.4.0
18+
19+ version=$1
20+
21+ # Download the requested aar package from the sourceforge repository
22+ wget http://uiq3.sourceforge.net/Repository/com/google/android/support/wearable/$version /wearable-$version .aar
23+
24+ # Now unzip, and extract the classes jar. For more information on the aar format and how
25+ # to use it in Eclipse, see this blogposts:
26+ # https://commonsware.com/blog/2014/07/03/consuming-aars-eclipse.html
27+ # and Google's documentation on Android Libraries:
28+ # https://developer.android.com/studio/projects/android-library.html
29+
30+ unzip wearable-$version .aar -d wearable
31+ cp wearable/classes.jar ../core/library/wearable-$version -classes.jar
32+ cp wearable/classes.jar ../mode/wearable-$version -classes.jar
33+
34+ # Remove left over files
35+ rm -Rf wearable
36+ rm wearable-$version .aar
37+
38+ # Done, print out reminder...
39+ echo " "
40+ echo " Done!"
41+ echo " Remember to update the version number of the wearable jar in processing-core's source code"
0 commit comments