Permalink
Browse files

Added binary and Makefile, updated README with build instructions and…

… related projects.
  • Loading branch information...
1 parent 13b9829 commit 394bb0c26b7edbe8d6c5222365591276c5faff83 @mde mde committed Jul 3, 2010
Showing with 84 additions and 8 deletions.
  1. +33 −0 Makefile
  2. +25 −1 README.markdown
  3. +21 −0 bin/jake
  4. +5 −7 lib/jake.js
View
33 Makefile
@@ -0,0 +1,33 @@
+#
+# Node-Jake JavaScript build tool
+# Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+.PHONY: all build install clean uninstall
+
+all: build
+
+build:
+ @echo 'Node-Jake built.'
+
+install:
+ @mkdir -p ~/.node_libraries/node-jake; cp ./lib/jake.js ~/.node_libraries/node-jake/jake.js; cp ./bin/jake /usr/local/bin; chmod 755 /usr/local/bin/jake; echo 'Node-Jake installed.'
+
+clean:
+ @true
+
+uninstall:
+ @rm -fr ~/.node_libraries/node-jake; rm -f /usr/local/bin/jake; echo 'Node-Jake uninstalled.'
+
View
26 README.markdown
@@ -1,4 +1,16 @@
-### Jake -- JavaScript Make
+### Node-Jake -- JavaScript build tool for Node.js
+
+### Installing
+
+Prerequisites: Node-Jake requires Node.js. (http://nodejs.org/)
+
+Get Node-Jake:
+
+ git clone git://github.com/mde/node-jake.git
+
+Build Node-Jake:
+
+ cd node-jake && make && sudo make install
### Basic usage
@@ -82,4 +94,16 @@ In this example, the foo:baz task depends on both the default and the foo:bar ta
Running `jake` with no arguments runs the default task.
+### Related projects
+
+James Coglan's "Jake": http://github.com/jcoglan/jake
+
+Confusingly, this is a Ruby tool for building JavaScript packages from source code.
+
+280 North's Jake: http://github.com/280north/jake
+
+This is also a JavaScript port of Rake, which runs on the Narwhal platform.
+
+
+
View
21 bin/jake
@@ -0,0 +1,21 @@
+#
+# Node-Jake JavaScript build tool
+# Copyright 2112 Matthew Eernisse (mde@fleegix.org)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#!/bin/bash
+
+node ~/.node_libraries/node-jake/jake.js `pwd` $@
+
View
12 lib/jake.js
@@ -1,5 +1,5 @@
/*
- * Jake JavaScript build tool
+ * Node-Jake JavaScript build tool
* Copyright 2112 Matthew Eernisse (mde@fleegix.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,7 @@
*/
var JAKE_VERSION = '0.1.0';
-var args = process.argv.slice(2);
+var args = process.argv.slice(3);
var sys = require('sys');
var parseopts = new function () {
@@ -84,10 +84,11 @@ var opts = parsed.opts;
var cmds = parsed.cmds;
var taskName = cmds.shift();
var jakefile;
+var dirname = opts.directory || process.argv[2];
taskName = taskName || 'default';
jakefile = opts.jakefile ?
- opts.jakefile.replace(/\.js$/, '') : './Jakefile';
+ opts.jakefile.replace(/\.js$/, '') : dirname + '/Jakefile';
var jake = new function () {
this.currentNamespace = 'default';
@@ -203,13 +204,10 @@ if (typeof opts.version != 'undefined') {
var tasks = require(jakefile);
-
if (typeof opts.tasks != 'undefined') {
jake.showAllTaskDescriptions();
}
else {
- if (opts.directory) {
- process.chdir(opts.directory);
- }
+ process.chdir(dirname);
jake.runTask(taskName, cmds);
}

0 comments on commit 394bb0c

Please sign in to comment.