You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
2.7 KiB

ROPTS=-zav --no-p --chmod=u=rw,g=rw,o=r --delete --exclude=www/.htaccess --exclude=.svn --exclude=.git --exclude=*.mtt --exclude=tpl/css --exclude=www/file --exclude=*node_modules* --exclude=*.php --exclude=tests.n
LANG=fr
PLUGINS?=0
ENV?="dev"
#To compile project with plugins, add PLUGINS=1 or type `export PLUGINS=1`
install:
#copy config file from template
cp config.xml.dist config.xml
@if [ $(ENV) = "dev" ]; then \
make install_dev; \
fi
#setup dev environnement from source
install_dev:
#set config file to debug=1
#@sed -e 's?debug=.*?debug="1"?g' --in-place config.xml
#install haxe dependencies in .haxelib
haxelib newrepo
haxelib -always install cagette.hxml
haxelib -always install cagetteJs.hxml
#template tools
haxelib run templo
sudo mv temploc2 /usr/bin
#extra plugins
@if [ $(PLUGINS) = 1 ]; then \
haxelib git cagette-pro git@bitbucket.org:bubar/cagette-pro.git; \
haxelib git cagette-hosted git@bitbucket.org:bubar/cagette-hosted.git; \
haxelib git cagette-wholesale-order git@github.com:bablukid/cagette-wholesale-order.git; \
fi
#install npm dependencies
npm install
npm run libs:dev
npm run build:js
#compile
@make css
@make compile
@make frontend
@echo "Well, it looks like everything is fine : librairies are installed, backend and frontend has been compiled !"
#compile backend to Neko
compile:
@if [ $(PLUGINS) = 1 ]; then \
echo "compile Cagette.net with plugins"; \
haxe cagetteAllPlugins.hxml; \
else \
echo "compile Cagette.net core"; \
haxe cagette.hxml; \
fi
#compile SASS files to CSS
css:
npm run build:sass
#compile frontend to JS
frontend:
@if [ $(PLUGINS) = 1 ]; then \
haxe cagetteAllPluginsJs.hxml; \
else \
haxe cagetteJs.hxml; \
fi
#update POT file from source
i18n:
haxe potGeneration.hxml
#compile templates in each language, required for production env.
templates:
haxe cagette.hxml -D i18n_generation
mkdir -p lang/master/tmp
@make LANG=fr ctemplates
#@make LANG=en ctemplates
#@make LANG=de ctemplates
msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
chown www-data:www-data -R www
ctemplates:
# (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt */*/*/*.mtt */*/*/*/*.mtt)
(cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)
#Compile and run unit tests
tests:
@if [ $(PLUGINS) = 1 ]; then \
haxe testsPlugins.hxml; \
else \
haxe tests.hxml; \
fi
@docker-compose run --workdir="/var/www/www" neko neko tests.n mysql://root:root@mysql/tests
cp_plugin:
cp -R .haxelib/cagette-hosted/git/tpl/* lang/master/tpl/plugin/hosted/
cp -R .haxelib/cagette-pro/git/tpl/* lang/master/tpl/plugin/pro/
cp -R .haxelib/cagette-wholesale-order/git/tpl/* lang/master/tpl/plugin/who/