Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Build script
  • Loading branch information
fisharebest committed Feb 20, 2016
1 parent 2e5db07 commit a639f0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Makefile
Expand Up @@ -12,7 +12,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

BUILD_DIR=build
BUILD_NUMBER=$(shell git log --oneline | wc -l)
BUILD_NUMBER=$(shell git log --oneline | wc -l | tr -d ' ')
BUILD_VERSION=$(if $(WT_RELEASE),$(BUILD_NUMBER),$(WT_VERSION)$(WT_RELEASE))
GIT_BRANCH=$(shell git symbolic-ref -q HEAD || git describe --tags --exact-match)
LANGUAGE_DIR=language
Expand All @@ -27,7 +27,6 @@ WT_RELEASE=$(shell grep "'WT_VERSION'" includes/session.php | cut -d "'" -f 4 |
CLOSURE_JS=$(BUILD_DIR)/compiler-20140407.jar
CLOSURE_CSS=$(BUILD_DIR)/closure-stylesheets-20111230.jar
YUI_COMPRESSOR=$(BUILD_DIR)/yuicompressor-2.4.8.jar
HTML_COMPRESSION=$(BUILD_DIR)/htmlcompressor-1.5.3.jar

# Files to minify
CSS_FILES=$(shell find $(BUILD_DIR) -name "*.css")
Expand Down Expand Up @@ -66,7 +65,7 @@ build/webtrees: clean update
# Extract from the repository, to filter files using .gitattributes
git archive --prefix=$@/ $(GIT_BRANCH) | tar -x
# Embed the build number in the code (for DEV builds only)
sed --in-place=.bak -e "s/define('WT_RELEASE', '$(WT_VERSION)-dev')/define('WT_RELEASE', '$(WT_VERSION)-dev+$(BUILD_NUMBER)')/" $@/includes/session.php
sed -i -e "s/define('WT_RELEASE', '$(WT_VERSION)-dev')/define('WT_RELEASE', '$(WT_VERSION)-dev+$(BUILD_NUMBER)')/" $@/includes/session.php
# Add language files
cp -R $(LANGUAGE_DIR)/*.mo $@/$(LANGUAGE_DIR)/
# Minification
Expand Down Expand Up @@ -95,7 +94,7 @@ clean:
language/webtrees.pot: $(LANGUAGE_SRC)
# Modify the .XML report files so that xgettext can scan them
find modules*/ -name "*.xml" -exec cp -p {} {}.bak \;
sed --in-place=.bak -e 's~\(I18N::[^)]*[)]\)~<?php echo \1; ?>~g' modules*/*/*.xml
sed -i -e 's~\(I18N::[^)]*[)]\)~<?php echo \1; ?>~g' modules*/*/*.xml
echo $^ | xargs xgettext --package-name=webtrees --package-version=1.0 --msgid-bugs-address=i18n@webtrees.net --output=$@ --no-wrap --language=PHP --add-comments=I18N --from-code=utf-8 --keyword --keyword=translate:1 --keyword=translateContext:1c,2 --keyword=plural:1,2 --keyword=noop:1
# Restore the .XML files
find modules*/ -name "*.xml" -exec mv {}.bak {} \;
Expand Down
Binary file removed build/htmlcompressor-1.5.3.jar
Binary file not shown.

0 comments on commit a639f0a

Please sign in to comment.