├── .gitignore ├── README.md ├── LICENSE └── release.sh /.gitignore: -------------------------------------------------------------------------------- 1 | last_build_id.rec 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Deprecated, checkout https://bintray.com/google/tensorflow/tensorflow-android] 2 | 3 | # double-tf-android 4 | 5 | A pure Gradle port of the TensorFlow library for Android! Publish [the nightly build of TensorFlow CI](http://ci.tensorflow.org/view/Nightly/job/nightly-android/). The name of this repo is inspired by [JakeWharton/double-espresso](https://github.com/JakeWharton/double-espresso). 6 | 7 | [ ![Download](https://api.bintray.com/packages/piasy/maven/double-tf-android/images/download.svg) ](https://bintray.com/piasy/maven/double-tf-android/_latestVersion) 8 | 9 | ## Dependency 10 | 11 | ``` gradle 12 | allprojects { 13 | repositories { 14 | maven { 15 | url "http://dl.bintray.com/piasy/maven" 16 | } 17 | } 18 | } 19 | 20 | compile 'com.github.piasy:double-tf-android:1.0.0-nightly-125@aar' 21 | ``` 22 | 23 | ## Usage 24 | 25 | Please refer to [Piasy/mnist-android-tensorflow](https://github.com/Piasy/mnist-android-tensorflow/tree/double-tf-android/MnistAndroid). 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Piasy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | jsonq() { 4 | python -c "import sys,json; obj=json.load(sys.stdin); print($1)" 5 | } 6 | 7 | API_KEY=$1 8 | 9 | # check new build 10 | 11 | echo "checking new release..." 12 | 13 | LATEST_BUILD=`curl http://ci.tensorflow.org/view/Nightly/job/nightly-android/lastSuccessfulBuild/api/json` 14 | 15 | LATEST_BUILD_ID=$(echo $LATEST_BUILD | jsonq 'obj["id"]') 16 | LAST_BUILD_ID=`cat last_build_id.rec` 17 | 18 | echo "last build id is $LAST_BUILD_ID, latest build id is $LATEST_BUILD_ID" 19 | 20 | if [ "$LAST_BUILD_ID" -ge "$LATEST_BUILD_ID" ]; then 21 | echo "no new version found" 22 | exit 1 23 | fi 24 | 25 | VERSION_NAME=1.0.0-nightly-$LATEST_BUILD_ID 26 | 27 | echo "find new version $VERSION_NAME, start publishing..." 28 | 29 | # prepare new release 30 | 31 | echo "creating pom file..." 32 | 33 | cat > double-tf-android-$VERSION_NAME.pom < 35 | 37 | 4.0.0 38 | com.github.piasy 39 | double-tf-android 40 | $VERSION_NAME 41 | aar 42 | double-tf-android 43 | https://github.com/Piasy/double-tf-android 44 | 45 | 46 | The MIT License (MIT) 47 | http://opensource.org/licenses/MIT 48 | 49 | 50 | 51 | 52 | piasy 53 | piasy 54 | xz4215@gmail.com 55 | 56 | 57 | 58 | https://github.com/Piasy/double-tf-android.git 59 | https://github.com/Piasy/double-tf-android.git 60 | https://github.com/Piasy/double-tf-android 61 | 62 | 63 | EOL 64 | 65 | echo "downloading aar file..." 66 | 67 | wget -O double-tf-android-$VERSION_NAME.aar http://ci.tensorflow.org/view/Nightly/job/nightly-android/$LATEST_BUILD_ID/artifact/out/tensorflow.aar 68 | 69 | # create version 70 | 71 | echo "creating version $VERSION_NAME..." 72 | 73 | POST_BODY="{\"name\":\"$VERSION_NAME\",\"desc\":\"auto release of $VERSION_NAME\"}" 74 | 75 | RESULT=`curl --user "piasy:$API_KEY" \ 76 | -H "Content-Type: application/json" \ 77 | -X POST -d "$POST_BODY" \ 78 | https://api.bintray.com/packages/piasy/maven/double-tf-android/versions` 79 | 80 | CREATED_NAME=$(echo $RESULT | jsonq 'obj.get("name", "")') 81 | 82 | echo "created name: $CREATED_NAME, version name: $VERSION_NAME" 83 | 84 | if [ "$CREATED_NAME" != "$VERSION_NAME" ]; then 85 | echo "create version $VERSION_NAME fail, message: $RESULT" 86 | exit 1 87 | fi 88 | 89 | # upload artifact 90 | 91 | echo "uploading pom file of $VERSION_NAME..." 92 | 93 | RESULT=`curl --user "piasy:$API_KEY" \ 94 | -X PUT -d \ 95 | @double-tf-android-$VERSION_NAME.pom \ 96 | https://api.bintray.com/content/piasy/maven/double-tf-android/$VERSION_NAME/com/github/piasy/double-tf-android/$VERSION_NAME/double-tf-android-$VERSION_NAME.pom?publish=1` 97 | 98 | RESULT_MESSAGE=$(echo $RESULT | jsonq 'obj.get("message", "")') 99 | 100 | if [ "$RESULT_MESSAGE" != "success" ]; then 101 | echo "upload pom fail, message: $RESULT" 102 | exit 1 103 | fi 104 | 105 | echo "uploading aar file of $VERSION_NAME..." 106 | 107 | RESULT=`curl --user "piasy:$API_KEY" \ 108 | -X PUT -d \ 109 | @double-tf-android-$VERSION_NAME.aar \ 110 | https://api.bintray.com/content/piasy/maven/double-tf-android/$VERSION_NAME/com/github/piasy/double-tf-android/$VERSION_NAME/double-tf-android-$VERSION_NAME.aar?publish=1` 111 | 112 | RESULT_MESSAGE=$(echo $RESULT | jsonq 'obj.get("message", "")') 113 | 114 | if [ "$RESULT_MESSAGE" != "success" ]; then 115 | echo "upload aar fail, message: $RESULT" 116 | exit 1 117 | fi 118 | 119 | echo $LATEST_BUILD_ID > last_build_id.rec 120 | 121 | echo "publish release $VERSION_NAME succeed!" 122 | --------------------------------------------------------------------------------