-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify JsThemis packaging and test launch #618
Changes from 3 commits
a94725c
9ffa7ce
d534906
7d588f8
516de7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -563,34 +563,6 @@ endif | |
|
||
uninstall: rbthemis_uninstall | ||
|
||
## Node.js ##################### | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now we can't install jsthemis from root folder? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, to be honest, With these changes I also don't really like the fact that we have to pollute the source tree with node_modules (the source may be mounted as read-only, with only build directory being writable), but I guess there is no way around that in JavsScript land. I figured that maybe limiting it to the wrapper source directory will be better (as it allows to special mocha's version in one place), but that brings other set of issues: the tests currently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I don't know ways how to install js package from sources to some app folder. Only by manual copying required folder or installing by tarball from app's folder. In common way all devsinstall dependencies from registry and package.json. So if someone wants to install it from sources, it is his responsibility to do it correct. Simplest way is to install it globally to system or at some place of a hierarchy of dev environment (https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders). So user should change folder to any folder in such hierarchy and copy here built jsthemis to use it in own app. One moment where we can simplify installing is to use user's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Now I've add a |
||
|
||
JSTHEMIS_PACKAGE_VERSION=$(shell cat src/wrappers/themis/jsthemis/package.json \ | ||
| grep version \ | ||
| head -1 \ | ||
| awk -F: '{ print $$2 }' \ | ||
| sed 's/[",]//g' \ | ||
| tr -d '[[:space:]]') | ||
|
||
jsthemis_install: CMD = cd src/wrappers/themis/jsthemis && npm pack && mv jsthemis-$(JSTHEMIS_PACKAGE_VERSION).tgz ../../../../build && cd - && npm install nan && npm install ./build/jsthemis-$(JSTHEMIS_PACKAGE_VERSION).tgz | ||
jsthemis_install: | ||
ifdef NPM_VERSION | ||
@echo -n "jsthemis install " | ||
@$(BUILD_CMD_) | ||
else | ||
@echo "Error: npm not found" | ||
@exit 1 | ||
endif | ||
|
||
jsthemis_uninstall: CMD = rm -rf build/jsthemis-$(JSTHEMIS_PACKAGE_VERSION).tgz && npm uninstall jsthemis | ||
jsthemis_uninstall: | ||
ifdef NPM_VERSION | ||
@echo -n "jsthemis uninstall " | ||
@$(BUILD_CMD_) | ||
endif | ||
|
||
uninstall: jsthemis_uninstall | ||
|
||
## Python ###################### | ||
|
||
ifdef PIP_VERSION | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Themis build system | ||
jsthemis.mk | ||
|
||
# Results of local "npm pack" | ||
*.tgz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we call something like
make jsthemis_uninstall
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal was to avoid doing that specifically, but it does not seem to be working. So my current plan is to revert the last commit which messes with jsthemis_install usage during tests, as soon as I figure out the way to install dev dependencies of JsThemis into node_modules in the source tree root along with JsThemis itself. Then call
jsthemis_install
to clear our compiled code before switching to a different Node.js.