Commit 674cfd2c authored by Greg Williams's avatar Greg Williams
Browse files

Added link to Doxygen API to README.md.

Added VERSION file and updating of doxygen config to include the latest version in the API docs.
Added doxygen tasks to rakefile, including auto-publishing of results to github pages
parent 4a592d95
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ Getting Started
    > bundle install # Ensures you have all RubyGems needed
    > bundle execute rake #run all tests and build kinetic-c library and examples

API Docuemntation
=================
[Kinetic-C API](http://atomicobject.github.io/kinetic-c/) (generated with Doxygen)

Dependencies
============
* [Kinetic Protocol](https://github.com/Seagate/kinetic-protocol)
+17 −16
Original line number Diff line number Diff line
@@ -23,14 +23,7 @@ def execute_command(cmd, banner=nil)
end

def git(cmd)
  safe_system("git " + cmd)
end

def safe_system(cmd)
  if !system(cmd)
    puts "Failed: #{cmd}"
    exit
  end
  execute_command "git #{cmd}"
end

HERE = File.expand_path(File.dirname(__FILE__))
@@ -86,25 +79,33 @@ namespace :doxygen do
  DOCS_PATH = "./docs/"
  directory DOCS_PATH
  CLOBBER.include DOCS_PATH
  VERSION = File.read('VERSION').strip

  task :checkout_github_pages => ['clobber', DOCS_PATH] do
    git "clone git@github.com:atomicobject/kinetic-c.git -b gh-pages #{DOCS_PATH}"
    cd DOCS_PATH do
      git "rm -r docs/"
      cp "../README.md", "."
      cp "../LICENSE", "."
    end
  end

  desc "Generate API docs"
  task :gen => [DOCS_PATH] do
    report_banner "Generating Doxygen API Docs"
    # Update API version in doxygen config
    doxyfile = "config/Doxyfile"
    content = File.read(doxyfile).sub(/^PROJECT_NUMBER +=.*$/, "PROJECT_NUMBER = \"v#{VERSION}\"")
    puts content
    File.open(doxyfile, 'w').puts content
    # git "add #{doxyfile}"

    # Generate the Doxygen API docs
    report_banner "Generating Doxygen API Docs (kinetic-c v#{VERSION}"
    execute_command "doxygen config/Doxyfile"
  end

  task :gen_github_pages => ['doxygen:checkout_github_pages', 'doxygen:gen'] do
    cd DOCS_PATH do
      git "add --all"
      git "status"
      git "commit -m 'Regenerated API docs for v#{VERSION}'"
      git "push"
    end
  end

end

VERSION

0 → 100644
+1 −0
Original line number Diff line number Diff line
0.3.0-beta
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ PROJECT_NAME = "Kinetic C Client"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER         =
PROJECT_NUMBER = "v0.3.0-beta"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a