Procházet zdrojové kódy

Fixes #641.

Remove Makefile.win and add build instructions for Windows based on NPM
scripts.
JC Brand před 6 roky
rodič
revize
85fc91d7a1
5 změnil soubory, kde provedl 13 přidání a 91 odebrání
  1. 1 1
      Makefile
  2. 0 71
      Makefile.win
  3. 5 0
      docs/source/builds.rst
  4. 5 18
      docs/source/dependencies.rst
  5. 2 1
      package.json

+ 1 - 1
Makefile

@@ -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

+ 0 - 71
Makefile.win

@@ -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
-

+ 5 - 0
docs/source/builds.rst

@@ -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
 =======================

+ 5 - 18
docs/source/dependencies.rst

@@ -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:
-
-::
-
-    make -f Makefile.win dev
-
-Alternatively, if you don't have GNU Make (necessary for the ``make`` command),
-you can use NPM directly:
+If you're using Windows, or don't have GNU Make installed, you can run the
+following:
 
 ::
 
-    npm install
-
+  cd converse.js
+  npm install
+  npm run lerna
 
 This will install the Node.js development tools and Converse's dependencies.
 

+ 2 - 1
package.json

@@ -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",