Ver código fonte

add basic Makefile, remove need for global grunt-cli

Dan Cech 10 anos atrás
pai
commit
2244224b12
4 arquivos alterados com 20 adições e 4 exclusões
  1. 17 0
      Makefile
  2. 1 3
      README.md
  3. 1 1
      build.go
  4. 1 0
      package.json

+ 17 - 0
Makefile

@@ -0,0 +1,17 @@
+all: deps build
+
+deps:
+	go run build.go setup
+	godep restore
+	npm install
+
+build:
+	go run build.go build
+	npm run build
+
+test:
+	godep go test -v ./pkg/...
+	npm run test
+
+run:
+	./bin/grafana-server

+ 1 - 3
README.md

@@ -103,8 +103,7 @@ npm (v2.5.0) and grunt (v0.4.5). Run the following:
 
 
 ```bash
 ```bash
 npm install
 npm install
-npm install -g grunt-cli
-grunt
+npm run build
 ```
 ```
 
 
 ### Recompile backend on source change
 ### Recompile backend on source change
@@ -145,4 +144,3 @@ please [sign the CLA](http://docs.grafana.org/project/cla/)
 
 
 Grafana is distributed under Apache 2.0 License.
 Grafana is distributed under Apache 2.0 License.
 Work in progress Grafana 2.0 (with included Grafana backend)
 Work in progress Grafana 2.0 (with included Grafana backend)
-

+ 1 - 1
build.go

@@ -306,7 +306,7 @@ func ChangeWorkingDir(dir string) {
 }
 }
 
 
 func grunt(params ...string) {
 func grunt(params ...string) {
-	runPrint("./node_modules/grunt-cli/bin/grunt", params...)
+	runPrint("./node_modules/.bin/grunt", params...)
 }
 }
 
 
 func setup() {
 func setup() {

+ 1 - 0
package.json

@@ -62,6 +62,7 @@
     "npm": "2.14.x"
     "npm": "2.14.x"
   },
   },
   "scripts": {
   "scripts": {
+    "build": "grunt",
     "test": "grunt test",
     "test": "grunt test",
     "coveralls": "grunt karma:coveralls && rm -rf ./coverage"
     "coveralls": "grunt karma:coveralls && rm -rf ./coverage"
   },
   },