Skip to content

Commit

Permalink
make build system inject JBrowse version into Browser.js for use by a…
Browse files Browse the repository at this point in the history
…nalytics
  • Loading branch information
rbuels committed Aug 2, 2012
1 parent 57b5e91 commit 10e2140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/Makefile
Expand Up @@ -24,6 +24,9 @@ release-normal: superclean $(JS_SRCFILES)
-cp -r * $(RELEASE_FULL_DIR);
rm -rf $(RELEASE_FULL_DIR)/src/*/.git $(RELEASE_FULL_DIR)/$(RELEASE_FULL) $(RELEASE_FULL_DIR)/src/util $(RELEASE_FULL_DIR)/build;

# version-stamp Browser.js
perl -i -pE 's!(?<=BUILD_SYSTEM_JBROWSE_VERSION);! = "$(RELEASE_VERSION)";!' $(JSDIR)/Browser.js;

( cd $(BASEDIR)/src/util/buildscripts && node ../../dojo/dojo.js load=build --require "$(BASEDIR)/build/init.js" --profile "$(JSDIR)/JBrowse.profile.js" --releaseDir "$(RELEASE_FULL_DIR)/src"; )
for HTMLFILE in index compat_121; do \
perl -pe "s/(?<=data-dojo-config=\")[^\"]+\"/deps: ['JBrowse'], async: 1\"/;" $$HTMLFILE.html > "$(RELEASE_FULL_DIR)/$$HTMLFILE.html"; \
Expand All @@ -33,6 +36,7 @@ release-normal: superclean $(JS_SRCFILES)
perl -MDateTime -i -pE 'BEGIN{ $$datestring = DateTime->from_epoch( epoch => time(), time_zone => DateTime::TimeZone->new(name => "local"))->format_cldr(q|yyyy-MM-dd HH:mm:ss VVVV|)}; s/\{\{\$$NEXT\}\}\s*/$(RELEASE_VERSION) $$datestring\n/m' $(RELEASE_FULL_DIR)/release-notes.txt
cp $(RELEASE_FULL_DIR)/release-notes.txt .;
perl -i -pE 'say "{{\$$NEXT}}\n" unless $$x++' release-notes.txt;

$(ZIP) $(RELEASE_FULL).zip $(RELEASE_FULL)/;

release-normal-test: release-normal
Expand Down
5 changes: 5 additions & 0 deletions src/JBrowse/Browser.js
Expand Up @@ -74,6 +74,11 @@ var Browser = function(params) {
dojo.connect( this, 'onRefSeqsLoaded', Util.debugHandler( this, 'reportUsageStats' ));
};

Browser.prototype.version = function() {
var BUILD_SYSTEM_JBROWSE_VERSION;
return BUILD_SYSTEM_JBROWSE_VERSION || 'development';
}.call();

/**
* Displays links to configuration help in the main window. Called
* when the main browser cannot run at all, due to configuration
Expand Down

0 comments on commit 10e2140

Please sign in to comment.