]> code.delx.au - gnu-emacs-elpa/blob - Rakefile
Downloading from googlecode the bare .el text file is causing problem. pack it as...
[gnu-emacs-elpa] / Rakefile
1 # -*- Ruby -*-
2
3 require 'fileutils'
4
5 def find_version
6 File.read("yasnippet.el") =~ /;; Version: *([0-9.]+) *$/
7 $version = $1
8 end
9 find_version
10 FileUtils.mkdir_p('pkg')
11
12 desc "generate the bundle file."
13 task :bundle do
14 sh 'emacs --batch -l yasnippet.el --eval "(yas/compile-bundle ' +
15 '\"./yasnippet.el\" \"./yasnippet-bundle.el\" \"./snippets\")"'
16 sh "tar czf pkg/yasnippet-bundle-#{$version}.el.tgz yasnippet-bundle.el"
17 end
18
19 desc "create a release package"
20 task :package do
21 release_dir = "pkg/yasnippet-#{$version}"
22 FileUtils.mkdir_p(release_dir)
23 files = ['snippets', 'yasnippet.el', 'Rakefile']
24 FileUtils.cp_r files, release_dir
25 FileUtils.rm_r Dir[release_dir + "/**/.svn"]
26 FileUtils.cd 'pkg'
27 sh "tar cjf yasnippet-#{$version}.tar.bz2 yasnippet-#{$version}"
28 FileUtils.cd ".."
29 end
30
31 desc "create a release package and upload it to google code"
32 task :release => [:bundle, :package] do
33 version = find_version
34 sh "googlecode_upload.py -s \"YASnippet Release #{$version}\"" +
35 " -p yasnippet --config-dir=none -l \"Featured,Type-Package,OpSys-All\"" +
36 " pkg/yasnippet-#{$version}.tar.bz2"
37 sh "googlecode_upload.py -s \"YASnippet Bundle #{$version}\"" +
38 " -p yasnippet --config-dir=none -l \"Featured,Type-Package,OpSys-All\"" +
39 " pkg/yasnippet-bundle-#{$version}.el.tgz"
40
41 end
42
43 task :default => :bundle