Permalink
Browse files

Add more bits to the rakefile

  • Loading branch information...
tekkub committed Jan 16, 2010
1 parent a1a33eb commit 1d200e4d1ac684a06610a0db9d4ed3660cdb1f73
Showing with 27 additions and 2 deletions.
  1. +27 −2 Rakefile
View
@@ -2,20 +2,45 @@
myname = File.dirname(__FILE__).split("/").last
require 'crxmake'
+
+desc "Finds your last tag"
task :default do
+ last_tag = `git describe 2>/dev/null`
+ puts (last_tag.empty? ? "Cannot find last tag" : "Last tag: #{last_tag}")
+end
+
+
+desc "Build a .crx file that Chrome can load"
+task :build, [:version] do |t, args|
+ args.with_defaults(:version => "Alpha")
+
unless File.exists?("key.pem")
CrxMake.make(
:ex_dir => "./src",
:pkey_output => "./key.pem",
- :crx_output => "./#{myname}.crx",
+ :crx_output => "./#{myname}-#{args.version}.crx",
:verbose => true
)
else
CrxMake.make(
:ex_dir => "./src",
:pkey => "./key.pem",
- :crx_output => "./#{myname}.crx",
+ :crx_output => "./#{myname}-#{args.version}.crx",
:verbose => true
)
end
end
+
+
+desc "Update the version number and create a tag"
+task :tag, [:version] do |t, args|
+ new_file = File.read("src/manifest.json").gsub(/"version": ".+",/, %Q|"version": "#{args.version}",|)
+ File.open("src/manifest.json", "w") {|f| f << new_file}
+ `git commit -m "Updating version number" -- src/manifest.json`
+ `git tag -a -m "Build #{args.version}" v#{args.version}`
+end
+
+
+desc "Tag, build and upload a new version"
+task :release, [:version] => [:tag, :build] do |t, args|
+end

0 comments on commit 1d200e4

Please sign in to comment.