Permalink
Browse files

initial ugly fix for rake server

  • Loading branch information...
baroquebobcat committed Feb 23, 2011
1 parent dadd683 commit d51cfdb7a78270865ed17623832f759097bf63ec
Showing with 23 additions and 22 deletions.
  1. +10 −7 examples/contacts/Rakefile
  2. +8 −5 lib/dubious/templates/base/Rakefile
  3. +5 −10 lib/dubious_tasks.rb
View
@@ -10,12 +10,15 @@ require 'dubious_tasks'
OUTDIR = 'WEB-INF/classes'
CLEAN.include(OUTDIR)
-CLOBBER.include("WEB-INF/lib/dubious.jar", 'WEB-INF/appengine-generated')
-
-
-mirah_compile_options :dest_path => OUTDIR,
- :source_paths => ['lib', 'app' ],
- :compiler_options => ['--classpath', [File.expand_path(OUTDIR), *FileList["WEB-INF/lib/*.jar"].map{|f|File.expand_path(f)}].join(':') + ':' + CLASSPATH ]
+CLOBBER.include('WEB-INF/appengine-generated')
+
+task :set_compile_options do |t|
+ def t.needed?;false;end
+
+ mirah_compile_options :dest_path => OUTDIR,
+ :source_paths => [File.expand_path('lib'), File.expand_path('app') ],
+ :compiler_options => ['--classpath', [File.expand_path(OUTDIR), *FileList["WEB-INF/lib/*.jar"].map{|f|File.expand_path(f)}].join(':') + ':' + CLASSPATH ]
+end
def class_files_for files
files.map do |f|
@@ -63,7 +66,7 @@ file MODEL_JAR => MODEL_SRC_JAR do |t|
cp MODEL_SRC_JAR, MODEL_JAR
end
-appengine_app :app, 'app', '' => APP_CLASSES+LIB_CLASSES
+appengine_app :app, '', '.' => [:set_compile_options] + APP_CLASSES + LIB_CLASSES
namespace :compile do
task :app => APP_CLASSES
@@ -12,10 +12,13 @@ OUTDIR = 'WEB-INF/classes'
CLEAN.include(OUTDIR)
CLOBBER.include('WEB-INF/appengine-generated')
-
-mirah_compile_options :dest_path => OUTDIR,
- :source_paths => ['lib', 'app' ],
- :compiler_options => ['--classpath', [File.expand_path(OUTDIR), *FileList["WEB-INF/lib/*.jar"].map{|f|File.expand_path(f)}].join(':') + ':' + CLASSPATH ]
+task :set_compile_options do |t|
+ def t.needed?;false;end
+
+ mirah_compile_options :dest_path => OUTDIR,
+ :source_paths => [File.expand_path('lib'), File.expand_path('app') ],
+ :compiler_options => ['--classpath', [File.expand_path(OUTDIR), *FileList["WEB-INF/lib/*.jar"].map{|f|File.expand_path(f)}].join(':') + ':' + CLASSPATH ]
+end
def class_files_for files
files.map do |f|
@@ -63,7 +66,7 @@ file MODEL_JAR => MODEL_SRC_JAR do |t|
cp MODEL_SRC_JAR, MODEL_JAR
end
-appengine_app :app, '', '.' => APP_CLASSES+LIB_CLASSES
+appengine_app :app, '', '.' => [:set_compile_options] + APP_CLASSES + LIB_CLASSES
namespace :compile do
task :app => APP_CLASSES
View
@@ -81,16 +81,11 @@ def update
begin
timestamp = app_yaml_timestamp
@last_app_yaml_timestamp ||= timestamp
- updated = false
- names = real_prerequisites.select {|r|r.needed?}.map &:name
- real_prerequisites.each do |dep|
- if dep.needed?
- puts "Executing #{dep.name}"
- dep.execute
- updated = true
- end
- end
- if updated || (timestamp != @last_app_yaml_timestamp)
+
+ needed_prerequisites = real_prerequisites.select {|r|r.needed?}
+
+ needed_prerequisites.each {|dep| dep.execute }
+ unless needed_prerequisites.empty? && timestamp == @last_app_yaml_timestamp
begin
open('http://localhost:8080/_ah/reloadwebapp')
@last_app_yaml_timestamp = timestamp

0 comments on commit d51cfdb

Please sign in to comment.