Remove Makefile.win and add build instructions for Windows based on NPM
scripts.
This commit is contained in:
JC Brand 2019-05-15 13:03:13 +02:00
parent 31213aa113
commit 85fc91d7a1
5 changed files with 13 additions and 91 deletions

View File

@ -110,7 +110,7 @@ $(LERNA):
npm install lerna
stamp-npm: $(LERNA) package.json package-lock.json src/headless/package.json
$(LERNA) bootstrap --hoist
npm run lerna
touch stamp-npm
.PHONY: clean

View File

@ -1,71 +0,0 @@
# You can set these variables from the command line.
GRUNT ?= node_modules\.bin\grunt.cmd
BOWER ?= node_modules\.bin\bower.cmd
PHANTOMJS ?= node_modules\.bin\phantomjs.cmd
RJS ?= ./node_modules/.bin/r.js.cmd
SASS ?= sass
RMRF ?= rmdir /q /s
RMF ?= del /q
HTTPSERVE ?= ./node_modules/.bin/http-server.cmd
.PHONY: all help clean css minjs build
all: dev
help:
@echo "Please use \`make <target>' where <target> is one of the following"
@echo " dev to set up the development environment"
@echo " build create minified builds containing converse.js and all its dependencies"
@echo " serve to serve this directory via a webserver on port 8000"
########################################################################
## Miscellaneous
serve:
$(HTTPSERVE) -p 8000
########################################################################
## Install dependencies
stamp-npm: package.json
npm install
$(GRUNT) touch:npm
stamp-bower: stamp-npm bower.json
$(BOWER) install
$(GRUNT) touch:bower
clean::
@if EXIST stamp-npm $(RMF) stamp-npm
@if EXIST stamp-bower $(RMF) stamp-bower
@if EXIST node_modules\. $(RMRF) node_modules
@if EXIST components\. $(RMRF) components
dev: clean
npm install
$(BOWER) update
bundler install --path=.
########################################################################
## Builds
css::
$(SASS) sass/converse.scss > css/converse.css
.PHONY: build
build:: stamp-npm
$(GRUNT) jst
$(GRUNT) cssmin
$(RJS) -o src/build.js
$(RJS) -o src/build.js optimize=none out=dist/converse.js
$(RJS) -o src/build-no-jquery.js
$(RJS) -o src/build-no-jquery.js optimize=none out=dist/converse.nojquery.js
$(RJS) -o src/build-no-dependencies.js
$(RJS) -o src/build-no-dependencies.js optimize=none out=dist/converse-no-dependencies.js
########################################################################
## Tests
check:: stamp-npm
$(PHANTOMJS) node_modules/phantom-jasmine/lib/run_jasmine_test.coffee tests.html

View File

@ -50,6 +50,11 @@ To only generate the minified files, you can make them individually. ::
make dist/converse.min.js
make css/converse.min.css
.. note::
If you're on Windows or don't have GNU Make installed, you can run ``npm build``
to build all the distribution files.
Creating custom bundles
=======================

View File

@ -9,14 +9,6 @@ Dependencies
Installing the 3rd party dependencies
=====================================
.. note::
Windows environment: We recommend installing the required tools using `Chocolatey <https://chocolatey.org/>`_
You will need Node.js (nodejs.install), Git (git.install) and optionally to build using Makefile, GNU Make (make)
If you have trouble setting up a development environment on Windows,
please read `this post <http://librelist.com/browser//conversejs/2014/11/5/openfire-converse-and-visual-studio-questions/#b28387e7f8f126693b11598a8acbe810>`_
in the mailing list.:
We use development tools which depend on Node.js and npm (the Node package manager).
If you don't have Node.js installed, you can download and install the latest
@ -41,19 +33,14 @@ development environment.
cd converse.js
make dev
On Windows you need to specify Makefile.win to be used by running:
If you're using Windows, or don't have GNU Make installed, you can run the
following:
::
make -f Makefile.win dev
Alternatively, if you don't have GNU Make (necessary for the ``make`` command),
you can use NPM directly:
::
npm install
cd converse.js
npm install
npm run lerna
This will install the Node.js development tools and Converse's dependencies.

View File

@ -22,7 +22,8 @@
"converse-headless.min.js": "npm run converse-headless.js && webpack --mode=production --type=headless",
"clean": "rm -rf node_modules stamp-npm dist *.zip",
"build": "npm run converse.min.css && npm run converse-headless.min.js && npm run converse.min.js",
"prepare": "lerna bootstrap --hoist --ignore-scripts && npm run build"
"lerna": "lerna bootstrap --hoist --ignore-scripts",
"prepare": "npm run lerna && npm run build"
},
"repository": {
"type": "git",