Skip to content
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

grunt => make #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions Gruntfile.js

This file was deleted.

53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
NAME := $(shell node -e "console.log(require('./package').name)")
VERSION := $(shell node -e "console.log(require('./package').version)")
ELECTRON_VERSION := 0.30.1

#
# Binaries.
#

BIN := node_modules/.bin
ELECTRON := $(BIN)/electron
BROWSERIFY := $(BIN)/browserify
PACKAGER := $(BIN)/electron-packager

#
# Files.
#

SRC := $(shell find lib -type f -name '*.js')
SCRIPT := build/script.js
ENTRY := lib/app.js

#
# Tasks.
#

start: clean build
@$(ELECTRON) .

pack: clean build
@$(PACKAGER) . $(NAME) \
--platform=darwin \
--arch=x64 \
--version=$(ELECTRON_VERSION) \
--out build

build: $(SCRIPT)

clean:
@rm -rf build

#
# Targets.
#

$(SCRIPT): $(SRC)
@-mkdir -p $(@D)
@$(BROWSERIFY) $(ENTRY) \
--ignore-missing \
-t strictify \
-t babelify \
--outfile $@

.PHONY: build test
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Plasmon</title>
<script src="script.js"></script>
<script src="build/script.js"></script>
<style>
body {
margin: 0;
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"description": "PCMan BBS Client on Electron",
"main": "main.js",
"scripts": {
"start": "electron .",
"pack": "make pack",
"start": "make start",
"build": "make build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -23,12 +25,10 @@
"iconv-lite": "~0.4.11"
},
"devDependencies": {
"babelify": "^6.1.3",
"browserify": "^11.0.0",
"electron-packager": "^5.0.1",
"electron-prebuilt": "^0.30.1",
"grunt": "~0.4.5",
"grunt-browserify": "~3.8.0",
"grunt-contrib-copy": "~0.8.0",
"grunt-electron": "~2.0.0",
"load-grunt-tasks": "~3.2.0",
"strictify": "~0.2.0"
}
}