From 9abc5c1c92726eeed3da16f965823e35855964d2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 7 May 2014 00:29:10 +0200 Subject: [PATCH] Separated the Java and C ext codebases. --- .gitignore | 4 ++-- MANIFEST | 21 ++++++++++---------- Rakefile | 12 +++++++---- ext/{liboga => c}/extconf.rb | 0 ext/{liboga => c}/lexer.h | 0 ext/{liboga => c}/lexer.rl | 0 ext/{liboga => c}/liboga.c | 0 ext/{liboga => c}/liboga.h | 0 ext/{liboga => c}/xml.c | 0 ext/{liboga => c}/xml.h | 0 ext/{liboga => java}/LibogaService.java | 0 ext/{liboga => java}/org/liboga/xml/Lexer.rl | 0 oga.gemspec | 2 +- task/lexer.rake | 4 ++-- 14 files changed, 24 insertions(+), 19 deletions(-) rename ext/{liboga => c}/extconf.rb (100%) rename ext/{liboga => c}/lexer.h (100%) rename ext/{liboga => c}/lexer.rl (100%) rename ext/{liboga => c}/liboga.c (100%) rename ext/{liboga => c}/liboga.h (100%) rename ext/{liboga => c}/xml.c (100%) rename ext/{liboga => c}/xml.h (100%) rename ext/{liboga => java}/LibogaService.java (100%) rename ext/{liboga => java}/org/liboga/xml/Lexer.rl (100%) diff --git a/.gitignore b/.gitignore index 02b6814..b1b1efe 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,5 @@ profile/samples/*/*.txt *.so tmp -ext/liboga/lexer.c -ext/liboga/org/liboga/xml/Lexer.java +ext/c/lexer.c +ext/java/org/liboga/xml/Lexer.java diff --git a/MANIFEST b/MANIFEST index 2bcc028..f6385db 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5,16 +5,17 @@ README.md doc/DCO.md doc/changelog.md doc/css/common.css -ext/liboga/LibogaService.java -ext/liboga/extconf.rb -ext/liboga/lexer.c -ext/liboga/lexer.h -ext/liboga/lexer.rl -ext/liboga/liboga.c -ext/liboga/liboga.h -ext/liboga/org/liboga/xml/Lexer.java -ext/liboga/xml.c -ext/liboga/xml.h +ext/c/extconf.rb +ext/c/lexer.c +ext/c/lexer.h +ext/c/lexer.rl +ext/c/liboga.c +ext/c/liboga.h +ext/c/xml.c +ext/c/xml.h +ext/java/LibogaService.java +ext/java/org/liboga/xml/Lexer.java +ext/java/org/liboga/xml/Lexer.rl lib/oga.rb lib/oga/html/parser.rb lib/oga/version.rb diff --git a/Rakefile b/Rakefile index 24d5794..ec5c2b2 100644 --- a/Rakefile +++ b/Rakefile @@ -7,11 +7,15 @@ GEMSPEC = Gem::Specification.load('oga.gemspec') if RUBY_PLATFORM == 'java' require 'rake/javaextensiontask' - Rake::JavaExtensionTask.new('liboga', GEMSPEC) + Rake::JavaExtensionTask.new('liboga', GEMSPEC) do |task| + task.ext_dir = 'ext/java' + end else require 'rake/extensiontask' - Rake::ExtensionTask.new('liboga', GEMSPEC) + Rake::ExtensionTask.new('liboga', GEMSPEC) do |task| + task.ext_dir = 'ext/c' + end end PARSER_OUTPUT = 'lib/oga/xml/parser.rb' @@ -24,8 +28,8 @@ CLEAN.include( 'profile/samples/**/*.txt', 'lib/liboga.*', 'tmp', - 'ext/liboga/lexer.c', - 'ext/liboga/org/liboga/xml/Lexer.java' + 'ext/c/lexer.c', + 'ext/java/org/liboga/xml/Lexer.java' ) FILE_LIST = FileList.new( diff --git a/ext/liboga/extconf.rb b/ext/c/extconf.rb similarity index 100% rename from ext/liboga/extconf.rb rename to ext/c/extconf.rb diff --git a/ext/liboga/lexer.h b/ext/c/lexer.h similarity index 100% rename from ext/liboga/lexer.h rename to ext/c/lexer.h diff --git a/ext/liboga/lexer.rl b/ext/c/lexer.rl similarity index 100% rename from ext/liboga/lexer.rl rename to ext/c/lexer.rl diff --git a/ext/liboga/liboga.c b/ext/c/liboga.c similarity index 100% rename from ext/liboga/liboga.c rename to ext/c/liboga.c diff --git a/ext/liboga/liboga.h b/ext/c/liboga.h similarity index 100% rename from ext/liboga/liboga.h rename to ext/c/liboga.h diff --git a/ext/liboga/xml.c b/ext/c/xml.c similarity index 100% rename from ext/liboga/xml.c rename to ext/c/xml.c diff --git a/ext/liboga/xml.h b/ext/c/xml.h similarity index 100% rename from ext/liboga/xml.h rename to ext/c/xml.h diff --git a/ext/liboga/LibogaService.java b/ext/java/LibogaService.java similarity index 100% rename from ext/liboga/LibogaService.java rename to ext/java/LibogaService.java diff --git a/ext/liboga/org/liboga/xml/Lexer.rl b/ext/java/org/liboga/xml/Lexer.rl similarity index 100% rename from ext/liboga/org/liboga/xml/Lexer.rl rename to ext/java/org/liboga/xml/Lexer.rl diff --git a/oga.gemspec b/oga.gemspec index a0d18e7..01a265c 100644 --- a/oga.gemspec +++ b/oga.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.platform = 'java' else - s.extensions = ['ext/liboga/extconf.rb'] + s.extensions = ['ext/c/extconf.rb'] end s.has_rdoc = 'yard' diff --git a/task/lexer.rake b/task/lexer.rake index d75b72c..9f4a190 100644 --- a/task/lexer.rake +++ b/task/lexer.rake @@ -26,6 +26,6 @@ end desc 'Generates the lexers' multitask :lexer => [ - 'ext/liboga/lexer.c', - 'ext/liboga/org/liboga/xml/Lexer.java' + 'ext/c/lexer.c', + 'ext/java/org/liboga/xml/Lexer.java' ]