From 16c74d1f8c155721d2eb30a6486ddef4874b529e Mon Sep 17 00:00:00 2001 From: Obexer Christoph Date: Wed, 16 Nov 2011 00:25:02 +0100 Subject: [PATCH] Improve build system: read version from version.txt, fix build without compiler * read the version from version.txt * set default target to build * added dependencies to all targets * allow the build to run without a local copy of the closure compiler * updated license header with @VERSION@ which will be replaced during the build * added the license header to all files (that one will be stripped out by the closure compiler) --- .gitignore | 5 ++- build.xml | 88 +++++++++++++++++++++++------------------------ build/.gitkeepdir | 0 src/Core.js | 10 +++++- src/Generate.js | 8 +++++ src/LICENSE | 10 +++--- src/Parse.js | 8 +++++ src/Preload.js | 8 +++++ src/Queue.js | 7 ++++ src/Renderer.js | 7 ++++ src/Util.js | 7 ++++ version.txt | 1 + 12 files changed, 105 insertions(+), 54 deletions(-) create mode 100644 build/.gitkeepdir create mode 100644 version.txt diff --git a/.gitignore b/.gitignore index cd8e7e4..809195d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,8 @@ /tests/flashcanvas.html /lib/ /dist/ -/build/tmp.js -/build/html2canvas.min.js +/build/*.js index.html image.jpg screenshots.html -screenshots_local.html \ No newline at end of file +screenshots_local.html diff --git a/build.xml b/build.xml index af799cd..742b709 100644 --- a/build.xml +++ b/build.xml @@ -1,77 +1,75 @@ - + - - - - + - + - - - - - - - - - + + + + + + + + + - - - - - - - - - - + + - - - + + + - + + - - + + - - - - + classpath="${lib.dir}/compiler.jar" onerror="report"/> + + + - + - - + + + + + + + + + - - - - + + + + + + diff --git a/build/.gitkeepdir b/build/.gitkeepdir new file mode 100644 index 0000000..e69de29 diff --git a/src/Core.js b/src/Core.js index e5ccaad..1e8478a 100644 --- a/src/Core.js +++ b/src/Core.js @@ -1,3 +1,11 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ + var html2canvas = {}; html2canvas.logging = true; @@ -121,4 +129,4 @@ html2canvas.Util.Extend = function (options, defaults) { html2canvas.Util.Children = function(el) { // $(el).contents() !== el.childNodes, Opera / IE have issues with that return $(el).contents(); -} \ No newline at end of file +} diff --git a/src/Generate.js b/src/Generate.js index aff0f14..3545a44 100644 --- a/src/Generate.js +++ b/src/Generate.js @@ -1,3 +1,11 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ + html2canvas.Generate = {}; diff --git a/src/LICENSE b/src/LICENSE index 5e34fe0..458faef 100644 --- a/src/LICENSE +++ b/src/LICENSE @@ -1,7 +1,7 @@ -/* - html2canvas v0.30 +/** + @license html2canvas @VERSION@ Copyright (c) 2011 Niklas von Hertzen. All rights reserved. - http://www.twitter.com/niklasvh - + http://www.twitter.com/niklasvh + Released under MIT License -*/ + */ \ No newline at end of file diff --git a/src/Parse.js b/src/Parse.js index aee83f6..63c6831 100644 --- a/src/Parse.js +++ b/src/Parse.js @@ -1,3 +1,11 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ + /* * New function for traversing elements */ diff --git a/src/Preload.js b/src/Preload.js index 1465b25..869a1a5 100644 --- a/src/Preload.js +++ b/src/Preload.js @@ -1,3 +1,11 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ + html2canvas.Preload = function(element, opts){ var options = { diff --git a/src/Queue.js b/src/Queue.js index 0a0833d..2936f87 100644 --- a/src/Queue.js +++ b/src/Queue.js @@ -1,3 +1,10 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ html2canvas.canvasContext = function (width, height) { this.storage = []; this.width = width; diff --git a/src/Renderer.js b/src/Renderer.js index 5b84bbf..e6e6092 100644 --- a/src/Renderer.js +++ b/src/Renderer.js @@ -1,3 +1,10 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ html2canvas.Renderer = function(parseQueue, opts){ diff --git a/src/Util.js b/src/Util.js index e69de29..2f0e01e 100644 --- a/src/Util.js +++ b/src/Util.js @@ -0,0 +1,7 @@ +/* + html2canvas @VERSION@ + Copyright (c) 2011 Niklas von Hertzen. All rights reserved. + http://www.twitter.com/niklasvh + + Released under MIT License +*/ \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..91ecaa6 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +v0.30 \ No newline at end of file