aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-18 19:54:12 +0100
committerwout <wout@impinc.co.uk>2012-12-18 19:54:12 +0100
commit1293edb66a5263f8f7064f16f11cbf6b8f550800 (patch)
treea336fb50db98d52ec8151b494bfa7762128c170e /Rakefile
parentecc7c2b21cc484a0a57cd7df02a533c65f7bde97 (diff)
downloadsvg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.tar.gz
svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.zip
Separated core from optional libraries
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/Rakefile b/Rakefile
index 289849d..5d3dc72 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,12 +1,19 @@
SVGJS_VERSION = '0.1a'
-CORE_MODULES = %w[ svg container element clip doc defs shape rect circle ellipse path image group ]
+# all available modules in the correct loading order
+ALL = %w[ svg container element arrange clip doc defs shape rect circle ellipse path image group sugar ]
-OPTIONAL_MODULES = %w[ sugar ]
+# required modules to make the library operational
+CORE = %w[ circle container defs doc element ellipse image path rect shape svg ]
-DEFAULT_MODULES = CORE_MODULES + OPTIONAL_MODULES
+# optional modules
+OPTIONAL = %w[ clip group arrange sugar ]
-KILO = 1024 # how many bytes in a "kilobyte"
+# modules used in the curren build
+MODULES = CORE.concat(OPTIONAL).sort { |a,b| ALL.index(a) <=> ALL.index(b) }
+
+# how many bytes in a "kilobyte"
+KILO = 1024
task :default => :dist
@@ -38,7 +45,7 @@ class BuildTask < Rake::FileTask
end
-BuildTask.define_task 'dist/svg.js' => DEFAULT_MODULES.map {|m| "src/#{ m }.js" } do |task|
+BuildTask.define_task 'dist/svg.js' => MODULES.map {|m| "src/#{ m }.js" } do |task|
mkdir_p 'dist', :verbose => false
svgjs = ''
@@ -107,7 +114,7 @@ desc "List available modules"
task :modules do
Dir['src/**/*.js'].each do |file|
name = file.gsub(/^src\//,'').gsub(/.js$/,'')
- puts name + (DEFAULT_MODULES.include?(name) ? '*' : '')
+ puts name + (MODULES.include?(name) ? '*' : '')
end
puts "\n*included in default build"
end