Skip to content

Instantly share code, notes, and snippets.

@stepheneb
Created September 12, 2010 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stepheneb/575897 to your computer and use it in GitHub Desktop.
Save stepheneb/575897 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'fileutils'
sensor_applets_path = File.expand_path('../java/sensor-applets', __FILE__)
# sensor_applets_path = '/Users/stephen/dev/test/sensor-applet/java/sensor-applets'
destination_root = '/Users/stephen/dev/test/sensor3/public/jnlp/'
Dir.chdir(sensor_applets_path) { `mvn clean; mvn package` }
source = sensor_applets_path + '/target/sensor-applets-0.1.0-SNAPSHOT.jar'
to_path = destination_root + 'org/concord/sensor/sensor-applets/'
new_jar_index = Dir["#{to_path}/*__*.jar"].sort.last[/-(\d+)\.jar$/, 1].to_i + 1
version_str = '__V0.1.0-' + Time.now.strftime("%Y%m%d.%H%M%S") + "-#{new_jar_index}"
versioned_name = 'sensor-applets' + version_str + '.jar'
destination = to_path + versioned_name
FileUtils.cp(source, destination)
Dir.chdir(to_path) do
`pack200 --repack #{versioned_name}`
`jarsigner -storepass <password> #{versioned_name} <domain>`
`pack200 --strip-debug #{versioned_name}.pack.gz #{versioned_name}`
end
#!/usr/bin/env ruby
require 'fileutils'
destination_root = '/Users/stephen/dev/test/sensor3/public/jnlp/'
%w{ppc7400 i386 x86_64}.each do |arch|
source = "target/vernier-goio-macosx-#{arch}-nar.jar"
to_path = destination_root + 'org/concord/sensor/vernier/vernier-goio/'
new_jar_index = Dir["#{to_path}/*__*.jar"].sort.last[/-(\d+)\.jar$/, 1].to_i + 1
version_str = '__V0.1.0-' + Time.now.strftime("%Y%m%d.%H%M%S") + "-#{new_jar_index}"
versioned_name = "vernier-goio-macosx-#{arch}-nar" + version_str + '.jar'
destination = to_path + versioned_name
FileUtils.cp(source, destination)
Dir.chdir(to_path) do
`pack200 --repack #{versioned_name}`
`jarsigner -storepass <password> #{versioned_name} <domain>`
`pack200 --strip-debug #{versioned_name}.pack.gz #{versioned_name}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment