Skip to content

Commit

Permalink
Fixed version parsing for downloads page. Made "snapshot" target use …
Browse files Browse the repository at this point in the history
…a "pages" symlink to get to the downloads directory of the gh_pages branch.
  • Loading branch information
Phil Goodwin committed Nov 5, 2010
1 parent 7ec8a91 commit d9b4b5f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,5 +3,6 @@ out/
.idea/workspace.xml
tmp/
target/
pages
*~
\#*\#
14 changes: 12 additions & 2 deletions build.xml
Expand Up @@ -97,11 +97,21 @@
<delete dir="${target.dir}/staging"/>
</target>

<target name="snapshot" description="release a version of robolectric as jars" depends="jar-all">
<target name="check-for-pages-dir-setup">
<condition property="pages.dir.exists">
<available file="pages" type="dir"/>
</condition>
</target>

<target name="check-for-pages-dir" depends="check-for-pages-dir-setup" unless="pages.dir.exists">
<echo message="do you need a 'pages' symlink?"/>
</target>

<target name="snapshot" description="update most recent version of robolectric as jars" depends="jar-all, check-for-pages-dir" if="pages.dir.exists">
<copy todir="pages/downloads">
<fileset dir="${target.dir}" includes="robolectric*.jar"/>
</copy>
<exec command="./update-downloads.rb"/>
<exec executable="./update-downloads.rb"/>
</target>

<target name="compile.tests" depends="compile"
Expand Down
23 changes: 2 additions & 21 deletions update-downloads.rb
Expand Up @@ -8,25 +8,6 @@ def need_pages_submodule
end
end

def doc
need_pages_submodule

puts 'Creating Jasmine Documentation'
require 'rubygems'
require 'jsdoc_helper'

FileUtils.rm_r "pages/jsdoc", :force => true

JsdocHelper::Rake::Task.new(:lambda_jsdoc) do |t|
t[:files] = jasmine_sources << jasmine_html_sources
t[:options] = "-a"
t[:out] = "pages/jsdoc"
# JsdocHelper bug: template must be relative to the JsdocHelper gem, ick
t[:template] = File.join("../".*(100), Dir::getwd, "jsdoc-template")
end
Rake::Task[:lambda_jsdoc].invoke
end

def fill_index_downloads
require 'digest/sha1'

Expand All @@ -35,9 +16,9 @@ def fill_index_downloads
sha1 = Digest::SHA1.hexdigest File.read(f)

fn = f.sub(/^pages\//, '')
match = /robolectric(-all)?-([0-9].*).jar/.match(f)
match = /robolectric(-all)?-([0-9].*)?.jar/.match(f)
version = "SNAPSHOT"
version = match[1] if match
version = match[2] if match
prerelease = /\.rc/.match(f)
download_html += prerelease ? "<tr class=\"rc\">\n" : "<tr>\n"
download_html += " <td class=\"link\"><a href=\"#{fn}\">#{fn.sub(/downloads\//, '')}</a></td>\n"
Expand Down

0 comments on commit d9b4b5f

Please sign in to comment.