Skip to content

Commit

Permalink
Add configuration option to set MANIFEST.MF.
Browse files Browse the repository at this point in the history
Add manifest_file configuration option in warble.rb that
specifies a path to a file containing entries that will
be added to the MANIFEST.MF.

[Also, use config.manifest_file in the warble.rb template.]

Signed-off-by: Nick Sieger <nick@nicksieger.com>
  • Loading branch information
Tommy McGuire authored and nicksieger committed Nov 9, 2008
1 parent 2026761 commit 761de7b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion generators/warble/templates/warble.rb
Expand Up @@ -59,6 +59,10 @@
# of RAILS_ROOT
# config.war_name = "mywar"

# Name of the MANIFEST.MF template for the war file. Defaults to the
# MANIFEST.MF normally generated by `jar cf`.
# config.manifest_file = "config/MANIFEST.MF"

# Value of RAILS_ENV for the webapp -- default as shown below
# config.webxml.rails.env = ENV['RAILS_ENV'] || 'production'

Expand All @@ -79,4 +83,4 @@

# JNDI data source name
# config.webxml.jndi = 'jdbc/rails'
end
end
4 changes: 4 additions & 0 deletions lib/warbler/config.rb
Expand Up @@ -59,6 +59,10 @@ class Config
# the Rails application
attr_accessor :war_name

# Name of the MANIFEST.MF template. Defaults to the MANIFEST.MF normally generated
# by jar -cf....
attr_accessor :manifest_file

# Extra configuration for web.xml. Controls how the dynamically-generated web.xml
# file is generated.
#
Expand Down
5 changes: 3 additions & 2 deletions lib/warbler/task.rb
Expand Up @@ -172,7 +172,8 @@ def define_jar_task
task "jar" do
war_path = "#{config.war_name}.war"
war_path = File.join(config.autodeploy_dir, war_path) if config.autodeploy_dir
sh "jar cf #{war_path} -C #{config.staging_dir} ."
flags, manifest = config.manifest_file ? ["cfm", config.manifest_file] : ["cf", ""]
sh "jar #{flags} #{war_path} #{manifest} -C #{config.staging_dir} ."
end
end
end
Expand Down Expand Up @@ -331,4 +332,4 @@ def apply_pathmaps(file, pathmaps)
file
end
end
end
end

0 comments on commit 761de7b

Please sign in to comment.