Skip to content

Commit

Permalink
got everything working properly except rake server,
Browse files Browse the repository at this point in the history
which does not recognize whether something needs to be recompiled or not correctly anymore(this is a regression, because it use to work.
  • Loading branch information
baroquebobcat committed Feb 15, 2011
1 parent ce3801e commit 32feb42
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 31 deletions.
7 changes: 6 additions & 1 deletion Gemfile
@@ -1,3 +1,8 @@
source :gemcutter

gemspec
gemspec

#gem 'mirah', '0.0.6', :path => '../mirah'#, :git => 'git://github.com/mirah/mirah.git'
gem 'mirah_model', "0.0.1", :path => '../mirah_model'

gem 'rake'
1 change: 1 addition & 0 deletions README.rdoc
Expand Up @@ -53,6 +53,7 @@ http://code.google.com/appengine/docs/java/configyaml/appconfig_yaml.html
mkdir -p ~/mystuff; cd ~/mystuff
git clone http://github.com/headius/bitescript.git
git clone http://github.com/mirah/mirah.git
git clone http://github.com/mirah/mirah_model.git
git clone http://github.com/mirah/dubious.git

* Then build and install the gems for Mirah, Bitescript and Dubious
Expand Down
16 changes: 10 additions & 6 deletions Rakefile
Expand Up @@ -16,15 +16,13 @@ Gem::PackageTask.new Gem::Specification.load('dubious.gemspec') do |pkg|
pkg.need_tar = true
end

task :gem => :jar

require 'dubious_tasks'

OUTDIR = File.expand_path 'build'
SRCDIR = File.expand_path 'src'

CLEAN.include(OUTDIR)
CLOBBER.include("lib/dubious.jar")
CLOBBER.include("lib/dubious.jar", "javalib/mirahdatastore.jar")

def class_files_for files
files.map do |f|
Expand All @@ -35,7 +33,6 @@ def class_files_for files
end
end

#MODEL_JAR = "#{OUTDIR}/dubydatastore.jar"
LIB_MIRAH_SRC = Dir["src/**/*{.duby,.mirah}"]
LIB_JAVA_SRC = Dir["src/**/*.java"]

Expand Down Expand Up @@ -87,6 +84,13 @@ task :compile => LIB_CLASSES
desc "compiles jar for gemification"
task :jar => "lib/dubious.jar"

desc "pull dependencies"
task :dependencies => 'javalib/mirahdatastore.jar'

file 'javalib/mirahdatastore.jar' do
cp Gem.find_files('mirahdatastore.jar'), 'javalib/'
end

namespace :compile do
task :dubious => "lib/dubious.jar"
task :java => OUTDIR do
Expand All @@ -100,7 +104,7 @@ end
directory OUTDIR

(LIB_CLASSES).zip(LIB_SRC).each do |klass,src|
file klass => src
file klass => [:dependencies, src]
end

task :generate_build_properties do
Expand All @@ -118,7 +122,7 @@ task :generate_build_properties do
dubious_data = git_data(".")
mirah_data = git_data(MIRAH_HOME)
bite_data = git_data(MIRAH_HOME + '/../bitescript')
model_data = git_data(File.dirname(MODEL_SRC_JAR),File.basename(MODEL_SRC_JAR))
model_data = git_data(File.dirname(Gem.find_files('mirahdatastore.jar')),'mirahdatastore.jar')

prop_file = "config/build.properties"
File.open(prop_file, 'w') do |f|
Expand Down
8 changes: 6 additions & 2 deletions dubious.gemspec
Expand Up @@ -12,7 +12,10 @@ Gem::Specification.new do |s|
s.date = Time.now.strftime("YYYY-MM-DD")
s.description = %q{Dubious is a web framework written in Mirah.}
s.executables = ["dubious"]
s.files = Dir["{bin,lib,test,examples,javalib}/**/*","{*.txt,Rakefile}"]
s.files = Dir["{bin,lib,test,examples,javalib}/**/*","{*.txt,Rakefile}"] + [
'lib/dubious.jar',
'javalib/mirahdatastore.jar'
]
s.homepage = %q{http://github.com/mirah/dubious/}
s.extra_rdoc_files = ["LICENSE", "ROADMAP.rdoc", "README.rdoc"]
s.rdoc_options = ["--main", "README.rdoc"]
Expand All @@ -22,6 +25,7 @@ Gem::Specification.new do |s|
s.add_dependency("thor","0.13.8")
s.add_dependency("activesupport")
s.add_dependency("i18n")
s.add_dependency("mirah", "0.0.5")
s.add_dependency("mirah", "0.0.5")
s.add_dependency("mirah_model", "0.0.1")
s.add_dependency("appengine-sdk", "~> 1.4.0")
end
2 changes: 1 addition & 1 deletion examples/contacts/Rakefile
Expand Up @@ -26,7 +26,7 @@ def class_files_for files
end
end

MODEL_JAR = "WEB-INF/lib/dubydatastore.jar"
MODEL_JAR = "WEB-INF/lib/mirahdatastore.jar"

LIB_MIRAH_SRC = Dir["lib/**/*.{duby,mirah}"]
LIB_JAVA_SRC = Dir["lib/**/*.java"]
Expand Down
2 changes: 1 addition & 1 deletion examples/shout/Rakefile
Expand Up @@ -14,7 +14,7 @@ mirah_compile_options :dest_path => OUTDIR,
:source_paths => '.',
:compiler_options => ['--classpath', [File.expand_path(OUTDIR), *FileList["WEB-INF/lib/*.jar"].map{|f|File.expand_path(f)}].join(':') + ':' + CLASSPATH]

MODEL_JAR = "WEB-INF/lib/dubydatastore.jar"
MODEL_JAR = "WEB-INF/lib/mirahdatastore.jar"

CLEAN.include(OUTDIR)
CLOBBER.include("WEB-INF/lib/dubious.jar", 'WEB-INF/appengine-generated')
Expand Down
Binary file removed javalib/dubydatastore.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/dubious/cli/init.rb
Expand Up @@ -26,8 +26,8 @@ def cp_dubious_jar
copy_file '../../../dubious.jar', "#{name}/WEB-INF/lib/dubious.jar"
end

def cp_dubydatastore_jar
copy_file '../../../../javalib/dubydatastore.jar', "#{name}/WEB-INF/lib/dubydatastore.jar"
def cp_mirahdatastore_jar
copy_file '../../../../javalib/mirahdatastore.jar', "#{name}/WEB-INF/lib/mirahdatastore.jar"
end

end
Expand Down
6 changes: 3 additions & 3 deletions lib/dubious/templates/base/Rakefile
Expand Up @@ -10,7 +10,7 @@ require 'dubious_tasks'

OUTDIR = 'WEB-INF/classes'
CLEAN.include(OUTDIR)
CLOBBER.include("WEB-INF/lib/dubious.jar", 'WEB-INF/appengine-generated')
CLOBBER.include('WEB-INF/appengine-generated')


mirah_compile_options :dest_path => OUTDIR,
Expand All @@ -26,7 +26,7 @@ def class_files_for files
end
end

MODEL_JAR = "WEB-INF/lib/dubydatastore.jar"
MODEL_JAR = "WEB-INF/lib/mirahdatastore.jar"

LIB_MIRAH_SRC = Dir["lib/**/*.{duby,mirah}"]
LIB_JAVA_SRC = Dir["lib/**/*.java"]
Expand Down Expand Up @@ -63,7 +63,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, '', '.' => APP_CLASSES+LIB_CLASSES

namespace :compile do
task :app => APP_CLASSES
Expand Down
19 changes: 7 additions & 12 deletions lib/dubious_tasks.rb
Expand Up @@ -82,6 +82,7 @@ def update
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}"
Expand Down Expand Up @@ -129,15 +130,10 @@ def webinf_lib_jars
end
end

def appengine_app(*args, &block)
deps = []
if args[-1].kind_of?(Hash)
hash = args.pop
arg = hash.keys[0]
deps = hash[arg]
args << arg
end
name, src, war = args
def appengine_app(name,src,hash={}, &block)
war = hash.keys.first
deps = hash[war] || []

task = AppEngine::Rake::AppEngineTask.define_task(name => deps, &block)
src = File.expand_path(src || 'src')
war = File.expand_path(war || 'war')
Expand Down Expand Up @@ -189,10 +185,9 @@ def mirahc *files

CLASSPATH = [SERVLET_JAR, AppEngine::SDK::API_JAR].join(":")

MIRAH_HOME = ENV['MIRAH_HOME'] ? ENV['MIRAH_HOME'] : Gem.find_files('mirah').first.sub(/lib\/mirah.rb/,'')
MODEL_SRC_JAR = File.dirname(Gem.find_files('dubious.rb').first) + '/../javalib/mirahdatastore.jar'

MODEL_SRC_JAR = File.join(MIRAH_HOME, 'examples', 'appengine', 'war',
'WEB-INF', 'lib', 'dubydatastore.jar')
MIRAH_HOME = ENV['MIRAH_HOME'] ? ENV['MIRAH_HOME'] : Gem.find_files('mirah').first.sub(/lib\/mirah.rb/,'')

task :publish => :upload

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -5,7 +5,7 @@

require AppEngine::SDK::SDK_ROOT + '/lib/shared/geronimo-servlet_2.5_spec-1.2.jar'
require File.dirname(__FILE__)+'/../lib/dubious.jar'
require File.dirname(__FILE__)+'/../javalib/dubydatastore.jar'
require File.dirname(__FILE__)+'/../javalib/mirahdatastore.jar'

import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletRequest
Expand Down
2 changes: 1 addition & 1 deletion src/dubious/action_controller.mirah
@@ -1,4 +1,4 @@
import com.google.appengine.ext.duby.db.Model
import com.google.appengine.ext.mirah.db.Model
import javax.servlet.ServletConfig
import javax.servlet.http.*
import java.util.regex.Pattern
Expand Down
2 changes: 1 addition & 1 deletion src/dubious/form_helper.mirah
@@ -1,4 +1,4 @@
import com.google.appengine.ext.duby.db.Model
import com.google.appengine.ext.mirah.db.Model
import dubious.TimeConversion
import dubious.InstanceTag
import java.util.HashMap
Expand Down

0 comments on commit 32feb42

Please sign in to comment.