Permalink
Browse files

Make process improvements.

- Fixed issue #33 by adding a configuration file for the Makefile. Invoke make
config.
- Added config-default.mk. Invoking make config adds config-local.mk which
overwrites any variables from the default config.
- Updated the INSTALL file to include instructions on how to build PaintWeb.
- Made it easier to build PaintWeb by having only a single file to edit paths:
the config-local.mk file. Until now you had to edit files in the scripts/
folder.
- Removed the make moodle target.
- Added the make moodle19 and moodle20 targets, as requested by the Moodle
developers. The Moodle 2.0 package does not include 1.9-only scripts and
vice-versa.
- Updated the README.

--HG--
extra : convert_revision : svn%3Afc1ba2b4-ac28-11dd-a772-7fcde58d38e6/trunk%40142
  • Loading branch information...
1 parent 3c3cf87 commit aa680afb978f192bc11c9b25f2e9fc50c3d8db01 mihai.sucan committed Oct 10, 2009
Showing with 278 additions and 108 deletions.
  1. +17 −0 CHANGES
  2. +87 −3 INSTALL
  3. +22 −56 Makefile
  4. +40 −28 README
  5. +81 −0 config-default.mk
  6. +18 −11 scripts/jsdoc
  7. +13 −10 scripts/yuicompressor
View
17 CHANGES
@@ -1,3 +1,20 @@
+2009-10-10:
+===========
+
+- Fixed issue #33 by adding a configuration file for the Makefile. Invoke make
+config.
+- Added config-default.mk. Invoking make config adds config-local.mk which
+overwrites any variables from the default config.
+- Updated the INSTALL file to include instructions on how to build PaintWeb.
+- Made it easier to build PaintWeb by having only a single file to edit paths:
+the config-local.mk file. Until now you had to edit files in the scripts/
+folder.
+- Removed the make moodle target.
+- Added the make moodle19 and moodle20 targets, as requested by the Moodle
+developers. The Moodle 2.0 package does not include 1.9-only scripts and
+vice-versa.
+- Updated the README.
+
2009-10-07:
===========
View
90 INSTALL
@@ -1,14 +1,98 @@
-Copyright (C) 2008 Mihai Şucan
+Copyright (C) 2008, 2009 Mihai Şucan
$URL: http://code.google.com/p/paintweb $
-$Date: 2009-07-06 20:29:16 +0300 $
+$Date: 2009-10-10 20:33:25 +0300 $
You don't need to install this Web application. Just open a demo from the demos
folder in your Web browser. For documentation please check the API reference and
the wiki pages published at http://code.google.com/p/paintweb.
+Repackaging PaintWeb
+====================
+
+Important folders:
+
+ - src/ - holds the source code spread across multiple files.
+ - build/ - holds the packaged build.
+ - scripts/ - holds scripts used for packaging.
+
+If you make changes to files in the src/ folder you may want to repackage
+PaintWeb - regenerate the build folder.
+
+Prerequisites
+-------------
+
+ - PHP 5+
+
+ - Makefile support. Usually, you get this really easily and quickly on any
+ Linux distribution. Tested with Ubuntu.
+
+ - Java VM.
+
+ - YUI Compressor. This is used for compressing JavaScript and CSS files. Get
+ it from:
+
+ http://developer.yahoo.com/yui/compressor/
+
+ - jsdoc-toolkit. This is used for generating the API reference documentation
+ based on the source code. Get it from:
+
+ http://jsdoctoolkit.org/
+
+Make sure you unpack jsdoc-toolkit and yuicompressor and you have both scripts
+working fine with your Java VM.
+
+Run the following command in your PaintWeb folder:
+ make config
+
+Now you have config-local.mk. Open it and make sure:
+
+ - BIN_PHP points to your PHP binary.
+ - FOLDER_YUIC points to your YUI Compressor unpacked folder.
+ - FOLDER_JSDOCT points to your jsdoc-toolkit unpacked folder.
+
+Now you are ready!
+
+
+Run make
+--------
+
+To generate the build folder run:
+ make
+
+You will have build/paintweb.src.js for debugging purposes.
+
+To generate the API reference documentation run:
+ make docs
+
+To get an archived PaintWeb package as a release simply run:
+ make release
+
+That will give you a file like paintweb-0.9.tar.bz2. The version number is
+determined automatically.
+
+You can also make a snapshot of PaintWeb:
+ make snapshot
+
+Snapshots have the build date included. For example
+paintweb-0.9-20091010.tar.bz2.
+
+If you want to make a custom build of PaintWeb for Moodle 1.9 or Moodle 2.0 then
+run:
+ make moodle19
+ or
+ make moodle20
+
+This will make sure that the Moodle extension for PaintWeb is included in the
+package.
+
+To generate a tags file from the PaintWeb source code run:
+ make tags
+
+That's about all. Enjoy!
+
+
--
vim:set spell spl=en fenc=utf-8 ff=unix:
-
View
78 Makefile
@@ -18,56 +18,10 @@
# along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
#
# $URL: http://code.google.com/p/paintweb $
-# $Date: 2009-08-12 12:52:24 +0300 $
+# $Date: 2009-10-10 20:31:02 +0300 $
-
-#### Config:start #####################################################
-# You can make changes below
-
-# The tools you want to have packaged
-TOOLS=selection hand rectangle ellipse polygon line text bcurve insertimg pencil cpicker eraser
-
-# The extensions you want
-EXTENSIONS=colormixer mousekeys
-
-# The interface you want packaged
-INTERFACE=default
-
-# The PHP binary for running PHP scripts
-BIN_PHP=php
-
-# The JSON encoder script
-BIN_JSON=$(BIN_PHP) scripts/json_encode.php
-
-# The XHTML minifier script
-BIN_XHTML=$(BIN_PHP) scripts/xhtml_minify.php
-
-# The compressor used for CSS files
-BIN_CSS=scripts/yuicompressor
-
-# The CSS images inliner script
-BIN_CSS_IMAGES=$(BIN_PHP) scripts/css_images.php
-
-# The compressor used for JavaScript files
-BIN_JS=scripts/yuicompressor
-
-# The jsdoc script
-BIN_JSDOC=scripts/jsdoc
-
-# Folders
-FOLDER_BUILD=build
-FOLDER_SRC=src
-FOLDER_INCLUDES=includes
-FOLDER_TOOLS=tools
-FOLDER_EXTENSIONS=extensions
-FOLDER_INTERFACES=interfaces
-FOLDER_LANG=lang
-FOLDER_COLORS=colors
-FOLDER_DOCS_API=docs/api-ref
-FOLDER_TINYMCE_PLUGIN=ext/tinymce-plugin/paintweb
-
-# Changes below this line are not recommended
-#### Config:end #######################################################
+include config-default.mk
+-include config-local.mk
# This holds the absolute path to the parent of the current working directory.
# Given /home/robod/src/paintweb this variable will hold /home/robod/src/.
@@ -171,7 +125,7 @@ $(FOLDER_BUILD)/$(FILE_CONFIG): $(FOLDER_SRC)/$(FILE_CONFIG)
$(FOLDER_TINYMCE_PLUGIN)/editor_plugin.js: $(FOLDER_TINYMCE_PLUGIN)/editor_plugin_src.js
$(BIN_JS) $^ > $@
-.PHONY : docs release snapshot package tags moodle
+.PHONY : docs release snapshot package tags moodle moodle20 moodle19 config
docs:
$(BIN_JSDOC) $(FOLDER_SRC) $(FOLDER_DOCS_API)
@@ -183,21 +137,33 @@ snapshot: package
# Create the PaintWeb package.
package:
- tar --exclude=".*" --exclude="*~" --exclude="*bak" --exclude="*bz2" --exclude="tags" \
+ tar --exclude=".*" --exclude="*~" --exclude="*bak" --exclude="*bz2" --exclude="tags" --exclude="config-local.mk" \
-C $(FOLDER_PARENT) -cjvf /tmp/paintweb.tar.bz2 $(FOLDER_SELF)
# Generate the tags file for the project.
tags:
ctags -R $(FOLDER_SRC) --JavaScript-kinds=fcm --fields=afiklmnsSt
-# Generate a custom Moodle build.
-moodle: EXTENSIONS=colormixer moodle
-moodle: all
- tar --exclude=".*" --exclude="*~" --exclude="*bak" --exclude="*bz2" --exclude="tags" \
+# Generate a custom Moodle 1.9 build.
+moodle19: EXTENSIONS=colormixer moodle
+moodle19: all
+ tar --exclude=".*" --exclude="*~" --exclude="*bak" --exclude="*bz2" --exclude="tags" --exclude="config-local.mk" \
+ --exclude="paintweb/docs" --exclude="paintweb/demos" --exclude="paintweb/tests" --exclude="paintweb/scripts" \
+ --exclude="ext/moodle/*20.php" \
+ -C $(FOLDER_PARENT) -cjvf /tmp/paintweb.tar.bz2 $(FOLDER_SELF)
+ mv /tmp/paintweb.tar.bz2 ./paintweb-$(BUILD_VERSION)-$(BUILD_DATE)-moodle19.tar.bz2
+
+# Generate a custom Moodle 2.0 build.
+moodle20: EXTENSIONS=colormixer moodle
+moodle20: all
+ tar --exclude=".*" --exclude="*~" --exclude="*bak" --exclude="*bz2" --exclude="tags" --exclude="config-local.mk" \
--exclude="paintweb/docs" --exclude="paintweb/demos" --exclude="paintweb/tests" --exclude="paintweb/scripts" \
+ --exclude="ext/moodle/*19.php" \
-C $(FOLDER_PARENT) -cjvf /tmp/paintweb.tar.bz2 $(FOLDER_SELF)
- mv /tmp/paintweb.tar.bz2 ./paintweb-$(BUILD_VERSION)-$(BUILD_DATE)-moodle.tar.bz2
+ mv /tmp/paintweb.tar.bz2 ./paintweb-$(BUILD_VERSION)-$(BUILD_DATE)-moodle20.tar.bz2
+config:
+ cp config-default.mk config-local.mk
# vim:set spell spl=en fo=wan1croql tw=80 ts=2 sw=2 sts=0 sta noet ai cin fenc=utf-8 ff=unix:
View
68 README
@@ -1,7 +1,7 @@
Copyright (C) 2008, 2009 Mihai Şucan
$URL: http://code.google.com/p/paintweb $
-$Date: 2009-08-14 12:15:41 +0300 $
+$Date: 2009-10-10 20:37:32 +0300 $
PaintWeb is a Web application which allows users to draw inside the Web browser
making use of new Web technologies.
@@ -12,43 +12,55 @@ PaintWeb build.
Requirements:
-- A Web browser which implements the HTML 5 <canvas> 2D context API.
-Known to work are: Opera 9.5+, Firefox 3+, Safari 3.1+, Konqueror 4.1+.
-Each Web browser has its minor quirks.
+ A Web browser which implements the HTML 5 <canvas> 2D context API.
+ Known to work are: Opera 9.5+, Firefox 3+, Safari 3.1+, Konqueror 4.1+.
+ Each Web browser has its minor quirks.
-Internet Explorer does not support Canvas. This application does not work in
-this Web browser.
+ Internet Explorer does not support Canvas. This application does not work in
+ this Web browser.
-You can use PaintWeb inside Moodle, or you may integrate PaintWeb into your
-project via TinyMCE. The "ext" folder holds a TinyMCE plugin which integrates
-PaintWeb into TinyMCE. Please check the documentation for further details:
+Usage:
-http://code.google.com/p/paintweb
+ You can use PaintWeb inside Moodle, or you may integrate PaintWeb into your
+ project via TinyMCE. The "ext" folder holds a TinyMCE plugin which integrates
+ PaintWeb into TinyMCE. Please check the documentation for further details:
+
+ http://code.google.com/p/paintweb
+
+Installation:
+
+ If you want to learn how to repackage PaintWeb yourself, please see the
+ INSTALL file.
Files and folders in this package:
-build/ - holds the packaged PaintWeb build.
-CHANGES - holds a chronologically ordered list of changes.
-COPYING - the GPLv3 license.
-demos/ - holds usage demos with PaintWeb.
-docs/ - holds project documentation.
-ext/ - holds code for integrating PaintWeb into external projects. For
- example, there's code for Moodle and TinyMCE integration.
-Makefile - the Makefile script which drives the PaintWeb packaging process.
-README - this file
-scripts/ - holds scripts used for PaintWeb packaging.
-src/ - holds the PaintWeb source code.
-tests/ - holds various tests made during the development of PaintWeb.
+ build/ - holds the packaged PaintWeb build.
+ CHANGES - holds a chronologically ordered list of changes.
+ config-default.mk - the default Makefile configuration.
+ COPYING - the GPLv3 license.
+ demos/ - holds usage demos with PaintWeb.
+ docs/ - holds project documentation.
+ ext/ - holds code for integrating PaintWeb into external projects. For
+ example, there's code for Moodle and TinyMCE integration.
+ INSTALL - PaintWeb packaging instructions.
+ Makefile - the Makefile script which drives the PaintWeb packaging process.
+ README - this file
+ scripts/ - holds scripts used for PaintWeb packaging.
+ src/ - holds the PaintWeb source code.
+ tests/ - holds various tests made during the development of PaintWeb.
Get in contact:
-- You can contact me via email at mihai.sucan@gmail.com or via my site
-www.robodesign.ro. Any feedback is always welcome.
-- I am always looking for volunteers to help me with coding - there's lots of
-work to do. We can collaborate via Gtalk, Yahoo, IRC, ICQ and anyhow you like.
-- On IRC I'm online everyday on irc.freenode.net. Just /query ROBOd - my
-nickname.
+ - You can ask questions about the project in the public mailing list of the
+ project. You can post your message by sending an email to
+ paintweb@googlegroups.com.
+ - You can contact me via email at mihai.sucan@gmail.com or via my site
+ www.robodesign.ro/mihai. Any feedback is always welcome.
+ - I am always looking for volunteers to help me with coding - there's lots of
+ work to do. We can collaborate via Gtalk, Yahoo, IRC, ICQ and anyhow you like.
+ - On IRC I'm online everyday on irc.freenode.net. Just /query ROBOd - my
+ nickname.
Thank you!
View
81 config-default.mk
@@ -0,0 +1,81 @@
+# PaintWeb Makefile
+#
+# Copyright (C) 2008, 2009 Mihai Şucan
+#
+# This file is part of PaintWeb.
+#
+# PaintWeb is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# PaintWeb is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
+#
+# $URL: http://code.google.com/p/paintweb $
+# $Date: 2009-10-10 20:04:50 +0300 $
+
+# The tools you want to have packaged
+TOOLS=selection hand rectangle ellipse polygon line text bcurve insertimg pencil cpicker eraser
+
+# The extensions you want.
+EXTENSIONS=colormixer mousekeys
+
+# The interface you want packaged.
+INTERFACE=default
+
+# The PHP binary for running PHP scripts.
+# Make sure that the php binary is in the global $PATH, or else please point to
+# the location of your php binary.
+BIN_PHP=php
+
+# Make sure you have the YUI Compressor package available. Update this path to
+# point to the location of your package.
+export FOLDER_YUIC=$(HOME)/src/yuicompressor
+
+# Make sure you have the jsdoc-toolkit package available. Update this path to
+# point to the location of your package.
+export FOLDER_JSDOCT=$(HOME)/src/jsdoc-toolkit
+
+# The JSON encoder script.
+BIN_JSON=$(BIN_PHP) scripts/json_encode.php
+
+# The XHTML minifier script.
+BIN_XHTML=$(BIN_PHP) scripts/xhtml_minify.php
+
+# The script used for compressing/minifying CSS files.
+# Note that the scripts/yuicompressor script is a wrapper for YUI Compressor.
+BIN_CSS=scripts/yuicompressor
+
+# The CSS images inliner script.
+BIN_CSS_IMAGES=$(BIN_PHP) scripts/css_images.php
+
+# The script used for compressing/minifying JavaScript files
+BIN_JS=scripts/yuicompressor
+
+# The script used for generating the JavaScript documentation / the API
+# reference based on the source code. Note that the scripts/jsdoc script is
+# a wrapper for jsdoc-toolkit.
+BIN_JSDOC=scripts/jsdoc
+
+# PaintWeb folders.
+# Generally, you don't have to change these.
+FOLDER_BUILD=build
+FOLDER_SRC=src
+FOLDER_INCLUDES=includes
+FOLDER_TOOLS=tools
+FOLDER_EXTENSIONS=extensions
+FOLDER_INTERFACES=interfaces
+FOLDER_LANG=lang
+FOLDER_COLORS=colors
+FOLDER_DOCS_API=docs/api-ref
+FOLDER_TINYMCE_PLUGIN=ext/tinymce-plugin/paintweb
+
+
+# vim:set spell spl=en fo=wan1croql tw=80 ts=2 sw=2 sts=0 sta noet ai cin fenc=utf-8 ff=unix:
+
View
29 scripts/jsdoc
@@ -18,46 +18,53 @@
# along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
#
# $URL: http://code.google.com/p/paintweb $
-# $Date: 2009-07-02 14:04:19 +0300 $
+# $Date: 2009-10-10 20:03:42 +0300 $
+
+# This script allows quicker access to the jsdoc-toolkit script.
+# Make sure you get the latest jsdoc-toolkit from http://jsdoctoolkit.org/.
shopt -s nullglob
SRC_FOLDER="$1"
DOC_FOLDER="$2"
-# Make sure you point to your jsdoc-toolkit installation folder
-JSDOC_FOLDER="${HOME}/src/jsdoc-toolkit"
-JSDOC_JAR="${JSDOC_FOLDER}/jsrun.jar"
-JSDOC_JS="${JSDOC_FOLDER}/app/run.js"
-JSDOC_TEMPLATE="${JSDOC_FOLDER}/templates/jsdoc"
+# Make sure you point to your jsdoc-toolkit package folder.
+if [[ -z "$FOLDER_JSDOCT" ]]
+then
+ FOLDER_JSDOCT="${HOME}/src/jsdoc-toolkit"
+fi
+
+JSDOC_JAR="${FOLDER_JSDOCT}/jsrun.jar"
+JSDOC_JS="${FOLDER_JSDOCT}/app/run.js"
+JSDOC_TEMPLATE="${FOLDER_JSDOCT}/templates/jsdoc"
if [[ ! -d "$SRC_FOLDER" ]]
then
echo "The source folder does not exist: $SRC_FOLDER"
exit 1
fi
-if [[ ! -d "$JSDOC_FOLDER" ]]
+if [[ ! -d "$FOLDER_JSDOCT" ]]
then
- echo "The JSDoc folder does not exist: $JSDOC_FOLDER"
+ echo "The jsdoc-toolkit folder does not exist: $FOLDER_JSDOCT"
exit 1
fi
if [[ ! -f "$JSDOC_JAR" ]]
then
- echo "The JSDoc-Toolkit .jar file does not exist!"
+ echo "The jsdoc-toolkit .jar file does not exist!"
exit 1
fi
if [[ ! -f "$JSDOC_JS" ]]
then
- echo "The JSDoc-Toolkit run.js file does not exist!"
+ echo "The jsdoc-toolkit run.js file does not exist!"
exit 1
fi
if [[ ! -d "$JSDOC_TEMPLATE" ]]
then
- echo "The JSDoc-Toolkit template folder does not exist: $JSDOC_TEMPLATE"
+ echo "The jsdoc-toolkit template folder does not exist: $JSDOC_TEMPLATE"
exit 1
fi
View
23 scripts/yuicompressor
@@ -18,7 +18,7 @@
# along with PaintWeb. If not, see <http://www.gnu.org/licenses/>.
#
# $URL: http://code.google.com/p/paintweb $
-# $Date: 2009-07-01 22:03:22 +0300 $
+# $Date: 2009-10-10 20:02:39 +0300 $
# This script allows quicker access to the YUICompressor tool.
# Make sure you get the latest YUICompressor from
@@ -29,32 +29,35 @@ shopt -s nullglob
MY_PWD="$PWD"
# Update this value to point to your yuicompressor folder.
-YUIC_FOLDER="${HOME}/src/yuicompressor"
+if [[ -z "$FOLDER_YUIC" ]]
+then
+ FOLDER_YUIC="${HOME}/src/yuicompressor"
+fi
-if [[ ! -d "$YUIC_FOLDER" ]]
+if [[ ! -d "$FOLDER_YUIC" ]]
then
- echo "The yuicompressor folder does not exist: $YUIC_FOLDER"
+ echo "The yuicompressor folder does not exist: $FOLDER_YUIC"
exit 1
fi
-if [[ ! -d "${YUIC_FOLDER}/build" ]]
+if [[ ! -d "${FOLDER_YUIC}/build" ]]
then
- echo "The yuicompressor/build folder does not exist: ${YUIC_FOLDER}/build"
+ echo "The yuicompressor build folder does not exist: ${FOLDER_YUIC}/build"
exit 1
fi
-cd "${YUIC_FOLDER}/build"
-YUIC_BIN=(*.jar)
+cd "${FOLDER_YUIC}/build"
+BIN_YUIC=(*.jar)
-if [[ -z "$YUIC_BIN" || ! -f "$YUIC_BIN" ]]
+if [[ -z "$BIN_YUIC" || ! -f "$BIN_YUIC" ]]
then
echo "The yuicompressor.jar file was not found!"
exit 1
fi
cd "$MY_PWD"
-java -jar "${YUIC_FOLDER}/build/${YUIC_BIN}" $@
+java -jar "${FOLDER_YUIC}/build/${BIN_YUIC}" $@
# vim:set spell spl=en fo=wan1croql tw=80 ts=2 sw=2 sts=0 sta noet ai cin fenc=utf-8 ff=unix:

0 comments on commit aa680af

Please sign in to comment.