diff --git a/bin/fumoffu b/bin/fumoffu index e0f5cd9..de1d36a 100755 --- a/bin/fumoffu +++ b/bin/fumoffu @@ -34,6 +34,11 @@ optparse = OptionParser.new do|opts| options[:bundle] = format end + options[:dependencies] = false + opts.on("-d", "--dependencies", "Download and install the dependencies") do + options[:dependencies] = true + end + # This displays the help screen, all programs are # assumed to have this option. opts.on( '-h', '--help', 'Display this screen' ) do @@ -44,6 +49,17 @@ end optparse.parse! +def jruby_jar + # we check if the jruby jar is in the libs if not we download it + if not File.exist? Fumoffu::Application.app_dir+"/interface/lib/java/jruby-complete.jar" then + puts "We download the last stable version of jruby-complete jar..." + sh "rake -f #{File.dirname(__FILE__)}/../tasks/rawr_bundle.rake rawr:get:current-stable-jruby" + sh "mv #{Fumoffu::Application.app_dir}/lib/java/jruby-complete.jar #{Fumoffu::Application.app_dir}/interface/lib" + sh "rmdir #{Fumoffu::Application.app_dir}/lib/java" + sh "rmdir #{Fumoffu::Application.app_dir}/lib" + end +end + begin if options[:install] then project_dir = "." @@ -58,7 +74,7 @@ begin # we add the missing gems puts "Installing default packages ..." Dir.chdir project_dir do - sh "bundle install" + sh "bundle install --path engine/lib/ruby" end exit end @@ -66,11 +82,7 @@ begin if not options[:bundle].nil? if bundle_format.include? options[:bundle].to_sym then task = nil - # we check if the jruby jar is in the libs if not we download it - if not File.exist? Fumoffu::Application.app_dir+"/lib/java/jruby-complete.jar" then - puts "We download the last stable version of jruby-complete jar..." - sh "rake -f #{File.dirname(__FILE__)}/../tasks/rawr_bundle.rake rawr:get:current-stable-jruby" - end + jruby_jar if options[:bundle] == :jar task = "rawr:jar" else @@ -81,6 +93,11 @@ begin end end + if options[:dependencies] then + jruby_jar + exit + end + puts "Invalid command line." end # diff --git a/fumoffu.gemspec b/fumoffu.gemspec index 315eb94..6647cf1 100644 --- a/fumoffu.gemspec +++ b/fumoffu.gemspec @@ -5,11 +5,11 @@ Gem::Specification.new do |s| s.name = %q{fumoffu} - s.version = "0.0.2" + s.version = "0.1.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Lionel Abderemane"] - s.date = %q{2011-02-24} + s.date = %q{2011-04-18} s.default_executable = %q{fumoffu} s.description = %q{I will make the description later} s.email = %q{alionel@gmail.com} @@ -32,31 +32,33 @@ Gem::Specification.new do |s| "lib/fumoffu/generators/fumoffu_generator.rb", "lib/fumoffu/generators/fumoffu_lib_generator.rb", "lib/fumoffu/generators/fumoffu_src_generator.rb", + "lib/fumoffu/generators/tasks/generator.rake", "lib/fumoffu/generators/tasks/install.rake", "lib/fumoffu/generators/tasks/package.rake", "lib/fumoffu/generators/templates/Gemfile", "lib/fumoffu/generators/templates/Rakefile", "lib/fumoffu/generators/templates/build_configuration.rb", - "lib/fumoffu/generators/templates/lib/java/AbsoluteLayout.jar", - "lib/fumoffu/generators/templates/lib/java/swing-layout.jar", + "lib/fumoffu/generators/templates/engine/config/initializers/app_classes.rb", + "lib/fumoffu/generators/templates/engine/config/initializers/configuration.rb", + "lib/fumoffu/generators/templates/engine/config/initializers/init.rb", + "lib/fumoffu/generators/templates/engine/config/initializers/java_classes.rb", + "lib/fumoffu/generators/templates/engine/config/initializers/ruby_classes.rb", + "lib/fumoffu/generators/templates/engine/src/actions/controllers/application_controller.rb", + "lib/fumoffu/generators/templates/engine/src/actions/handlers/application_handler.rb", + "lib/fumoffu/generators/templates/engine/src/main.rb", + "lib/fumoffu/generators/templates/engine/src/setup.rb", + "lib/fumoffu/generators/templates/engine/test/spec/spec_helper.rb", + "lib/fumoffu/generators/templates/interface/lib/AbsoluteLayout.jar", + "lib/fumoffu/generators/templates/interface/lib/SwingLayout.jar", + "lib/fumoffu/generators/templates/interface/src/org/github/bouba/fumoffu/ActionManager.java", + "lib/fumoffu/generators/templates/interface/src/org/github/bouba/fumoffu/UIActions.java", + "lib/fumoffu/generators/templates/interface/src/org/rubyforge/rawr/Main.java", "lib/fumoffu/generators/templates/scripts/package.sh", "lib/fumoffu/generators/templates/scripts/start.sh", - "lib/fumoffu/generators/templates/src/java/org/github/bouba/fumoffu/ActionManager.java", - "lib/fumoffu/generators/templates/src/java/org/github/bouba/fumoffu/UIActions.java", - "lib/fumoffu/generators/templates/src/java/org/rubyforge/rawr/Main.java", - "lib/fumoffu/generators/templates/src/ruby/app/actions/controllers/application_controller.rb", - "lib/fumoffu/generators/templates/src/ruby/app/actions/handlers/application_handler.rb", - "lib/fumoffu/generators/templates/src/ruby/app/main.rb", - "lib/fumoffu/generators/templates/src/ruby/app/setup.rb", - "lib/fumoffu/generators/templates/src/ruby/app/utils/component_search.rb", - "lib/fumoffu/generators/templates/src/ruby/config/configuration.rb", - "lib/fumoffu/generators/templates/src/ruby/config/initializers/app_classes.rb", - "lib/fumoffu/generators/templates/src/ruby/config/initializers/init.rb", - "lib/fumoffu/generators/templates/src/ruby/config/initializers/java_classes.rb", - "lib/fumoffu/generators/templates/src/ruby/config/initializers/ruby_classes.rb", "lib/fumoffu/handler.rb", "lib/fumoffu/java_mapping.rb", "lib/fumoffu/utils/component_search.rb", + "tasks/rawr_bundle.rake", "test/coverage/index.html", "test/coverage/jquery-1.3.2.min.js", "test/coverage/jquery.tablesorter.min.js", diff --git a/lib/fumoffu/generators/templates/Rakefile b/lib/fumoffu/generators/templates/Rakefile index cc17fe6..ddae37f 100644 --- a/lib/fumoffu/generators/templates/Rakefile +++ b/lib/fumoffu/generators/templates/Rakefile @@ -26,7 +26,7 @@ require 'rspec/core/rake_task' require 'yaml' Rake::RDocTask.new do |rdoc| - files =['README', 'LICENSE', 'lib/**/*.rb'] + files =['README', 'LICENSE', 'engine/lib/**/*.rb'] rdoc.rdoc_files.add(files) rdoc.main = "README" # page to start on rdoc.title = "Your project Docs" @@ -35,7 +35,7 @@ Rake::RDocTask.new do |rdoc| end Rake::TestTask.new do |t| - t.test_files = FileList['test/**/*.rb'] + t.test_files = FileList['engine/test/**/*.rb'] end #RSpec::Core::RakeTask.new do |t| @@ -45,7 +45,7 @@ end desc "Launch rspec tests" task :spec do - sh "jruby -S spec test/ruby/spec/ -c" + puts "Not working !!! use `jruby -S spec engine/test/spec/ -c` in a terminal " end # Setup default global constant env ||= ENV['env'] @@ -53,6 +53,7 @@ env = "development" unless env APP_ENV = env ROOT_DIR = File.dirname(__FILE__) +IS_FROM_JAR = false # import custom rake tasks -Dir.glob(File.dirname(__FILE__)+"/config/tasks/*.rake").each {|file| import file } \ No newline at end of file +Dir.glob(File.dirname(__FILE__)+"/engine/config/tasks/*.rake").each {|file| import file } \ No newline at end of file