Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 83 lines (70 sloc) 2.361 kb
fe66394 @pluskid add Rakefile
pluskid authored
1 # -*- Ruby -*-
2
3 require 'fileutils'
4
85358aa @pluskid Downloading from googlecode the bare .el text file is causing problem…
pluskid authored
5 def find_version
f40a013 @capitaomorte Last commit before releasing 0.6.0
authored
6 File.read("yasnippet.el") =~ /;; Package-version: *([0-9.]+[a-z]?) *$/
85358aa @pluskid Downloading from googlecode the bare .el text file is causing problem…
pluskid authored
7 $version = $1
8 end
9 find_version
10 FileUtils.mkdir_p('pkg')
11
b8dcf61 @capitaomorte Last commit before tagging and releasing
authored
12
f6c4872 @capitaomorte * A new rake task to make my importing life a little easier, but stil…
authored
13 desc "convert some textmate bundles to yasnippets"
14 task :convert_bundles do
4d6b4e1 @capitaomorte Better rakefile for converting bundles
authored
15 Dir.glob "extras/bundles/*-tmbundle" do |bundle_dir|
16 puts "Converting from #{bundle_dir}"
17 mode_prefix = File.basename(bundle_dir).match(/[^-]*/)[0]
18 raise "Couldn't guess mode name for #{bundle_dir}" unless mode_prefix
f651c41 @capitaomorte Fix #216
authored
19 output = "./extras/imported/#{mode_prefix}-mode"
20 FileUtils.mkdir_p output
21 sh "./extras/textmate_import.rb -d #{bundle_dir} -o #{output} -q"
4d6b4e1 @capitaomorte Better rakefile for converting bundles
authored
22 end
f6c4872 @capitaomorte * A new rake task to make my importing life a little easier, but stil…
authored
23 end
24
4e9153a @pluskid a new rake task for uploading
pluskid authored
25 desc "create a release package"
26 task :package do
85358aa @pluskid Downloading from googlecode the bare .el text file is causing problem…
pluskid authored
27 release_dir = "pkg/yasnippet-#{$version}"
5d7e357 @pluskid exclude html files from svn
pluskid authored
28 FileUtils.mkdir_p(release_dir)
b8dcf61 @capitaomorte Last commit before tagging and releasing
authored
29 files = ['extras', 'snippets', 'yasnippet.el', 'dropdown-list.el']
fe66394 @pluskid add Rakefile
pluskid authored
30 FileUtils.cp_r files, release_dir
31 FileUtils.rm_r Dir[release_dir + "/**/.svn"]
32 FileUtils.cd 'pkg'
85358aa @pluskid Downloading from googlecode the bare .el text file is causing problem…
pluskid authored
33 sh "tar cjf yasnippet-#{$version}.tar.bz2 yasnippet-#{$version}"
4e9153a @pluskid a new rake task for uploading
pluskid authored
34 FileUtils.cd ".."
35 end
36
37 desc "create a release package and upload it to google code"
af81a55 @capitaomorte TODO: implement Rakefile :release task!
authored
38 task :release => [:package, 'doc:archive'] do
39 raise "Not implemented for github yet!"
fe66394 @pluskid add Rakefile
pluskid authored
40 end
41
5d7e357 @pluskid exclude html files from svn
pluskid authored
42 rule '.html' => '.rst' do |t|
43 sh "doc/compile-doc.py #{t.source} > #{t.name}"
44 end
490848d @pluskid preparing for new rst format document
pluskid authored
45 desc "Generate document"
87c0aa0 @pluskid correct rake file dependency
pluskid authored
46 task :doc => FileList['doc/*.rst'].ext('html')
5d7e357 @pluskid exclude html files from svn
pluskid authored
47
48 namespace :doc do
49 task :archive do
50 release_dir = "pkg/yasnippet-#{$version}"
51 FileUtils.mkdir_p(release_dir)
52 sh "tar cjf pkg/yasnippet-doc-#{$version}.tar.bz2 " +
53 "--exclude=doc/.svn --exclude=doc/images/.svn doc/*.html doc/images"
54 end
1f47718 @capitaomorte Added mediocre doc:upload task for updating the gh-pages branch
authored
55
56 task :upload do
57 if File.exists? 'doc/gh-pages'
58 Dir.chdir 'doc/gh-pages' do
59 sh "git checkout gh-pages"
60 end
61 Dir.glob("doc/*.{html,css}").each do |file|
62 FileUtils.cp file, 'doc/gh-pages'
63 end
64 Dir.glob("doc/images/*").each do |file|
65 FileUtils.cp file, 'doc/gh-pages/images'
66 end
67 Dir.chdir 'doc/gh-pages' do
68 sh "git commit -a -m 'Automatic documentation update.'"
69 sh "git push"
70 end
71 end
72 end
490848d @pluskid preparing for new rst format document
pluskid authored
73 end
74
b104c6b @capitaomorte * Now byte compiles correctly and with no warnings
authored
75 desc "Compile yasnippet.el into yasnippet.elc"
76
77 rule '.elc' => '.el' do |t|
78 sh "emacs --batch -L . --eval \"(byte-compile-file \\\"#{t.source}\\\")\""
79 end
80 task :compile => FileList["yasnippet.el", "dropdown-list.el"].ext('elc')
81
490848d @pluskid preparing for new rst format document
pluskid authored
82 task :default => :doc
Something went wrong with that request. Please try again.