Skip to content

Commit 90f1fa2

Browse files
author
Scooter Wadsworth
committed
Begin refactor of GeoTools jars into own gem
1 parent 2f3c4a0 commit 90f1fa2

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

lib/geoscript.rb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
$: << File.expand_path(File.dirname(__FILE__))
22
$: << File.expand_path(File.join(File.dirname(__FILE__), 'geoscript'))
33

4-
if defined?(JRUBY_VERSION)
4+
if defined? JRUBY_VERSION
55
require 'java'
6-
7-
Dir.entries(File.join(File.expand_path(File.dirname(__FILE__)), 'geotools')).sort.each do |entry|
8-
if entry =~ /.jar$/
9-
$CLASSPATH << File.join(File.expand_path(File.dirname(__FILE__)), "/geotools/#{entry}")
10-
end
11-
end
12-
13-
java_import org.geotools.factory.Hints
14-
15-
unless java.lang.System.get_property('org.geotools.referencing.forceXY') == 'true'
16-
java.lang.System.set_property 'org.geotools.referencing.forceXY', 'true'
17-
end
18-
19-
Hints.put_system_default Hints::FORCE_LONGITUDE_FIRST_AXIS_ORDER, java.lang.Boolean.new(true)
6+
require 'geoscript/jars'
207

218
require 'geoscript/version'
229
require 'geoscript/util'
@@ -29,3 +16,15 @@
2916
else
3017
warn "GeoScript requires JRuby (http://jruby.org)"
3118
end
19+
20+
module GeoScript
21+
class << self
22+
def version
23+
VERSION
24+
end
25+
26+
def geotools_version
27+
GEOTOOLS_VERSION
28+
end
29+
end
30+
end

lib/geoscript/jars.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
jars_path = File.join(File.expand_path(File.dirname(__FILE__)), '..', '..', 'geotools-libs')
2+
3+
Dir.entries(jars_path).sort.each do |entry|
4+
$CLASSPATH << File.join(jars_path, entry) if entry =~ /.jar$/
5+
end
6+
7+
java_import org.geotools.factory.Hints
8+
9+
unless java.lang.System.get_property("org.geotools.referencing.forceXY") == 'true'
10+
java.lang.System.set_property 'org.geotools.referencing.forceXY', 'true'
11+
end
12+
13+
Hints.put_system_default Hints::FORCE_LONGITUDE_FIRST_AXIS_ORDER, java.lang.Boolean.new(true)
14+
15+
module GeoScript
16+
GEOTOOLS_VERSION = '10.0'
17+
end

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<version>0.0.1-SNAPSHOT</version>
88

99
<properties>
10-
<gt.version>9.0</gt.version>
10+
<gt.version>10.0</gt.version>
1111
</properties>
1212

1313
<repositories>
@@ -67,7 +67,7 @@
6767
<plugin>
6868
<artifactId>maven-dependency-plugin</artifactId>
6969
<configuration>
70-
<outputDirectory>${basedir}/lib/geotools</outputDirectory>
70+
<outputDirectory>${basedir}/geotools-libs</outputDirectory>
7171
</configuration>
7272
<executions>
7373
<execution>

0 commit comments

Comments
 (0)