Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefiles development #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
setup: .setup_homebrew .setup_yarn .setup_node .setup_ruby

.setup_homebrew:
@echo "\x1b[1m[Installing] Homebrew » Package manager... \x1b[0m";
@if $(homebrew); then \
echo "\x1b[32m\x1b[1mHomebrew is already installed. \x1b[0m"; \
else \
if $(install_homebrew); then \
echo "done."; exit 0; \
else \
echo "failed."; exit 1; \
fi \
fi

.setup_yarn: .setup_homebrew
@echo "";
@echo "\x1b[1m[Installing] Yarn » Dependency manager... \x1b[0m"; \
if $(yarn); then \
echo "\x1b[32m\x1b[1mYarn is already installed. \x1b[0m"; \
else \
if $(install_yarn); then \
echo "Done."; exit 0; \
else \
echo "Failed."; exit 1; \
fi \
fi

.setup_node: .setup_homebrew .setup_yarn
@echo "";
@echo "\x1b[1m[Installing] Node » Javascript engine... \x1b[0m"; \
if $(node); then \
echo "\x1b[32m\x1b[1mNode is already installed. \x1b[0m"; \
else \
if $(install_node); then \
echo "done."; exit 0; \
else \
echo "failed."; exit 1; \
fi \
fi

.setup_ruby: .setup_homebrew .setup_yarn .setup_node
@echo "";
@echo "\x1b[1m[Installing] Ruby » Scripting language... \x1b[0m"; \
if $(ruby); then \
echo "\x1b[32m\x1b[1mRuby is already installed. \x1b[0m"; \
else \
if $(install_ruby); then \
echo "done."; exit 0; \
else \
echo "failed."; exit 1; \
fi \
fi

install_homebrew := ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
install_yarn := brew install yarn
install_node := brew install node
install_ruby := brew install ruby

homebrew := which brew > /dev/null
yarn := which yarn > /dev/null
node := which node > /dev/null
ruby := which ruby > /dev/null
15 changes: 15 additions & 0 deletions backoffice/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
install:
@echo "\x1b[1m[Back-office] 🔥 Installing packages... \x1b[0m";
@if [ -d node_modules ]; then echo "\x1b[1m\x1b[33m[Back-Office] Packages is already installed. \x1b[0m"; exit 0; \
else yarn; \
fi; \

start: install
@echo "\x1b[1m[Back-office] 🔥 Starting packager... \x1b[0m";
@yarn start;

reset:
@echo "\x1b[1m[Back-office] 🔥 Reset project... \x1b[0m";
@watchman watch-del-all;
@rm -rf node_modules;
@yarn cache clean;
38 changes: 38 additions & 0 deletions mobile/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.PHONY: android ios

install:
@echo "\x1b[1m[Mobile] 🔥 Installing packages... \x1b[0m";
@if [ -d node_modules ]; then echo "\x1b[1m\x1b[33m[Mobile] Packages is already installed. \x1b[0m"; \
else yarn; \
fi; \
if [ -d ./ios/Pods ]; then echo "\x1b[1m\x1b[33m[Mobile] Pods is already installed. \x1b[0m"; exit 0; \
else pod install; \
fi; \

start: install
@echo "\x1b[1m[Mobile] 🔥 Starting packager... \x1b[0m";
@yarn start;

link: install
@echo "\x1b[1m[Mobile] 🔥 Linking librairies... \x1b[0m";
@react-native link;

ios:
@echo "\x1b[1m[Mobile] 🔥 Launching iOS application... \x1b[0m";
@react-native run-ios

android:
@echo "\x1b[1m[Mobile] 🔥 Launching Android application... \x1b[0m";
@react-native run-android

open-ios:
@open ios/Aromaclop.xcodeproj

open-android:
@open -a /Applications/Android\ Studio.app ./android

reset:
@echo "\x1b[1m[Mobile] 🔥 Reset project... \x1b[0m";
@watchman watch-del-all;
@rm -rf node_modules;
@yarn cache clean;
15 changes: 15 additions & 0 deletions prisma/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
install:
@echo "\x1b[1m[Prisma] 🔥 Installing packages... \x1b[0m";
@if [ -d node_modules ]; then echo "\x1b[1m\x1b[33m[Prisma] Packages is already installed. \x1b[0m"; exit 0; \
else yarn; \
fi; \

start: install
@echo "\x1b[1m[Prisma] 🔥 Starting packager... \x1b[0m";
@yarn start;

reset:
@echo "\x1b[1m[Prisma] 🔥 Reset project... \x1b[0m";
@watchman watch-del-all;
@rm -rf node_modules;
@yarn cache clean;