Title: [740] trunk/activerecord-jdbc/drivers/mysql: Add mysql gem packaging
Revision
740
Author
nicksieger
Date
2007-09-11 02:35:49 -0400 (Tue, 11 Sep 2007)

Log Message

Add mysql gem packaging

Modified Paths


Added Paths

Property Changed

Diff

Property changes: trunk/activerecord-jdbc/drivers/mysql


Name: svn:ignore
   + Manifest.txt
pkg

Added: trunk/activerecord-jdbc/drivers/mysql/LICENSE.txt (0 => 740)


--- trunk/activerecord-jdbc/drivers/mysql/LICENSE.txt	                        (rev 0)
+++ trunk/activerecord-jdbc/drivers/mysql/LICENSE.txt	2007-09-11 06:35:49 UTC (rev 740)
@@ -0,0 +1 @@
+This gem bundles the MySQL JDBC driver/connector for Java.  The MySQL connector is available from MySQL AB under the terms of the GPL, see http://www.gnu.org/copyleft/gpl.html for details.
\ No newline at end of file

Modified: trunk/activerecord-jdbc/drivers/mysql/Rakefile (739 => 740)


--- trunk/activerecord-jdbc/drivers/mysql/Rakefile	2007-09-11 06:08:00 UTC (rev 739)
+++ trunk/activerecord-jdbc/drivers/mysql/Rakefile	2007-09-11 06:35:49 UTC (rev 740)
@@ -1,96 +1,24 @@
-require 'rake'
-require 'rake/testtask'
+MANIFEST = FileList["Manifest.txt", "Rakefile", "LICENSE.txt", "lib/**/*"]
 
-task :default => [:java_compile, :test]
-
-def java_classpath_arg # myriad of ways to discover JRuby classpath
-  begin
-    require 'java' # already running in a JRuby JVM
-    jruby_cpath = Java::java.lang.System.getProperty('java.class.path')
-  rescue LoadError
-  end
-  unless jruby_cpath
-    jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
-      FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
-  end
-  cpath_arg = jruby_cpath ? "-cp #{jruby_cpath}" : ""
-end
-
-desc "Compile the native Java code."
-task :java_compile do
-  mkdir_p "pkg/classes"
-  sh "javac -target 1.4 -source 1.4 -d pkg/classes #{java_classpath_arg} #{FileList['src/java/**/*.java'].join(' ')}"
-  sh "jar cf lib/jdbc_adapter_internal.jar -C pkg/classes/ ."
-end
-file "lib/jdbc_adapter_internal.jar" => :java_compile
-
-task :more_clean do
-  rm_rf FileList['derby*']
-  rm_rf FileList['test.db.*']
-  rm_rf "test/reports"
-  rm_f FileList['lib/*.jar']
-end
-
-task :clean => :more_clean
-
-task :filelist do
-  puts FileList['pkg/**/*'].inspect
-end
-
-desc "Run AR-JDBC tests"
-if RUBY_PLATFORM =~ /java/
-  # TODO: add more databases into the standard tests here.
-  task :test => [:test_mysql, :test_jdbc, :test_derby, :test_hsqldb]
-else
-  task :test => [:test_mysql]
-end
-
-%w(mysql postgres derby).each do |driver|
-  Rake::TestTask.new("test_#{driver}") do |t|
-    t.test_files = FileList["test/#{driver}_*_test.rb"]
-    t.test_files << 'test/activerecord/connection_adapters/type_conversion_test.rb' if driver == "derby"
-    t.libs << 'test' << "driver/#{driver}/test"
-  end
-end
-
-Rake::TestTask.new(:test_jdbc) do |t|
-  t.test_files = FileList['test/generic_jdbc_connection_test.rb']
-  t.libs << 'test' << "driver/mysql/test"
-end
-
-Rake::TestTask.new(:test_hsqldb) do |t|
-  t.test_files = FileList['test/hsqldb_simple_test.rb']
-  t.libs << 'test'
-end
-
-task :test_pgsql => :test_postgresql
-
-Rake::TestTask.new(:test_jndi) do |t|
-  t.test_files = FileList['test/jndi_test.rb']
-  t.libs << 'test'
-end
-
-MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", 
-  "Rakefile", "LICENSE", "lib/**/*.rb", "lib/jdbc_adapter_internal.jar", "test/**/*.rb", "lib/**/*.rake",
-  "src/**/*.java"]
-
 file "Manifest.txt" => :manifest
 task :manifest do
   File.open("Manifest.txt", "w") {|f| MANIFEST.each {|n| f << "#{n}\n"} }
 end
 Rake::Task['manifest'].invoke # Always regen manifest, so Hoe has up-to-date list of files
 
+require File.dirname(__FILE__) + "/../../lib/jdbc_adapter/version"
+$LOAD_PATH << "lib"
+require "mysql"
 begin
   require 'hoe'
-  require File.dirname(__FILE__) + "/lib/jdbc_adapter/version"
-  Hoe.new("ActiveRecord-JDBC", JdbcAdapter::Version::VERSION) do |p|
+  Hoe.new("jdbc-mysql", MYSQL_VERSION) do |p|
     p.rubyforge_name = "jruby-extras"
     p.url = ""
     p.author = "Nick Sieger, Ola Bini and JRuby contributors"
     p.email = "[EMAIL PROTECTED], [EMAIL PROTECTED]"
-    p.summary = "JDBC adapter for ActiveRecord, for use within JRuby on Rails."
-    p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
-    p.description = p.paragraphs_of('README.txt', 0...1).join("\n\n")
+    p.summary = "MySQL JDBC driver for Java and MySQL/ActiveRecord-JDBC."
+    p.changes = "Updated to MySQL connector version #{MYSQL_VERSION}."
+    p.description = "Install this gem and require 'mysql' within JRuby to load the driver."
   end.spec.dependencies.delete_if { |dep| dep.name == "hoe" }
 rescue LoadError
   puts "You really need Hoe installed to be able to package this gem"

Modified: trunk/activerecord-jdbc/drivers/mysql/lib/mysql.rb (739 => 740)


--- trunk/activerecord-jdbc/drivers/mysql/lib/mysql.rb	2007-09-11 06:08:00 UTC (rev 739)
+++ trunk/activerecord-jdbc/drivers/mysql/lib/mysql.rb	2007-09-11 06:35:49 UTC (rev 740)
@@ -1 +1,2 @@
-require 'mysql-connector-java-5.0.4-bin.jar'
\ No newline at end of file
+MYSQL_VERSION = "5.0.4"
+require "mysql-connector-java-#{MYSQL_VERSION}-bin.jar"
\ No newline at end of file
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to