From 2b78fd375c1933a943d02ddf1c1ceafffde02977 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 30 Jan 2022 00:27:07 +0300 Subject: [PATCH] cleaned out legacy build stuff + tweaked splashscreen closing... Signed-off-by: Alex A. Naanou --- Viewer/Makefile | 78 ++----------------------------------------------- Viewer/e.js | 6 +++- 2 files changed, 8 insertions(+), 76 deletions(-) diff --git a/Viewer/Makefile b/Viewer/Makefile index ef8ba63d..6fc4ca14 100755 --- a/Viewer/Makefile +++ b/Viewer/Makefile @@ -112,7 +112,6 @@ # - ... # - cross-compiling support (???) # - cross-package with pre-built libs... -# - nwjs??? # # # Links: @@ -187,14 +186,6 @@ ELECTRON_DOWNOAD_URL ?= https://github.com/electron/electron/releases/download/$ ELECTRON_DIST ?= electron-$(ELECTRON_VERSION)-$(TARGET_OS)-$(ARCH).zip -# NW... -# -# XXX get the version dynamically... (???) -NW_VERSION ?= v0.28.0 -NW_DIST ?= nwjs-sdk-$(NW_VERSION)-$(NW_OS)-$(ARCH).zip -NW_DOWNOAD_URL ?= https://dl.nwjs.io/$(NW_VERSION) - - BUILD_MODE ?= in-place @@ -294,6 +285,9 @@ PROJECT_FILES = package.json # replace .less with .css making them build targets... CSS_FILES := $(patsubst %.less,%.css,$(wildcard css/*.less)) HTML_FILES := $(wildcard *.html) +# NOTE: these must be explicitly included in all other categories as they +# will not be matched by wildcard if they are not generated yet +# resulting in them not being copied to the build... GENERATED_JS_FILES := version.js ROOT_JS_FILES := $(wildcard *.js) version.js # NOTE: this is only used for make change/dependency tracking checking... @@ -552,28 +546,6 @@ electron-run: dev -##-------------------------------------------------------------- NW --- - -# XXX do we actually need this??? -# XXX this clashes with the electron build as the recepies do not take the -# host framework into account... -#.PHONY: nw-dist -#nw-dist: VERSION := $(VERSION)-nw -#nw-dist: DIST := $(DIST_DIR)/$(APP_NAME)-$(VERSION)-$(TARGET_OS)-$(ARCH).zip -#nw-dist: $$(DIST) - - -# XXX - - -# XXX needs a different package.json or a way to share it with electron... -.PHONY: nw-run -nw-run: ## Run app in nw (outdated) -nw-run: dev - nw . - - - ##----------------------------------------------- Windows installer --- # XXX @@ -614,7 +586,6 @@ PACK_FULL = $(BUILD_DIR)/$(APP_NAME)/ $(BUILD_DIR)/$(APP_NAME)/$(NODE_DIR) # build date... # NOTE: this depends on lots of stuff so as to be updated in case any of # the dependencies are touched... -# XXX add nw version option... $(BUILD_INFO): $(CSS_FILES) $(NODE_DIR) $(PROJECT_FILES) \ $(JS_FILES) $(CSS_FILES) $(HTML_FILES) $(MD) "$(@D)" @@ -822,49 +793,6 @@ $(DIST_DIR)/$(APP_NAME)-%.zip: $(BUILD_DIR)/$(APP_NAME)-%.$(BUILD_MODE).zip -#---------------------------------------------------------------------- -# NW.js... - -.PHONY: nw-target -nw-target: $(TARGET_DIR)/$(NW_DIST) - -.PRECIOUS: $(TARGET_DIR)/$(NW_DIST) -$(TARGET_DIR)/$(NW_DIST): - $(MD) "$(@D)" - wget \ - -nc "$(NW_DOWNOAD_URL)/$(@F)" \ - -O "$@" - - -# NOTE: this needs a clean app dir... -# XXX BUG: can't find modules in unpacked node_modules... -.PRECIOUS: $(BUILD_DIR)/package.nw -$(BUILD_DIR)/package.nw: INCLUDE_NODE_MODULES += $(INCLUDE_NW_NODE_MODULES) -$(BUILD_DIR)/package.nw: PACK_MINIMAL = $(BUILD_DIR)/$(APP_NAME)/ \ - $(call includeNodeModules,$(INCLUDE_NODE_MODULES)) -$(BUILD_DIR)/package.nw: $$(PACK_MINIMAL) - # update package.json to start nw... - cd "$<" ; \ - sed -i 's/"e.js"/"index.html"/g' package.json - $(call zipFrom,$<,$@,*) - - -# XXX how do we resolve name collisions between this and electron builds??? -# a) naming convention: specific build directory suffixes... -# b) generic components mixed and matched (node_modules, ImageGrid.Viewer, ...) -# Q: will this actually save us any time/space, considering -# we'll need to copy the files anyway??? -# - it would be nice to have reusable components that -# would be used as-is to build different builds -# - this will lead to added complexity for instance -# in zipping... -# c) both... -# XXX things to do next: -# - copy rest of node_modules... (???) -# - pack... - - - #---------------------------------------------------------------------- # cli... # XXX diff --git a/Viewer/e.js b/Viewer/e.js index 48cdc180..7261984c 100644 --- a/Viewer/e.js +++ b/Viewer/e.js @@ -240,7 +240,11 @@ ipcMain.on('exitFullScreen', ipcMain.on('openSplashScreen', function(){ SPLASH || createSplash() }) ipcMain.on('closeSplashScreen', - function(){ SPLASH && SPLASH.destroy() }) + function(){ + // force this to run after this frame avoiding races... + setTimeout( + function(){ SPLASH && SPLASH.destroy() }, + 10) }) // DevTools... // XXX need to focus devtools here...