You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/02/20 06:01:09 UTC

svn commit: r629355 - in /incubator/buildr/trunk: Rakefile doc/css/default.css doc/css/eiffel.css doc/css/print.css doc/images/note.png doc/images/tip.png doc/print.haml lib/core/application.rb

Author: assaf
Date: Tue Feb 19 21:01:07 2008
New Revision: 629355

URL: http://svn.apache.org/viewvc?rev=629355&view=rev
Log:
Finally, styling fit for a 1.3 release

Added:
    incubator/buildr/trunk/doc/images/note.png   (with props)
    incubator/buildr/trunk/doc/images/tip.png   (with props)
Modified:
    incubator/buildr/trunk/Rakefile
    incubator/buildr/trunk/doc/css/default.css
    incubator/buildr/trunk/doc/css/eiffel.css
    incubator/buildr/trunk/doc/css/print.css
    incubator/buildr/trunk/doc/print.haml
    incubator/buildr/trunk/lib/core/application.rb

Modified: incubator/buildr/trunk/Rakefile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/Rakefile?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/Rakefile (original)
+++ incubator/buildr/trunk/Rakefile Tue Feb 19 21:01:07 2008
@@ -1,5 +1,4 @@
 require 'rubygems'
-Gem::manage_gems
 require 'rake/gempackagetask'
 require 'rake/rdoctask'
 require 'spec/rake/spectask'
@@ -35,7 +34,7 @@
     spec.add_dependency 'net-sftp',             '~> 1.1'
     spec.add_dependency 'rubyzip',              '~> 0.9'
     spec.add_dependency 'highline',             '~> 1.4'
-    spec.add_dependency 'Antwrap',              '~> 0.6'
+    spec.add_dependency 'Antwrap',              '~> 0.7'
     spec.add_dependency 'rspec',                '~> 1.1'
     spec.add_dependency 'xml-simple',           '~> 1.0'
     spec.add_dependency 'archive-tar-minitar',  '~> 0.5'
@@ -45,6 +44,9 @@
   end
 end
 
+
+# Packaging and local installation.
+#
 ruby_spec = specify(Gem::Platform::RUBY)
 jruby_spec = specify('java')
 ruby_package = Rake::GemPackageTask.new(ruby_spec) do |pkg|
@@ -84,6 +86,7 @@
 
 
 # Testing is everything.
+#
 desc 'Run all specs'
 Spec::Rake::SpecTask.new('spec') do |task|
   task.spec_files = FileList['spec/**/*_spec.rb']
@@ -112,30 +115,38 @@
 
 
 # Documentation.
+#
+desc 'Generate RDoc documentation'
+rdoc = Rake::RDocTask.new(:rdoc) do |rdoc|
+  rdoc.rdoc_dir = 'html/rdoc'
+  rdoc.title    = ruby_spec.name
+  rdoc.options  = ruby_spec.rdoc_options + ['--promiscuous']
+  rdoc.rdoc_files.include('lib/**/*.rb')
+  rdoc.rdoc_files.include ruby_spec.extra_rdoc_files
+  begin
+    gem 'allison'
+    rdoc.template = File.expand_path('lib/allison.rb', Gem.loaded_specs['allison'].full_gem_path)
+  rescue Exception 
+  end
+end
+
+desc 'Generate all documentation merged into the html directory'
+task 'docs'=>[rdoc.name]
+
 begin
-  require 'rake/rdoctask'
-  gem 'docter', '~>1.1'
   require 'docter'
   require 'docter/server'
   require 'docter/ultraviolet'
-  require 'allison'
-
-  desc 'Generate RDoc documentation'
-  rdoc = Rake::RDocTask.new(:rdoc) do |rdoc|
-    rdoc.rdoc_dir = 'html/rdoc'
-    rdoc.title    = ruby_spec.name
-    rdoc.options  = ruby_spec.rdoc_options + ['--promiscuous']
-    rdoc.rdoc_files.include('lib/**/*.rb')
-    rdoc.rdoc_files.include ruby_spec.extra_rdoc_files
-    rdoc.template = File.expand_path('lib/allison.rb', Gem.loaded_specs['allison'].full_gem_path)
-  end
 
   web_docs = {
-    :collection => Docter.collection('Buildr').using('doc/web.toc.yaml').include('doc/pages', 'LICENSE', 'CHANGELOG'),
-    :template   => Docter.template('doc/web.haml').include('doc/css', 'doc/images', 'html/report.html', 'html/coverage', 'html/rdoc')
+    :collection => Docter.collection('Buildr').using('doc/web.toc.yaml').
+      include('doc/pages', 'LICENSE', 'CHANGELOG'),
+    :template   => Docter.template('doc/web.haml').
+      include('doc/css', 'doc/images', 'doc/scripts', 'html/report.html', 'html/coverage', 'html/rdoc')
   }
   print_docs = {
-    :collection => Docter.collection('Buildr — The build system that doesn\'t suck').using('doc/print.toc.yaml').include('doc/pages', 'LICENSE'),
+    :collection => Docter.collection('Buildr — The build system that doesn\'t suck').using('doc/print.toc.yaml').
+      include('doc/pages', 'LICENSE'),
     :template   => Docter.template('doc/print.haml').include('doc/css', 'doc/images')
   }
 
@@ -143,33 +154,34 @@
     html.gsub(/<p id="fn(\d+)">(.*?)<\/p>/, %{<p id="fn\\1" class="footnote">\\2</p>})
   end
 
-  desc 'Produce PDF'
-  print = Docter::Rake.generate('print', print_docs[:collection], print_docs[:template], :one_page)
-  pdf_file = file('html/buildr.pdf'=>print) do |task|
-    mkpath 'html'
-    sh *%W{prince #{print}/index.html --baseurl=http://incubator.apache.org/buildr/ -o #{task.name} --media=print} do |ok, res|
-      fail 'Failed to create PDF, see errors above' unless ok
-    end
-  end
-  task('pdf'=>pdf_file) { |task| `open #{File.expand_path(pdf_file.to_s)}` }
-
   desc 'Generate HTML documentation'
   html = Docter::Rake.generate('html', web_docs[:collection], web_docs[:template])
   desc 'Run Docter server'
   Docter::Rake.serve :docter, web_docs[:collection], web_docs[:template], :port=>3000
+  task('docs').enhance [html]
+  task('clobber') { rm_rf html.to_s }
 
-  desc 'Generate all documentation merged into the html directory'
-  task 'docs'=>[html, rdoc.name, pdf_file]
-  task('clobber') { rm_rf [html, print].map(&:to_s) }
-
-rescue LoadError=>error
-  puts error
-  puts 'To create the Buildr documentation you need to:'
-  puts '  gem install docter ultraviolet allison'
+  if `which prince` =~ /prince/ 
+    desc 'Produce PDF'
+    print = Docter::Rake.generate('print', print_docs[:collection], print_docs[:template], :one_page)
+    pdf = file('html/buildr.pdf'=>print) do |task|
+      mkpath 'html'
+      sh *%W{prince #{print}/index.html -o #{task.name} --media=print} do |ok, res|
+        fail 'Failed to create PDF, see errors above' unless ok
+      end
+    end
+    task('pdf'=>pdf) { |task| `open #{File.expand_path(pdf.to_s)}` }
+    task('docs').enhance [pdf]
+    task('clobber') { rm_rf print.to_s }
+  end
+
+rescue LoadError
+  puts "To generate the site documentation and PDF, gem install docter ultraviolet"
 end
 
 
 # Commit to SVN, upload and do the release cycle.
+#
 namespace :svn do
   task :clean? do |task|
     status = `svn status`.reject { |line| line =~ /\s(pkg|html)$/ }
@@ -184,7 +196,6 @@
 end
 
 namespace :upload do
-
   task :docs=>'rake:docs' do |task|
     sh %{rsync -r --del --progress html/*  people.apache.org:/www/incubator.apache.org/#{ruby_spec.rubyforge_project.downcase}/}
   end
@@ -246,39 +257,26 @@
 task :release=>[ 'release:ready?', 'release:meat', 'release:post' ]
 
 
-# Misc, may not survive so don't rely on these.
-task :report do |task|
-  puts "#{ruby_spec.name} #{ruby_spec.version}"
-  puts ruby_spec.summary
-  sources = (ruby_spec.files + FileList['ruby_spec/**/*.rb']).reject { |f| File.directory?(f) }
-  sources.inject({}) do |lists, file|
-    File.readlines(file).each_with_index do |line, i|
-      if line =~ /(TODO|FIXME|NOTE):\s*(.*)/
-        list = lists[$1] ||= []
-        list << sprintf('%s (%d): %s', file, i, $2)
-      end
-    end
-    lists
-  end.each_pair do |type, list|
-    unless list.empty?
-      puts
-      puts "#{type}:"
-      list.each { |line| puts line }
-    end
-  end
-end
-
-
+# Handles Java libraries that are part of Buildr.
+#
 task 'compile' do
+  $LOAD_PATH.unshift File.expand_path('lib')
+  require 'buildr'
+  require 'buildr/jetty'
+
   # RJB, JUnit and friends.
   Dir.chdir 'lib/java' do
     `javac -source 1.4 -target 1.4 -Xlint:all org/apache/buildr/*.java`
   end
 
   # Jetty server.
-  cp = ['jetty-6.1.1.jar', 'jetty-util-6.1.1.jar', 'servlet-api-2.5-6.1.1'].
-    map { |jar| `locate #{jar}`.split.first }.join(File::PATH_SEPARATOR)
+  cp = artifacts(Buildr::Jetty::REQUIRES).each { |task| task.invoke }.map(&:name).join(File::PATH_SEPARATOR)
   Dir.chdir 'lib/buildr' do
     `javac -source 1.4 -target 1.4 -Xlint:all -cp #{cp} org/apache/buildr/*.java`
   end
 end
+
+
+# Apache release:
+# - Create MD5/SHA1/PGP signatures
+# - Upload to people.apache.org:/www/www.apache.org/dist/incubator/buildr

Modified: incubator/buildr/trunk/doc/css/default.css
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/css/default.css?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/css/default.css (original)
+++ incubator/buildr/trunk/doc/css/default.css Tue Feb 19 21:01:07 2008
@@ -1,7 +1,7 @@
 body {
   background-color: #fff;
   color: #000;
-  font-family: Verdana, Arial, Helvetica, sans-serif;
+  font-family: "DejaVu Sans", Verdana, Helvetica, sans-serif;
   text-align: center;
 	line-height: 1.5em;
 }
@@ -19,10 +19,8 @@
   border: none;
 }
 
-pre {
-	font-family: "Courier New";
-  padding: 1em;
-}
+pre, code { font-family: "DejaVu Sans Mono", "Courier New", "Courier"; }
+pre { padding: 1em; }
 pre.wrapped {
   white-space: pre-wrap;       /* css-3 */
   white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
@@ -62,8 +60,8 @@
 	border-left: 1px solid #3c78b5;
 }
 
-ul {
-  list-style-type: disc;
+ul { 
+  list-style-ty pe: disc;
 }
 
 ul ul {
@@ -177,6 +175,13 @@
 }
 
 
+#content p.tip, #content p.note {
+  margin: 0.9em 0 0 0;
+  padding: 0 0 2em 4em;
+}
+#content p.tip { background: url("../images/tip.png") 0 0 no-repeat; }
+#content p.note { background: url("../images/note.png") 0 0 no-repeat; }
+ 
 #content .footnote {
   margin-top: 2.5em;
 }
@@ -196,23 +201,10 @@
 #content .footnote-links dd { }
 
 
-#navigation {
-  padding: 2em 0 1em 0;
-}
-#navigation .prev {
-  display: block;
-  float: left;
-}
-#navigation .next {
-  display: block;
-  float: right;
-}
-
-
 #footer {
-  border-top: 1px solid #ccc;
+  border-top: 1px solid #444;
   font-size: 0.9em;
   padding: 0.3em;
+  margin: 2em 0 3em 0em;
   clear: both;
-  margin: 0 0 3em 0em;
 }

Modified: incubator/buildr/trunk/doc/css/eiffel.css
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/css/eiffel.css?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/css/eiffel.css (original)
+++ incubator/buildr/trunk/doc/css/eiffel.css Tue Feb 19 21:01:07 2008
@@ -1,30 +1,24 @@
 pre.eiffel .EmbeddedSource {
 }
 pre.eiffel .LibraryObject {
-   font-weight: bold;
    color: #6D79DE;
 }
 pre.eiffel .Section {
-   font-style: italic;
 }
 pre.eiffel .FunctionArgumentAndResultTypes {
    color: #70727E;
 }
 pre.eiffel .TypeName {
-   font-style: italic;
 }
 pre.eiffel .Number {
    color: #CD0000;
-   font-style: italic;
 }
 pre.eiffel .MarkupList {
    color: #B90690;
 }
 pre.eiffel .MarkupTagAttribute {
-   font-style: italic;
 }
 pre.eiffel .LibraryVariable {
-   font-weight: bold;
    color: #21439C;
 }
 pre.eiffel .line-numbers {
@@ -32,7 +26,6 @@
    color: #000000;
 }
 pre.eiffel .FunctionParameter {
-   font-style: italic;
 }
 pre.eiffel .MarkupTag {
 }
@@ -41,21 +34,19 @@
    color: #000000;
 }
 pre.eiffel .MarkupHeading {
-   font-weight: bold;
+   -font-weight: bold;
    color: #0C07FF;
 }
 pre.eiffel .JsOperator {
    color: #687687;
 }
 pre.eiffel .InheritedClassName {
-   font-style: italic;
 }
 pre.eiffel .StringInterpolation {
    color: #26B31A;
 }
 pre.eiffel .MarkupQuote {
    color: #000000;
-   font-style: italic;
 }
 pre.eiffel .MarkupNameOfTag {
    color: #1C02FF;
@@ -64,29 +55,24 @@
    background-color: #FFD0D0;
 }
 pre.eiffel .LibraryConstant {
-   font-weight: bold;
    color: #06960E;
 }
 pre.eiffel .MarkupXmlDeclaration {
    color: #68685B;
 }
 pre.eiffel .PreprocessorDirective {
-   font-weight: bold;
    color: #0C450D;
 }
 pre.eiffel .BuiltInConstant {
    color: #585CF6;
-   font-style: italic;
 }
 pre.eiffel .MarkupDtd {
-   font-style: italic;
 }
 pre.eiffel .Invalid {
    background-color: #990000;
    color: #FFFFFF;
 }
 pre.eiffel .LibraryFunction {
-   font-weight: bold;
    color: #3C4C72;
 }
 pre.eiffel .String {
@@ -94,17 +80,14 @@
 }
 pre.eiffel .UserDefinedConstant {
    color: #C5060B;
-   font-style: italic;
 }
 pre.eiffel .Keyword {
-   font-weight: bold;
    color: #0100B6;
 }
 pre.eiffel .MarkupDoctype {
    color: #888888;
 }
 pre.eiffel .FunctionName {
-   font-weight: bold;
    color: #0000A2;
 }
 pre.eiffel .PreprocessorLine {
@@ -112,7 +95,6 @@
 }
 pre.eiffel .Variable {
    color: #0206FF;
-   font-style: italic;
 }
 pre.eiffel .Comment {
    color: #00B418;

Modified: incubator/buildr/trunk/doc/css/print.css
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/css/print.css?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/css/print.css (original)
+++ incubator/buildr/trunk/doc/css/print.css Tue Feb 19 21:01:07 2008
@@ -23,8 +23,21 @@
   background: white;
 }
 
-title { string-set: doctitle content(); }
-h1 { string-set: pagetitle content(); }
+h1 {
+  string-set: pagetitle content();
+  page-break-before: always;
+}
+h1:first-child { page-break-before: avoid; }
+pre, p, blockquote { page-break-inside: avoid; }
+pre {
+  font-size: 85% !important;
+  line-height: 1.3em;
+}
+a:link, a:visited {
+  background: transparent;
+  text-decoration: underline;
+}
+
 
 #wrap, #content, #footer {
   float: none !important;
@@ -55,21 +68,7 @@
 
 #footer { margin-top: 5%; }
 
-h1 { page-break-before: always; }
-h1:first-child { page-break-before: avoid; }
-
-pre, p, blockquote { page-break-inside: avoid; }
-
-pre {
-  font-size: 85% !important;
-  line-height: 1.3em;
-}
-
-#license+ol+pre {
+#license+pre {
+  page-break-before: none !important;
   page-break-inside: always !important;
-}
-
-a:link, a:visited {
-  background: transparent;
-  text-decoration: underline;
 }

Added: incubator/buildr/trunk/doc/images/note.png
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/images/note.png?rev=629355&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/buildr/trunk/doc/images/note.png
------------------------------------------------------------------------------
    svn:executable = *

Propchange: incubator/buildr/trunk/doc/images/note.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/buildr/trunk/doc/images/tip.png
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/images/tip.png?rev=629355&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/buildr/trunk/doc/images/tip.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/buildr/trunk/doc/print.haml
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/print.haml?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/print.haml (original)
+++ incubator/buildr/trunk/doc/print.haml Tue Feb 19 21:01:07 2008
@@ -6,7 +6,7 @@
     %style{ :type=>'text/css' }
       @import 'css/default.css';
       @import 'css/eiffel.css';
-      @import 'css/print.css';
+      @import 'css/print.css' print;
     %meta{ :name=>'subject', :content=>'Official Buildr documentation from the people in the know' }
   %body
     #wrap
@@ -20,5 +20,3 @@
           %h1{ :id=>page.id }= page.title
           = page.toc.to_html(:nested, :class=>'toc')
           ~ collect_links(renumber_footnotes(page.content))
-        %h1 References
-        ~ list_links('footnote-links')

Modified: incubator/buildr/trunk/lib/core/application.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/core/application.rb?rev=629355&r1=629354&r2=629355&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/core/application.rb (original)
+++ incubator/buildr/trunk/lib/core/application.rb Tue Feb 19 21:01:07 2008
@@ -123,7 +123,7 @@
       end
 
       def usage()
-        puts "Buildr #{Buildr::VERSION} #{RUBY_PLATFORM[/java/] && '(JRuby)'}"
+        puts "Buildr #{Buildr::VERSION} #{RUBY_PLATFORM[/java/] && '(JRuby '+JRUBY_VERSION+')'}"
         puts
         puts 'Usage:'
         puts '  buildr [options] [tasks] [name=value]'