forked from admc/se-builder
-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathMakefile
28 lines (24 loc) · 886 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
PROJECT="seleniumbuilder"
BUILD_PATH="build"
PWD=$(shell pwd)
LOADER_JS=$(shell find . -name loader.js)
RDF_PATH=$(shell find . -name *.rdf)
BUILDER_VERSION=$(shell cat ${LOADER_JS} | grep -m1 'builder\.version' | cut -d '"' -f 2)
XPI_NAME="${PROJECT}-${BUILDER_VERSION}.xpi"
XPI_PATH="${PWD}/${BUILD_PATH}/${XPI_NAME}"
.PHONY: xpi clean
help:
@echo "Selenium Builder - v${BUILDER_VERSION}\n"
@echo "Available targets:"
@echo "xpi: creates the plugin file"
@echo "clean: deletes generated build folder"
xpi:
@echo "Building latest '${XPI_PATH}':\n"
@mkdir -p ${BUILD_PATH}
@sed -i.bak "s#\(em:version>\)[^<>]*\(</em:version\)#\1${BUILDER_VERSION}\2#" ${RDF_PATH}
@rm -f ${RDF_PATH}.bak
@cd ${PROJECT} && zip -r ../${BUILD_PATH}/${XPI_NAME} .
@echo "File generated at: ${PWD}/${BUILD_PATH}/${XPI_NAME}"
clean:
@rm -rf ${BUILD_PATH}
@echo "'${PWD}/${BUILD_PATH}' cleaned"