Skip to content

Commit

Permalink
Merge pull request #20 from 4-20ma/19-fix-rakefile
Browse files Browse the repository at this point in the history
19 Fix Rakefile
  • Loading branch information
4-20ma authored Sep 13, 2016
2 parents 95029c5 + cc98ce1 commit 6c4fb68
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Rake::VersionTask.new do |task|
end

# adjust as appropriate
DOXYFILE = 'Doxyfile'
GITHUB_USERNAME = '4-20ma'
GITHUB_REPO = 'I2cDiscreteIoExpander'
HEADER_FILE = "#{GITHUB_REPO}.h"
Expand Down Expand Up @@ -88,7 +89,7 @@ namespace :prepare do

# update parameters in Doxyfile
cwd = File.expand_path(File.dirname(__FILE__))
file = File.join(cwd, 'doc', 'Doxyfile')
file = File.join(cwd, 'doc', DOXYFILE)

contents = IO.read(file)
contents.sub!(/(^PROJECT_NUMBER\s*=)(.*)$/) do |match|
Expand All @@ -98,7 +99,7 @@ namespace :prepare do

# chdir to doc/ and call doxygen to update documentation
Dir.chdir(to = File.join(cwd, 'doc'))
system('doxygen', 'Doxyfile')
system('doxygen', DOXYFILE)

# chdir to doc/latex and call doxygen to update documentation
Dir.chdir(from = File.join(cwd, 'doc', 'latex'))
Expand All @@ -119,8 +120,7 @@ namespace :prepare do
next if 'refs/heads/gh-pages' == `git config branch.gh-pages.merge`.chomp

# configure git remote/branch options
origin = "git@github.com_#{GITHUB_USERNAME}:#{GITHUB_USERNAME}/" +
"#{GITHUB_REPO}.git"
origin = "https://github.com/#{GITHUB_USERNAME}/#{GITHUB_REPO}"
`git init`
`git remote add origin #{origin}`
`git checkout --orphan gh-pages`
Expand Down Expand Up @@ -204,7 +204,8 @@ namespace :release do
desc 'Commit source changes related to version bump'
task :source do
version = Version.current.to_s
`git add #{HEADER_FILE} #{CHANGELOG_FILE} #{VERSION_FILE}`
`git add doc/#{DOXYFILE} "doc/#{GITHUB_REPO} reference-#{version}.pdf" \
#{HEADER_FILE} #{CHANGELOG_FILE} #{VERSION_FILE}`
`git commit -m 'Version bump to v#{version}'`
`git tag -a -f -m 'Version v#{version}' v#{version}`
`git push origin master`
Expand Down

0 comments on commit 6c4fb68

Please sign in to comment.