<commit_before>#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Makefile: basic Makefile for template API service
#
# This Makefile is a template for new repos. It contains only repo-specific
# logic and uses included makefiles to supply common targets (javascriptlint,
# jsstyle, restdown, etc.), which are used by other repos as well. You may well
# need to rewrite most of this file, but you shouldn't need to touch the
# included makefiles.
#
# If you find yourself adding support for new targets that could be useful for
# other projects too, you should add these to the original versions of the
# included Makefiles (in eng.git) so that other teams can use them too.
#

#
# Tools
#
MOCHA_PHANTOMJS	:= ./node_modules/.bin/mocha-phantomjs

#
# Files
#
DOC_FILES	 = index.restdown
JS_FILES	:= $(shell ls *.js) $(shell find lib test -name '*.js')
JSL_CONF_NODE	 = tools/jsl.node.conf
JSL_FILES_NODE   = $(JS_FILES)
JSSTYLE_FILES	 = $(JS_FILES)
JSSTYLE_FLAGS    = -o indent=2,doxygen,unparenthesized-return=0
REPO_MODULES	 =
SMF_MANIFESTS_IN = smf/manifests/adminui.xml.in

NODE_PREBUILT_VERSION=v0.8.23
NODE_PREBUILT_TAG=zone



include ./tools/mk/Makefile.defs
ifeq ($(shell uname -s),SunOS)
	include ./tools/mk/Makefile.node_prebuilt.defs
else
	include ./tools/mk/Makefile.node.defs
endif
include ./tools/mk/Makefile.smf.defs

ROOT            := $(shell pwd)
RELEASE_TARBALL := adminui-pkg-$(STAMP).tar.bz2
RELSTAGEDIR          := /tmp/$(STAMP)


#
# Repo-specific targets
#

JS_BUNDLE = ./public/app.js
JS_BUNDLE_FILES	:= $(shell find public/js -name '*.js' -o -name '*.hbs')
JS_BUNDLE_FILES	+= ./tools/build-js


.PHONY: all
all: $(SMF_MANIFESTS) node_modules js sdc-scripts

.PHONY: node_modules
node_modules: | $(NPM_EXEC)
	$(NPM) install --production

CLEAN_FILES += ./node_modules $(JS_BUNDLE)

.PHONY: js
js: $(JS_BUNDLE)

$(JS_BUNDLE): $(JS_BUNDLE_FILES) | $(NODE_EXEC)
	@echo "Building js bundle"
	$(NODE) tools/build-js

$(MOCHA_PHANTOMJS): | $(JS_BUNDLE_FILES) | $(NODE_EXEC)
	$(NPM) install

.PHONY: dev
dev: $(JS_BUNDLE) $(MOCHA_PHANTOMJS)


.PHONY: devrun
devrun:
	@./tools/devrun.sh

.PHONY: test
test: | $(JS_BUNDLE) $(MOCHA_PHANTOMJS)
	$(MOCHA_PHANTOMJS) ./public/test/index.html


.PHONY: release
release: all deps docs $(SMF_MANIFESTS)
	@echo "Building $(RELEASE_TARBALL)"
	@mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/adminui
	@mkdir -p $(RELSTAGEDIR)/site
	@touch $(RELSTAGEDIR)/site/.do-not-delete-me
	cp -r $(ROOT)/* $(RELSTAGEDIR)/root/opt/smartdc/adminui/
	mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/boot<commit_msg>ADMINUI-1550: adminui is packaging up its deps/ dir, which is huge<commit_after>#
# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# Makefile: basic Makefile for template API service
#
# This Makefile is a template for new repos. It contains only repo-specific
# logic and uses included makefiles to supply common targets (javascriptlint,
# jsstyle, restdown, etc.), which are used by other repos as well. You may well
# need to rewrite most of this file, but you shouldn't need to touch the
# included makefiles.
#
# If you find yourself adding support for new targets that could be useful for
# other projects too, you should add these to the original versions of the
# included Makefiles (in eng.git) so that other teams can use them too.
#

#
# Tools
#
MOCHA_PHANTOMJS	:= ./node_modules/.bin/mocha-phantomjs

#
# Files
#
DOC_FILES	 = index.restdown
JS_FILES	:= $(shell ls *.js) $(shell find lib test -name '*.js')
JSL_CONF_NODE	 = tools/jsl.node.conf
JSL_FILES_NODE   = $(JS_FILES)
JSSTYLE_FILES	 = $(JS_FILES)
JSSTYLE_FLAGS    = -o indent=2,doxygen,unparenthesized-return=0
REPO_MODULES	 =
SMF_MANIFESTS_IN = smf/manifests/adminui.xml.in

NODE_PREBUILT_VERSION=v0.8.23
NODE_PREBUILT_TAG=zone



include ./tools/mk/Makefile.defs
ifeq ($(shell uname -s),SunOS)
	include ./tools/mk/Makefile.node_prebuilt.defs
else
	include ./tools/mk/Makefile.node.defs
endif
include ./tools/mk/Makefile.smf.defs

ROOT            := $(shell pwd)
RELEASE_TARBALL := adminui-pkg-$(STAMP).tar.bz2
RELSTAGEDIR          := /tmp/$(STAMP)


#
# Repo-specific targets
#

JS_BUNDLE = ./public/app.js
JS_BUNDLE_FILES	:= $(shell find public/js -name '*.js' -o -name '*.hbs')
JS_BUNDLE_FILES	+= ./tools/build-js


.PHONY: all
all: $(SMF_MANIFESTS) node_modules js sdc-scripts

.PHONY: node_modules
node_modules: | $(NPM_EXEC)
	$(NPM) install --production

CLEAN_FILES += ./node_modules $(JS_BUNDLE)

.PHONY: js
js: $(JS_BUNDLE)

$(JS_BUNDLE): $(JS_BUNDLE_FILES) | $(NODE_EXEC)
	@echo "Building js bundle"
	$(NODE) tools/build-js

$(MOCHA_PHANTOMJS): | $(JS_BUNDLE_FILES) | $(NODE_EXEC)
	$(NPM) install

.PHONY: dev
dev: $(JS_BUNDLE) $(MOCHA_PHANTOMJS)


.PHONY: devrun
devrun:
	@./tools/devrun.sh

.PHONY: test
test: | $(JS_BUNDLE) $(MOCHA_PHANTOMJS)
	$(MOCHA_PHANTOMJS) ./public/test/index.html


.PHONY: release
release: all deps docs $(SMF_MANIFESTS)
	@echo "Building $(RELEASE_TARBALL)"
	@mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/adminui
	@mkdir -p $(RELSTAGEDIR)/site
	@touch $(RELSTAGEDIR)/site/.do-not-delete-me
	cp -r $(ROOT)/* $(RELSTAGEDIR)/root/opt/smartdc/adminui/
	rm -rf $(RELSTAGEDIR)/root/opt/smartdc/adminui/deps
	mkdir -p $(RELSTAGEDIR)/root/opt/smartdc/boot
{'fraction_non_alphanumeric': 0.13526477359938605, 'fraction_numerical': 0.0049884881043745204, 'mean_word_length': 4.29238578680203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '839488', 'n_tokens_mistral': 2115, 'n_tokens_neox': 2032, 'n_words': 510}