ryantrappy / livePlaylists

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Live Playlists

An app to replace the aux cord (kind of).

Table of Contents

  1. Contributors
  2. Setting up Environment
  3. Running this project
  4. Bulding and deploying to production

Contributors

  1. Ryan Trapp
  2. Joe Wacker
  3. Grayson Odrizzy

Tech Stack

  1. Mac
    1. MacOS Sierra (i.e. OS/X 10.12.6)
    2. Xcode 8.3.3 (mac only)
    3. ios-deploy 1.9.1 (mac only)
  2. Linux
    1. Linux Mint 18.2 (i.e. Ubuntu 16.04.1, i.e. Debian)
  3. Mac+Linux
    1. Java JDK 8
    2. Android Studio 2.3.3
    3. node 6.11.1
    4. npm 5.3.0
    5. bower 1.8.0
    6. ionic 3.7.0
    7. cordova 7.0.1

Setting up Environment

Installing Xcode (Mac only)

Use the Apple Store to download and install Xcode. It is 5+ GB, so be patient. Do not grab the beta, but be sure to use the production version: 8.3.3

This command will verify installation

MAC
/usr/bin/xcodebuild -version # should return Xcode 8.3.3

Installing Java JDK 8 (required only for Android Studio)

If you plan to run Android builds you will need the Java JDK 8. If you do not care to do Android builds, Java is unneeded.

MAC
brew update  # if you haven't installed HomeBrew yet, see: https://brew.sh/
brew cask install java
echo "export JAVA_HOME=/Library/Java/Home" >> ~/.bash_profile
source ~/.bash_profile
LINUX
sudo apt-get install openjdk-8-jdk
echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> ~.bashrc
source ~/.bashrc

Installing Android Studio

If you do not care to do Android builds, Android Studio is unneeded.

Download and install Android Studio from developer.android.com

The website provides full installation instructions. The Mac is a straightforward .dmg install, but Linux requires several detailed command lines. On both platforms the first time you run Android Studio it will download and install another gigabyte's worth of SDK related packages. Be patient.

LINUX
# unzip studio to the /opt folder
sudo unzip ~/Downloads/android-studio-ide-162.4069837-linux.zip -d /opt
# install needed packages
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
# start android studio's first run, which does further download and installation
/opt/android-studio/bin/studio.sh

Also you need to define these environment variables (and add a function to fix misplaced emulator command):

LINUX
echo 'export ANDROID_HOME="$HOME/Android/Sdk"' >> ~/.bashrc
echo 'export ANDROID_SDK="$HOME/Android/Sdk"' >> ~/.bashrc
echo 'export PATH="$PATH:$ANDROID_HOME/tools"' >> ~/.bashrc
echo 'export PATH="$PATH:$ANDROID_HOME/tools/bin"' >> ~/.bashrc
echo 'export PATH="$PATH:$ANDROID_HOME/platform-tools"' >> ~/.bashrc
echo 'export PATH="$PATH:/opt/android-studio/gradle/gradle-3.2/bin"' >> ~/.bashrc
echo 'function emulator { cd "$(dirname "$(which emulator)")" && ./emulator "$@"; }' >> ~/.bashrc

source ~/.bashrc
MAC
echo 'export ANDROID_HOME="$HOME/Library/Android/sdk"' >> ~/.bash_profile
echo 'export ANDROID_SDK="$HOME/Library/Android/sdk"' >> ~/.bash_profile
echo 'export PATH="$PATH:$ANDROID_HOME/tools"' >> ~/.bash_profile
echo 'export PATH="$PATH:$ANDROID_HOME/tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:$ANDROID_HOME/platform-tools"' >> ~/.bash_profile
echo 'export PATH="$PATH:/Applications/Android Studio.app/Contents/gradle/gradle-3.2/bin"' >> ~/.bash_profile
echo 'function emulator { cd "$(dirname "$(which emulator)")" && ./emulator "$@"; }' >> ~/.bash_profile

source ~/.bash_profile

Check these versions are correct, and accept all licenses

MAC+LINUX
gradle -v # should return 3.2
avdmanager -h # should return a help screen
sdkmanager --list | grep emulator # should return 26.1.3
sdkmanager --licenses # answer 'y' to everything

Installing latest node and npm

From the nodejs website: Linux, Mac

LINUX
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - # to add the package repository
sudo apt-get install -y nodejs # to install both node and npm
MAC
cd ~/Downloads
curl -O https://nodejs.org/dist/v6.11.2/node-v6.11.2.pkg
open ./node-v6.11.2.pkg
# finish installation using GUI dialog

Use npm to update itself to the latest version

MAC+LINUX
npm cache verify # cleans up ~/.npm cache automatically
sudo npm install -g npm
node -v # should return 6.11.1
npm -v # should return 5.3.0

Installing ios-deploy (Mac only)

MAC
sudo npm install -g ios-deploy
ios-deploy --version # should return 1.9.1

Installing bower

MAC+LINUX
sudo npm install -g bower
bower -v # should be 1.8.0

Uninstalling the old ionic and cordova apps

MAC+LINUX
cd; sudo npm uninstall -g ionic cordova
which ionic; which cordova # both should return nothing, if not do a stubborn uninstall

Uninstalling stubborn old ionic and cordova

If the above which command returned a file location, then the uninstall did not work properly. First, open a new terminal window and try again, no kidding. On my Linux system bash had cached the commands, and according to which they were still installed despite being removed. If in a new terminal window you still get file locations returned by the which ionic; which cordova command, then do this to fully uninstall:

MAC+LINUX
cd /usr/local; sudo npm uninstall ionic cordova
cd /usr/local/lib; sudo npm uninstall ionic cordova
cd /usr/local/lib/node_modules; sudo npm uninstall ionic cordova

Installing the latest ionic and cordova

MAC+LINUX
cd ~
sudo npm install -g ionic cordova
ionic -v; cordova -v  # should return 3.7.0, 7.0.1 (as of 7/27/2017)

Running this project

Running in browser mode

./bin/run_browser.sh

Running on iphone-SE (default)

./bin/emulate_ios.sh

Running on different iphone

cordova emulate ios --list # use one of these, minus the version number, as an emulation target
cordova emulate ios --target="iPhone-SE" # be sure to leave off device version num from the above

Running on Android Emulator or device

MAC+LINUX
avdmanager list avds | grep Name:
emulator -avd "Nexus_4_API_22" &  # using one of the names listed above
cordova emulate android --target="Nexus_4_API_22" # Whatever the name of your emulator is

Tagging Release in GitHub

When a release is ready for production deployment it is essential to tag it with a GitHub release number, to ensure that only the intended codebase is built and deployed. GitHub makes this easy.

Before anything else, follow the preceding instructions for building and testing the app on all three supported platforms Browser, iOS and Android. Once you have successfully built and tested the app, per preceding instructions, you can proceed tag it for release.

First, be sure to update the version number in config.xml and app.js. This may already be done, but at the least you must double check:

MAC+LINUX
cd ~/myBuildDir
cd ./aggressRebuiltClientApp
cd ./aggress-client

vi config.xml # update version in line that reads: <widget id="com.aggress.aggresshealth" version="4.0.0-alpha5"  ...
vi ./www/js/app.js # update versionNumber in line that reads: .value('versionNumber', "4.0.0-alpha5 (9/13/2017)"  ...

Finally, ready for tagging

MAC+LINUX
cd ~/myBuildDir
cd ./aggressRebuiltClientApp

git tag -a v4.0.0-alpha5 -m "Version: 4.0.0-alpha5 (9/13/2017)" # use correct version, obviously
git push -u origin v4.0.0-alpha5

At this point you still need to edit the git tag before GitHub will treat it as an official "release".

Click here https://github.com/abryden/aggressRebuiltClientApp/releases to go to the release page.

You will see the old release at the bottom of the page, and your newly created tag on top. Click the newly created tag.

Finish this section

Then go to "Tags"

Then go to "Add Release Notes"

Fill them in, click "Save"


Building and Deploying Browser-App to Firebase

MAC/Linux
./bin/buildAndDeploy.sh

Building and Deploying iOS-App to the Apple Store

Write This Section

  1. deploy to Apple TestFlight
  2. release to production

Building and Deploying Android-App to the Google Store

Write This Section

  1. deploy to Android Beta
  2. release to production

About


Languages

Language:JavaScript 85.8%Language:CSS 14.0%Language:HTML 0.2%Language:Shell 0.0%