aboutsummaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile24
1 files changed, 22 insertions, 2 deletions
diff --git a/Rakefile b/Rakefile
index a83b53ad..9a9835ba 100644
--- a/Rakefile
+++ b/Rakefile
@@ -156,8 +156,14 @@ task :compile => [:init, :compile_scenario, :generate_ie_compat] do
end
+desc 'Generate docs'
+task :docs do
+ `node docs/collect.js`
+end
+
+
desc 'Create angular distribution'
-task :package => [:clean, :compile] do
+task :package => [:clean, :compile, :docs] do
v = YAML::load( File.open( 'version.yaml' ) )['version']
match = v.match(/^([^-]*)(-snapshot)?$/)
version = match[1] + (match[2] ? ('-' + %x(git rev-parse HEAD)[0..7]) : '')
@@ -178,6 +184,20 @@ task :package => [:clean, :compile] do
FileUtils.cp(src, pkg_dir + '/' + dest)
end
+ FileUtils.cp_r path_to('docs'), "#{pkg_dir}/docs-#{version}"
+
+ File.open("#{pkg_dir}/docs-#{version}/index.html", File::RDWR) do |f|
+ text = f.read
+ f.rewind
+ f.write text.sub('angular.min.js', "angular-#{version}.min.js")
+ end
+
+ File.open("#{pkg_dir}/docs-#{version}/docs-scenario.html", File::RDWR) do |f|
+ text = f.read
+ f.rewind
+ f.write text.sub('angular-scenario.js', "angular-scenario-#{version}.js")
+ end
+
%x(tar -czf #{path_to(tarball)} -C #{path_to('pkg')} .)
puts "Package created: #{path_to(tarball)}"
@@ -256,5 +276,5 @@ end
# returns path to the file in the build directory
#
def path_to(filename)
- return File.join(BUILD_DIR, filename)
+ return File.join(BUILD_DIR, *filename)
end