Update install instructions

This commit is contained in:
Arnaud Vergnet 2020-08-07 18:36:00 +02:00
parent 5cdf9d6318
commit 4199a8700c
2 changed files with 5 additions and 117 deletions

View file

@ -66,43 +66,14 @@ git checkout master
## Installation du projet ## Installation du projet
Une fois le dépôt sur votre machine et git sur la branche de votre choix, ouvrez le terminal dans le dossier du dépôt cloné et lancez le script d'installation avec la commande suivante : Une fois le dépôt sur votre machine et git sur la branche de votre choix, ouvrez le terminal dans le dossier du dépôt cloné et installez les dépendances commande suivante :
````shell script ````shell script
./install.sh [mode] npm install
````
En remplaçant `[mode]` par le mode d'installation de votre choix. Les valeurs valides sont :
````
--android Installation juste pour Android
--ios Installation juste pour iOS
--all Installation pour Android et iOS
```` ````
Lors de l'installation pour Android, vous serez amenés à créer un keystore (permettant d'authentifier l'appli sur votre tel). Plusieurs informations vous seront demandées, mais ce keystore n'est utile que pour le debug, donc vous pouvez laisser tous les champs vides, et taper `y` lors de la confirmation pour valider comme dans l'exemple ci-dessous : Si vous êtes sur macOS, vous devrez aussi lancez la commande suivant pour terminer l'installation :
````shell script
```` cd ios && pod install
Creating debug android keystore...
What is your first and last name?
[Unknown]:
What is the name of your organizational unit?
[Unknown]:
What is the name of your organization?
[Unknown]:
What is the name of your City or Locality?
[Unknown]:
What is the name of your State or Province?
[Unknown]:
What is the two-letter country code for this unit?
[Unknown]:
Is CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown correct?
[no]: y
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 10,000 days
for: CN=Unknown, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
[Storing debug.keystore]
Done
Creating gradle.properties file...
Done
```` ````
En cas de problème d'installation (notamment lors du changement de branche), lancez la commande suivante pour réinstaller seulement les modules node : En cas de problème d'installation (notamment lors du changement de branche), lancez la commande suivante pour réinstaller seulement les modules node :

View file

@ -1,83 +0,0 @@
#!/bin/bash
base_dir=$(pwd)
function ios_install {
cd "$base_dir"/ios || exit 1
rm Podfile.lock
pod install
}
function android_install {
echo "Creating debug android keystore..."
cd "$base_dir"/android/app && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
echo -e "Done\n"
cd ..
echo "Creating gradle.properties file..."
echo "# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.37.0
# This file is not included in git because it may contain secrets concerning the release key.
# To get those secrets, please contact the author at vergnet@etud.insa-toulouse.fr
" > gradle.properties
echo -e "Done\n"
}
function node_install {
cd "$base_dir" || exit 1
./clear-node-cache.sh
}
if [[ $1 == "--android" ]]
then
echo "Installing for Android only"
node_install
android_install
elif [[ $1 == "--ios" ]]
then
echo "Installing for iOS only"
node_install
ios_install
elif [[ $1 == "--all" ]]
then
echo "Installing for Android and iOS"
node_install
android_install
ios_install
else
echo "Usage: ./install.sh [mode]"
echo " [mode]: --android Installs only Android dependencies"
echo " [mode]: --ios Installs only iOS dependencies"
echo " [mode]: --all Installs Android and iOS dependencies"
fi
exit