From 5c1e542dab6f409c0be70eda869fded5f5ccbb33 Mon Sep 17 00:00:00 2001 From: akinwale Date: Wed, 9 May 2018 19:26:57 +0100 Subject: [PATCH 01/11] Travis CI deployment to AWS and Github releases (#114) --- .travis.yml | 117 +++++++++++++++++++++++++------------- lbry-android.keystore.enc | Bin 0 -> 2240 bytes release.sh | 4 +- 3 files changed, 80 insertions(+), 41 deletions(-) create mode 100644 lbry-android.keystore.enc diff --git a/.travis.yml b/.travis.yml index 52ed9bf4..9c322402 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,39 +1,78 @@ -sudo: required -dist: trusty -language: python -python: - - "2.7" -install: - - deactivate - - export PATH=/usr/bin:$PATH - - sudo dpkg --add-architecture i386 - - sudo apt-get -qq update - - sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 npm nodejs - - sudo pip install --upgrade cython==0.25.2 pip setuptools - - git clone https://github.com/akinwale/buildozer.git - - cd app - - npm config set registry="http://registry.npmjs.org/" - - npm install --silent --save react@16.2.0 react-native@0.52.0 react-native-video@2.0.0 - - cd .. - - cd buildozer - - sudo python setup.py install - - cd .. - - mv buildozer.spec.travis buildozer.spec - - mkdir -p cd ~/.buildozer/android/platform/ - - wget 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' -P ~/.buildozer/android/platform/ - - wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/ - - wget 'https://dl.google.com/android/repository/android-23_r02.zip' -P ~/.buildozer/android/platform/ - - wget 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P ~/.buildozer/android/platform/ - - unzip -qq ~/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d ~/.buildozer/android/platform/ - - tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/ - - mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23 - - unzip -qq ~/.buildozer/android/platform/android-23_r02.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms - - mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-6.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-23 - - mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools - - unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools - - mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1 - - mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses - - echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license -script: - - ./build.sh | grep -Fv -e 'working:' -e 'copy' --line-buffered - - cp bin/*.apk /dev/null +sudo: required +dist: trusty +language: python +python: +- '2.7' +install: +- deactivate +- export PATH=/usr/bin:$PATH +- sudo dpkg --add-architecture i386 +- sudo apt-get -qq update +- sudo apt-get -qq install build-essential ccache git libncurses5:i386 libstdc++6:i386 + libgtk2.0-0:i386 libpangox-1.0-0:i386 libpangoxft-1.0-0:i386 libidn11:i386 python2.7 + python2.7-dev openjdk-8-jdk unzip zlib1g-dev zlib1g:i386 m4 libc6-dev-i386 +- sudo pip install --upgrade cython==0.25.2 pip setuptools +- wget https://nodejs.org/dist/v8.11.1/node-v8.11.1-linux-x64.tar.xz +- tar -xf node-v8.11.1-linux-x64.tar.xz +- sudo ln -s ~/node-v8.11.1-linux-x64/bin/node /usr/bin/node +- sudo ln -s ~/node-v8.11.1-linux-x64/bin/npm /usr/bin/npm +- git clone https://github.com/lbryio/buildozer.git +- cd app +- npm config set registry="http://registry.npmjs.org/" +- npm install +- cd .. +- cd buildozer +- sudo python setup.py install +- cd .. +- mv buildozer.spec.travis buildozer.spec +- mkdir -p cd ~/.buildozer/android/platform/ +- wget 'https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip' + -P ~/.buildozer/android/platform/ +- wget 'https://dl.google.com/android/android-sdk_r23-linux.tgz' -P ~/.buildozer/android/platform/ +- wget 'https://dl.google.com/android/repository/android-23_r02.zip' -P ~/.buildozer/android/platform/ +- wget 'https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip' -P + ~/.buildozer/android/platform/ +- unzip -qq ~/.buildozer/android/platform/android-ndk-r13b-linux-x86_64.zip -d ~/.buildozer/android/platform/ +- tar -xf ~/.buildozer/android/platform/android-sdk_r23-linux.tgz -C ~/.buildozer/android/platform/ +- mv ~/.buildozer/android/platform/android-sdk-linux ~/.buildozer/android/platform/android-sdk-23 +- unzip -qq ~/.buildozer/android/platform/android-23_r02.zip -d ~/.buildozer/android/platform/android-sdk-23/platforms +- mv ~/.buildozer/android/platform/android-sdk-23/platforms/android-6.0 ~/.buildozer/android/platform/android-sdk-23/platforms/android-23 +- mkdir -p ~/.buildozer/android/platform/android-sdk-23/build-tools +- unzip -qq ~/.buildozer/android/platform/build-tools_r26.0.1-linux.zip -d ~/.buildozer/android/platform/android-sdk-23/build-tools +- mv ~/.buildozer/android/platform/android-sdk-23/build-tools/android-8.0.0 ~/.buildozer/android/platform/android-sdk-23/build-tools/26.0.1 +- mkdir -p ~/.buildozer/android/platform/android-sdk-23/licenses +- echo $'\nd56f5187479451eabf01fb78af6dfcb131a6481e' > ~/.buildozer/android/platform/android-sdk-23/licenses/android-sdk-license +script: +- "./release.sh | grep -Fv -e 'working:' -e 'copy' -e 'Compiling' --line-buffered" +before_deploy: +- cd bin +- export BUILD_VERSION=$(cat ../src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') +- cp browser-$BUILD_VERSION-release.apk latest.apk +deploy: + - provider: releases + api_key: + secure: m+FYX7vHZoiLSHHiJ2d3y8Fm4qSRoIVjEei+5BV17awiow/U8UKvy/5J1n8qfBdq+dpst5z58pTHCKWPbJz84C3z/posJ5mwEcOAaD/kxSAMHbtlaPW90pRWHUu3aW86UM/ggqtljE9Qz8KS/9a0xNUDfcXLkLgxuxgwodMcacEulAAc9TIOCUeR3IFI+KN0ptTCVahCu2JN8DCHKomaR+yKZHdo/9v9XCAcvmImSDu9nUDLH3+A7xQeRpPJqSspk1dadgdXP76kU8t3OKsYuM7DS5AoKvMIc9lZot4UYYKAx7/zavbzeEmqnyskULgsmV8/UDI1AV9U7uFBdrR6dSjISA1k6EHnCgqzasF+lp0hz5iE/0yPxlE9Z1kLW9gZgxSJtjr6Kv2uqAjHYYmpkjtTwHPwBugRM7PWMTxHNcPwkIHpBSRkXjpyDjkWd/LY4X866Y1g2BdIhbGshjy/9Fb2vnYxNZW6drLHn+wWeHJ41Vfgtg1cn01yZGJqgIkcTkhzNL6Bi++y8EBJXDr4L870s336SpbqRuIrO/C16ZFB+XnOg4Ty50Fk5zkbySMHII58iWqSyDYWNvhqo9zU9jn1XQQeok12129Y4t9TUOcJRbxhQ+511lCmVcFIkWHsXDK2QSZ7TeMK5GQUA8OvcNe+WLCJaQ/YD7OZvwlPTvc= + file_glob: true + file: browser-*-release.apk + overwrite: true + skip_cleanup: true + on: + tags: true + - provider: s3 + access_key_id: + secure: qEZZ73DWBn9+M2pS4VwsyX8YZjZOENIMP/eoU1A9Vbn155oZpbUaJ7k+4cAXqmBm0WBMKZDqpzCRSGehLAxHFH5rjkj9gLSgd8fY9cveABHkl50HeuxxNsQM+ytk9sCtP8bWOqf7rT/iCgM1soyF2pYmfHM3tU9l0fWK8oZ7pFRIg91hXxUvhvYY2u6B9D1NqSN9T3xtrwEkVjvmkmyKMLCtoIdyB7QdeQciFdGFhZC9DYJVRLxa3BlzZ1T8Qv4MCyIxPjxIugNvVR64VgGjdBdq0BEIyoRqbeIvtqQjlnne4DfJFeCmbDrSva1wDP1UyFoxsRhiWQ/jXXgIyN2CisI6QRD0J+a2LgmbmtkUzhRMuVQJmBrIauulOzcowwRV2J4TtUaAJK9iSHT9D3RLzpazCOnjvJZV9CK5w252Vs5eHnisCSCQk8Ozox96Sg6XW580NEXfkYoGzXLSGiy9zrZs813blUjssEY+jIQmJEby80C3guK7/G4lzthv57psqBWcYd0tFR+vTestS+EFlC02ToUngJhW7I7lPA2G2yrJ5319jFxUSniijb1n72TQthnbqTBahepvKvuG1iWZnCKxS5sWkutFoqEcpQyhXdf7QdR/VrOr8N5xrhK1B8dCYZM6h8eMZbBvOLH49+N6L9jiJz5x+Lk32wcssv1oOgI= + secret_access_key: + secure: lPygaaJdjFgWY4GcXUXC4Oc5op/TE85Md8lX2bzW19058lbcqYSdM0WySQCxoU/4rlM4Q0N8du0qQ3kZXDpP9XSqvFTVnTGTuB4yghUR1yXcpt6u3JOeOX+YAc3wyQ/pmod6VGO0n8pm8hBVsSFXufdBTjD2W+tNrDoa8RYnlWrt7BbICGltB7PcqYh1Qw6S1wDyZt8I4B5JHDhyJmX6FT5KfOb5cJyynpxlKUstUfy1rh81KuGkEcuEVOLg1s7HE1/IUkVIgezAuCrMHjc86qbNcHULJMFCVYntvvs07+tctrPxA/cfS24WkW7smyij+gdZAZWNNgkIDCuwqpex1v1nKn56mC8xXyUl4CnSCuubQtqUBzTmd4T5sF7trTtpVr9NInwy+4mUoCpz2UKZekTjZkqpzCAuC/cBVWE1/k3wsNat6dGyc9QnKXBqLVhuwYsCOteqLW50ToMMMW0ccDV6FXodwZmrunGd5wIX+UgZkf4l32vzKUxHtIupfYbsjylcPc3VO0OzMMKP/3sYLAN6QntVDFc30k1uqqpgJN4t0nV7vvjMI+b0Qr+o7GzUV2d+QulQXOySJgB2pH0kV1EoPAJ8KbqDOy8KgCJl0YIbOaz14+SiRQhotJ2hrLdtsvyVYXMX+d/CKHJSWa2MQq+jD7lMCwVaGg82PFN1gI4= + bucket: "build.lbry.io" + upload-dir: android + region: us-east-1 + overwrite: true + skip_cleanup: true + on: + tags: true +env: + global: + - secure: GS3Cp1QXiX8UPye3kdk2A2f3iFRr02sHKpY+RE+Zvx3Q7GDmhDuepHKzx6Hq5Os5fZN9Y/Bdds+XH+vLIRtT6XsWR7AONPhSifVY3XB5/2F+lDcZ538W8P8GZvXejpY4VecMUWHoWbuyt0s3PpaGXZJcHp8ir+CUJ0NUmU3I9w449pqj9/de2LHtG3qKH1lG0Xz58iOC0mmEeH451cQv3dDw851ihA4ak9vCTV1KKuMJUcv+2u6PxXGVX0mrJLEssjL6ze6G5iZUB4PM1vUpe3HqcVw8CSOa8O79BQxoB00qyA3WD+LpZDPpI0wh6gmBsR/2nCFyMJndJr3CjyB6lHdK7PgBoK0CJjszKawiZqg74O9DOjzTJTO2v9bnkfPrNxu4/3D/tbDg+whY8k5oV1sgDue9KAo/2aEEO0LGlKP4W3Qqt/lzRKsfpMVrMTdCNKJ8rG/wUFWw8ehOCmAsJaQ1saDOZDMNPLLuYpxFgmXFqWV5ThbUHgEJVj+G7qt6CMEussKvuZJoJZx24Pdk5Prr7ENzTyPmE5gk4b8WNfVNleOEC09xu5tFk2yOdzF1dawKsa1Mog6gImirTQ/INC/3BANdKoG9/cLJEIt9boJaFDXE1dpqoLVzoez9znHKOGSAU/1PaH3thjVnbUyO5z24PpPZ12zM3+3P8DbI454= +before_install: +- openssl aes-256-cbc -K $encrypted_b4c9b905b12e_key -iv $encrypted_b4c9b905b12e_iv + -in lbry-android.keystore.enc -out lbry-android.keystore -d diff --git a/lbry-android.keystore.enc b/lbry-android.keystore.enc new file mode 100644 index 0000000000000000000000000000000000000000..5da28d272f5df725a4199cde6fdf1cd937ba535a GIT binary patch literal 2240 zcmV;x2tW7R^qly*H7B>kBP$MQn|(Gia*U4+bvh z*syU6sSW*KZ!3&8aR_1^H?_rWp3+NhmRaZ)tq0)rhwhoY8v!>^u;f?q zRVBBg$x;v&r1%;tI_e#CL$Io#5jX(7jpNTycu88GAL_q;mxAsWGrenMPQt@;Dh!ji zqA*!?g9$guH00M%isS4eaUl*BT&N_dF4l#z8I*!q;uD~*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|H9s12RZFFZjK6)%T*#Y z95*#3^yDOm^YaQLJ%As~=TyQ+hJwDdNlv8^y+!vmOl$M%Js~u*dx80QbO|80zrZ-! zweNMV&nO*$`nSo#hl?+EziLQn*w9)Fvm7m+0^(P9hf_aj%KeYNNruRw*Rj6 zNM=yEi>!FW==Uj#iqmC`TrQokNzL^NQ&INnZu7{ZeE7I@p+|cL<05w{bEx8HDl?4) z`)f8MxNPKzR$OdZUhP^l8qxGzs7~O~3<6yY7d|{npOI6LpG8AyNGv*}Jr&O$D5t#+ zg4;uZyjK|@ Date: Wed, 9 May 2018 19:01:15 -0300 Subject: [PATCH 02/11] Update dependencies needed. --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 838eb561..b08e43e7 100644 --- a/BUILD.md +++ b/BUILD.md @@ -23,7 +23,7 @@ Alternatively, the JDK available from http://www.oracle.com/technetwork/java/jav #### Install Cython ``` -sudo pip install --upgrade cython==0.25.2 +sudo pip install --upgrade cython==0.25.2 setuptools ``` #### Install buildozer -- 2.45.2 From 6abf511ef4a72e986af778727f5b9e37b09652f7 Mon Sep 17 00:00:00 2001 From: akinwale Date: Thu, 10 May 2018 18:38:07 +0100 Subject: [PATCH 03/11] added link component with some tweaks to transaction list (#98) --- app/src/component/button/view.js | 2 +- app/src/component/link/index.js | 9 +++++ app/src/component/link/view.js | 38 +++++++++++++++++++ app/src/component/transactionList/index.js | 4 +- .../internal/transaction-list-item.js | 20 +++++++--- app/src/component/transactionList/view.js | 3 +- .../component/transactionListRecent/view.js | 8 +++- app/src/page/transactionHistory/view.js | 4 +- app/src/styles/transactionList.js | 13 +++++-- app/src/styles/wallet.js | 5 +++ 10 files changed, 89 insertions(+), 17 deletions(-) create mode 100644 app/src/component/link/index.js create mode 100644 app/src/component/link/view.js diff --git a/app/src/component/button/view.js b/app/src/component/button/view.js index 1c2f1182..04f4b9d2 100644 --- a/app/src/component/button/view.js +++ b/app/src/component/button/view.js @@ -3,7 +3,7 @@ import { Text, TouchableOpacity } from 'react-native'; import buttonStyle from '../../styles/button'; import Icon from 'react-native-vector-icons/FontAwesome'; -export default class Button extends React.PureComponent { +export default class Button extends React.PureComponent { render() { const { disabled, diff --git a/app/src/component/link/index.js b/app/src/component/link/index.js new file mode 100644 index 00000000..8c06e44b --- /dev/null +++ b/app/src/component/link/index.js @@ -0,0 +1,9 @@ +import { connect } from 'react-redux'; +import { doNotify } from 'lbry-redux'; +import Link from './view'; + +const perform = dispatch => ({ + notify: (data) => dispatch(doNotify(data)) +}); + +export default connect(null, perform)(Link); diff --git a/app/src/component/link/view.js b/app/src/component/link/view.js new file mode 100644 index 00000000..8ea60a19 --- /dev/null +++ b/app/src/component/link/view.js @@ -0,0 +1,38 @@ +import React from 'react'; +import { Linking, Text, TouchableOpacity } from 'react-native'; + +export default class Link extends React.PureComponent { + handlePress = () => { + const { error, href, navigation, notify } = this.props; + + if (navigation && href.startsWith('#')) { + navigation.navigate(href.substring(1)); + } else { + Linking.openURL(href).catch(err => notify({ + message: error, + displayType: ['toast'] + })); + } + } + + render() { + const { + onPress, + style, + text + } = this.props; + + let styles = []; + if (style.length) { + styles = styles.concat(style); + } else { + styles.push(style); + } + + return ( + + {text} + + ); + } +}; diff --git a/app/src/component/transactionList/index.js b/app/src/component/transactionList/index.js index e1079d22..c89b0a65 100644 --- a/app/src/component/transactionList/index.js +++ b/app/src/component/transactionList/index.js @@ -8,6 +8,4 @@ const select = state => ({ myClaims: selectAllMyClaimsByOutpoint(state), }); -const perform = dispatch => ({}); - -export default connect(select, perform)(TransactionList); +export default connect(select, null)(TransactionList); diff --git a/app/src/component/transactionList/internal/transaction-list-item.js b/app/src/component/transactionList/internal/transaction-list-item.js index a87753db..cb4d416f 100644 --- a/app/src/component/transactionList/internal/transaction-list-item.js +++ b/app/src/component/transactionList/internal/transaction-list-item.js @@ -1,7 +1,8 @@ // @flow import React from 'react'; -import { Text, View } from 'react-native'; -import { formatCredits } from 'lbry-redux'; +import { Text, View, Linking } from 'react-native'; +import { buildURI, formatCredits } from 'lbry-redux'; +import Link from '../../link'; import moment from 'moment'; import transactionListStyle from '../../../styles/transactionList'; @@ -11,14 +12,20 @@ class TransactionListItem extends React.PureComponent { } render() { - const { transaction } = this.props; + const { transaction, navigation } = this.props; const { amount, claim_id: claimId, claim_name: name, date, fee, txid, type } = transaction; - + return ( {this.capitalize(type)} + {name && claimId && ( + navigation && navigation.navigate('File', { uri: buildURI({ claimName: name, claimId }) })} + text={name} /> + )} {formatCredits(amount, 8)} @@ -27,7 +34,10 @@ class TransactionListItem extends React.PureComponent { - {txid.substring(0, 8)} + {date ? ( diff --git a/app/src/component/transactionList/view.js b/app/src/component/transactionList/view.js index 908aebf0..40afaf22 100644 --- a/app/src/component/transactionList/view.js +++ b/app/src/component/transactionList/view.js @@ -40,7 +40,7 @@ class TransactionList extends React.PureComponent { } render() { - const { emptyMessage, rewards, transactions } = this.props; + const { emptyMessage, rewards, transactions, navigation } = this.props; const { filter } = this.state; const transactionList = transactions.filter(this.filterTransaction); @@ -56,6 +56,7 @@ class TransactionList extends React.PureComponent { ))} diff --git a/app/src/component/transactionListRecent/view.js b/app/src/component/transactionListRecent/view.js index 42a9c30e..02dd9a11 100644 --- a/app/src/component/transactionListRecent/view.js +++ b/app/src/component/transactionListRecent/view.js @@ -3,6 +3,7 @@ import React from 'react'; //import BusyIndicator from 'component/common/busy-indicator'; import { Text, View } from 'react-native'; import Button from '../button'; +import Link from '../link'; import TransactionList from '../transactionList'; import type { Transaction } from '../transactionList/view'; import walletStyle from '../../styles/wallet'; @@ -26,14 +27,17 @@ class TransactionListRecent extends React.PureComponent { Recent Transactions -