Skip to content

Commit 7344bae

Browse files
committed
Various cleanups
1 parent e5d04a3 commit 7344bae

19 files changed

+445
-465
lines changed

pom.rb

Lines changed: 69 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# frozen_string_literal: true
2-
31
project 'jruby_art', 'https://github.com/ruby-processing/JRubyArt' do
2+
43
model_version '4.0.0'
54
id 'ruby-processing:jruby_art:2.5.0'
65
packaging 'jar'
76

87
description 'Jar for JRubyArt'
98

109
{
11-
'monkstone' => 'Martin Prout', 'benfry' => 'Ben Fry',
12-
'REAS' => 'Casey Reas', 'codeanticode' => 'Andres Colubri'
10+
'monkstone' => 'Martin Prout', 'sampottinger' => 'Sam Pottinger',
11+
'benfry' => 'Ben Fry', 'REAS' => 'Casey Reas', 'codeanticode' => 'Andres Colubri'
1312
}.each do |key, value|
1413
developer key do
1514
name value
@@ -19,79 +18,75 @@
1918

2019
issue_management 'https://github.com/ruby-processing/JRubyArt/issues', 'Github'
2120

22-
source_control(url: 'https://github.com/ruby-processing/JRubyArt',
23-
connection: 'scm:git:git://github.com/ruby-processing/JRubyArt.git',
24-
developer_connection: 'scm:git:git@github.com/ruby-processing/JRubyArt.git')
21+
source_control( :url => 'https://github.com/ruby-processing/JRubyArt',
22+
:connection => 'scm:git:git://github.com/ruby-processing/JRubyArt.git',
23+
:developer_connection => 'scm:git:git@github.com/ruby-processing/JRubyArt.git' )
2524

26-
properties('processing.api' => 'http://processing.github.io/processing-javadocs/core/',
27-
'source.directory' => 'src',
28-
'polyglot.dump.pom' => 'pom.xml',
29-
'project.build.sourceEncoding' => 'UTF-8',
30-
'jruby_art.basedir' => '${project.basedir}',
31-
'jogl.version' => '2.3.2',
32-
'batik.version' => '1.14',
33-
'itextpdf.version' => '5.5.13.2',
34-
'jruby.api' => 'http://jruby.org/apidocs/')
25+
properties( 'jruby_art.basedir' => '${project.basedir}',
26+
'processing.api' => 'http://processing.github.io/processing-javadocs/core/',
27+
'source.directory' => 'src',
28+
'polyglot.dump.pom' => 'pom.xml',
29+
'project.build.sourceEncoding' => 'UTF-8',
30+
'jogl.version' => '2.3.2',
31+
'itextpdf.version' => '5.5.13.2',
32+
'batik.version' => '1.14',
33+
'jruby.api' => 'http://jruby.org/apidocs/' )
3534

36-
pom 'org.jruby:jruby:9.2.17.0'
37-
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
38-
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
39-
jar 'org.processing:video:3.0.2'
40-
jar 'org.apache.xmlgraphics:batik-all:${batik.version}'
41-
jar 'com.itextpdf:itextpdf:${itextpdf.version}'
35+
pom 'org.jruby:jruby:9.2.17.0'
36+
jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
37+
jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
38+
jar 'org.processing:video:3.0.2'
39+
jar 'org.apache.xmlgraphics:batik-all:${batik.version}'
40+
jar 'com.itextpdf:itextpdf:${itextpdf.version}'
4241

43-
overrides do
44-
plugin :resources, '3.1.0'
45-
plugin :dependency, '3.1.2' do
46-
execute_goals( id: 'default-cli',
47-
artifactItems:[
48-
{ groupId: 'com.itextpdf',
49-
artifactId: 'itextpdf',
50-
version: '${itextpdf.version}',
51-
type: 'jar',
52-
outputDirectory: '${jruby_art.basedir}/library/pdf'
53-
},
54-
{ groupId: 'org.apache.xmlgraphics',
55-
artifactId: 'batik-all',
56-
version: '${batik.version}',
57-
type: 'jar',
58-
outputDirectory: '${jruby_art.basedir}/library/svg'
59-
}
60-
]
61-
)
62-
end
63-
plugin(:compiler, '3.8.1',
64-
'release' => '11')
65-
plugin(:javadoc, '2.10.4',
66-
'detectOfflineLinks' => 'false',
67-
'links' => ['${processing.api}',
68-
'${jruby.api}'])
69-
plugin(:jar, '3.2.0',
70-
'archive' => {
71-
'manifestEntries' => {
72-
'Automatic-Module-Name' => 'processing.core'
73-
}
74-
})
75-
plugin('org.apache.maven.plugins:maven-pmd-plugin:3.14.0')
76-
plugin :jdeps, '3.1.2' do
77-
execute_goals 'jdkinternals', 'test-jdkinternals'
78-
end
79-
end
42+
overrides do
43+
plugin :resources, '3.1.0'
44+
plugin :dependency, '3.1.2' do
45+
execute_goals( :id => 'default-cli',
46+
'artifactItems' => [ { 'groupId' => 'com.itextpdf',
47+
'artifactId' => 'itextpdf',
48+
'version' => '${itextpdf.version}',
49+
'type' => 'jar',
50+
'outputDirectory' => '${jruby_art.basedir}/library/pdf' },
51+
{ 'groupId' => 'org.apache.xmlgraphics',
52+
'artifactId' => 'batik-all',
53+
'version' => '${batik.version}',
54+
'type' => 'jar',
55+
'outputDirectory' => '${jruby_art.basedir}/library/svg' } ] )
56+
end
8057

81-
build do
82-
resource do
83-
directory '${source.directory}/main/java'
84-
includes '**/**/*.glsl', '**/*.jnilib'
85-
excludes '**/**/*.java'
86-
end
58+
plugin( :compiler, '3.8.1',
59+
'release' => '11' )
60+
plugin( :javadoc, '2.10.4',
61+
'detectOfflineLinks' => 'false',
62+
'links' => [ '${processing.api}',
63+
'${jruby.api}' ] )
64+
plugin( :jar, '3.2.0',
65+
'archive' => {
66+
'manifestEntries' => {
67+
'Automatic-Module-Name' => 'processing.core'
68+
}
69+
} )
70+
plugin :pmd, '3.14.0'
71+
plugin :jdeps, '3.1.2' do
72+
execute_goals 'jdkinternals', 'test-jdkinternals'
73+
end
74+
end
8775

88-
resource do
89-
directory '${source.directory}/main/resources'
90-
includes '**/*.png', '*.txt'
91-
excludes
92-
end
93-
end
94-
reporting do
95-
plugin('org.apache.maven.plugins:mavan-jxr-plugin:2.3')
96-
end
76+
build do
77+
resource do
78+
directory '${source.directory}/main/java'
79+
includes '**/**/*.glsl', '**/*.jnilib'
80+
excludes '**/**/*.java'
81+
end
82+
resource do
83+
directory '${source.directory}/main/resources'
84+
includes '**/*.png', '*.txt'
9785
end
86+
end
87+
88+
reporting do
89+
plugin 'org.apache.maven.plugins:mavan-jxr-plugin:2.3'
90+
end
91+
92+
end

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ DO NOT MODIFY - GENERATED CODE
2323
<role>developer</role>
2424
</roles>
2525
</developer>
26+
<developer>
27+
<id>sampottinger</id>
28+
<name>Sam Pottinger</name>
29+
<roles>
30+
<role>developer</role>
31+
</roles>
32+
</developer>
2633
<developer>
2734
<id>benfry</id>
2835
<name>Ben Fry</name>

src/main/java/monkstone/ColorUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class ColorUtil {
3030
*/
3131
static final int hexLong(long hexlong) {
3232
long SPLIT = Integer.MAX_VALUE + 1;
33-
return (hexlong < SPLIT) ? (int) hexlong : (int) (hexlong - SPLIT * 2L);
33+
return hexlong < SPLIT ? (int) hexlong : (int) (hexlong - SPLIT * 2L);
3434
}
3535

3636
/**
@@ -62,14 +62,14 @@ static public int[] webArray(String[] web) {
6262
* @return String for use in ruby
6363
*/
6464
static public String rubyString(int[] hex) {
65-
StringBuilder result = new StringBuilder("%w(");
65+
StringBuilder result = new StringBuilder("%w[");
6666
for (int i = 0; i < hex.length; i++) {
6767
result.append(String.format("#%06X", 0xFFFFFF & hex[i]));
6868
if (i < hex.length - 1) {
6969
result.append(' ');
7070
}
7171
}
72-
result.append(")\n");
72+
result.append("]\n");
7373
return result.toString();
7474
}
7575

0 commit comments

Comments
 (0)