Skip to content

Commit

Permalink
Merge pull request #125 from jashkenas/maven
Browse files Browse the repository at this point in the history
Maven
  • Loading branch information
monkstone committed Feb 4, 2016
2 parents ec65fc3 + a9c7fbc commit 0f04d5b
Show file tree
Hide file tree
Showing 32 changed files with 310 additions and 162 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -7,10 +7,10 @@ syntax: glob
*.tgz
*.jar
*.zip
samples/processing_app/topics/file_io/output/*.png
Gemfile.lock
.ruby-version
.jrubyrc
tmp
vendors/*.tar.gz
nbproject
target
MANIFEST.MF
8 changes: 8 additions & 0 deletions .mvn/extensions.xml
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.10</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
11 changes: 11 additions & 0 deletions .travis.yml
@@ -0,0 +1,11 @@
sudo: false

language: ruby

rvm:
- jruby-19mode
- jruby-head

jdk:
- openjdk7

2 changes: 1 addition & 1 deletion CHANGELOG
@@ -1,4 +1,4 @@
v2.6.17 update to jruby-complete-1.7.24
v2.6.17 move to a polyglot maven build and update to jruby-complete-1.7.24, to allow travis testing, should be easy to update to jruby-complete-9.0+ if required. Updating processing version is unecessary because JRubyArt does that.

v2.6.16 update to jruby-complete-1.7.23 changed to static load for jruby extensions implement Vec2D.random and Vec3D.random
* get rid of rspec as development requirement (all minitest now) this is expected to be the last release of ruby-processing
Expand Down
38 changes: 0 additions & 38 deletions JRakefile

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -20,7 +20,7 @@ Then install ruby-processing (from rubygems-org) in the usual way

`gem install ruby-processing` some systems eg Ubuntu may require `sudo` access

To install jruby-complete use our built in tool (relies on `wget` to download [jruby-complete-1.7.23](http://jruby.org/download))
To install jruby-complete use our built in tool (relies on `wget` to download [jruby-complete-1.7.22](http://jruby.org/download))

since ruby-processing-2.5.0 `rp5 setup install` (was `install_jruby_complete`)

Expand Down Expand Up @@ -103,7 +103,8 @@ This gem has been tested with the following ruby implementations
* Ruby 2.0.0
* Ruby 2.1.2
* Ruby 2.2.1
* [JRuby][] preferred use jruby-1.7.XX but also works with jruby-9.0.4.0 release
* Ruby 2.3.0
* [JRuby][] preferred use jruby-1.7.XX but also works with jruby-9.0.5.0 release

### Supported processing version

Expand Down
69 changes: 29 additions & 40 deletions Rakefile
@@ -1,62 +1,51 @@

desc 'build and test'
task :default => [:build_and_test]

task :build_and_test do
Rake::Task[:compile].execute
Rake::Task["build"].execute
Rake::Task["test"].execute
require_relative 'lib/ruby-processing/version'

def create_manifest
title = 'Implementation-Title: rpextras (java extension for ruby-processing)'
version = format('Implementation-Version: %s', RubyProcessing::VERSION)
file = File.open('MANIFEST.MF', 'w') do |f|
f.puts(title)
f.puts(version)
end
end

desc 'Build and install gem'
task :install => :build do
sh "jruby -S gem install #{Dir.glob('*.gem').join(' ')} --no-ri --no-rdoc"
end
task :default => [:init, :compile, :test, :gem]

desc 'Uninstall gem'
task :uninstall do
sh "gem uninstall -x ruby-processing"
desc 'Create Manifest'
task :init do
create_manifest
end

desc 'Install jruby-complete'
task :install_jruby_complete do
begin
sh "cd vendors && rake"
rescue
warn("WARNING: you may not have wget installed")
end
desc 'Build gem'
task :gem do
sh 'gem build ruby-processing.gemspec'
end

desc 'Compile'
task :compile do
sh "jruby -S rake --rakefile JRakefile compile"
end

desc 'Build gem'
task :build do
sh "jruby -S gem build ruby-processing.gemspec"
sh 'mvn package'
sh 'mv target/rpextras.jar lib'
end

desc 'Test'
task :test do
sh "jruby test/vecmath_spec_test.rb"
sh "jruby test/deglut_spec_test.rb"
sh "jruby test/math_tool_test.rb"
sh "jruby test/helper_methods_test.rb"
ruby "test/rp5_run_test.rb"
end

desc 'Spec'
task :spec do
Dir['./spec/processing/*.rb'].each do |sp|
sh "jruby -S rspec #{sp}"
sh 'jruby test/vecmath_spec_test.rb'
sh 'jruby test/deglut_spec_test.rb'
sh 'jruby test/math_tool_test.rb'
sh 'jruby test/helper_methods_test.rb'
home = File.expand_path('~')
config = File.exist?(format('%s/.rp5rc', home))
if config
ruby 'test/rp5_run_test.rb'
else
warn format('You should create %s/.rp5rc to run sketch tests', home)
end
end

desc 'Clean'
task :clean do
Dir['./**/*.%w{jar gem}'].each do |path|
puts "Deleting #{path} ..."
puts format('Deleting %s ...', path)
File.delete(path)
end
FileUtils.rm_rf('./tmp')
Expand Down
58 changes: 58 additions & 0 deletions pom.rb
@@ -0,0 +1,58 @@
require 'fileutils'
project 'rp5extras', 'https://github.com/jashkenas/ruby-processing' do

model_version '4.0.0'
id 'ruby-processing:rp5extras', '2.6.17'
packaging 'jar'

description 'rp5extras for ruby-processing'

organization 'ruby-processing', 'https://ruby-processing.github.io'

developer 'monkstone' do
name 'Martin Prout'
email 'martin_p@lineone.net'
roles 'developer'
end

issue_management 'https://github.com/jashkenas/ruby-processing/issues', 'Github'

source_control(
:url => 'https://github.com/jashkenas/ruby-processing',
:connection => 'scm:git:git://github.com/jashkenas/ruby-processing.git',
:developer_connection => 'scm:git:git@github.com/jashkenas/ruby-processing.git'
)

properties( 'maven.compiler.source' => '1.7',
'project.build.sourceEncoding' => 'UTF-8',
'maven.compiler.target' => '1.7',
'polyglot.dump.pom' => 'pom.xml',
'processing.api' => "http://processing.github.io/processing-javadocs/core/",
'jruby.api' => "http://jruby.org/apidocs/"
)

pom 'org.jruby:jruby:1.7.24'
jar 'org.processing:core:2.2.1'
jar 'org.processing:video:2.2.1'
plugin_management do
plugin :resources, '2.6'
plugin :dependency, '2.8'
plugin( :compiler, '3.1',
'source' => '1.7',
'target' => '1.7' )
plugin( :javadoc, '2.10.3',
'detectOfflineLinks' => 'false',
'links' => ['${processing.api}', '${jruby.api}']
)
plugin( :jar, '2.4',
'archive' => {
'manifestFile' => 'MANIFEST.MF'
}
)
end
build do
default_goal 'package'
source_directory 'src'
final_name 'rpextras'
end
end
110 changes: 110 additions & 0 deletions pom.xml
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Autogenerated do not edit
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>ruby-processing</groupId>
<artifactId>rp5extras</artifactId>
<version>2.6.17</version>
<name>rp5extras</name>
<description>rp5extras for ruby-processing</description>
<url>https://github.com/jashkenas/ruby-processing</url>
<organization>
<name>ruby-processing</name>
<url>https://ruby-processing.github.io</url>
</organization>
<developers>
<developer>
<id>monkstone</id>
<name>Martin Prout</name>
<email>martin_p@lineone.net</email>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/jashkenas/ruby-processing.git</connection>
<developerConnection>scm:git:git@github.com/jashkenas/ruby-processing.git</developerConnection>
<url>https://github.com/jashkenas/ruby-processing</url>
</scm>
<issueManagement>
<system>Github</system>
<url>https://github.com/jashkenas/ruby-processing/issues</url>
</issueManagement>
<properties>
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<jruby.api>http://jruby.org/apidocs/</jruby.api>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>1.7.24</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.processing</groupId>
<artifactId>core</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.processing</groupId>
<artifactId>video</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<defaultGoal>package</defaultGoal>
<finalName>rpextras</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<detectOfflineLinks>false</detectOfflineLinks>
<links>
<link>${processing.api}</link>
<link>${jruby.api}</link>
</links>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestFile>MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
4 changes: 2 additions & 2 deletions ruby-processing.gemspec
Expand Up @@ -16,7 +16,8 @@ Gem::Specification.new do |spec|
This version supports processing-2.2.1, and uses jruby-complete-1.7.24 or an
installed jruby as the glue between ruby and java. Use both processing
libraries and ruby gems in your sketches. The "watch" mode, provides a
nice REPL-ish way to work on your processing sketches.
nice REPL-ish way to work on your processing sketches. Features a polyglot
maven build, opening the way to use/test latest jruby.
EOS
spec.summary = %q{Code as Art, Art as Code. Processing and Ruby are meant for each other.}
spec.homepage = "http://wiki.github.com/jashkenas/ruby-processing"
Expand All @@ -33,7 +34,6 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "bundler", "~> 1.10"
spec.add_development_dependency "rake", "~> 10.4"
spec.add_development_dependency "rake-compiler", "~> 0.9"
spec.add_development_dependency "minitest", "~> 5.8"
spec.requirements << 'A decent graphics card'
spec.requirements << 'java runtime >= 1.7+'
Expand Down
4 changes: 2 additions & 2 deletions ext/monkstone/ColorUtil.java → src/monkstone/ColorUtil.java
@@ -1,7 +1,7 @@
/**
* The purpose of this uilit is to allow ruby-processing users to use an alternative
* The purpose of this utility is to allow ruby-processing users to use an alternative
* to processing.org color their sketches (to cope with ruby FixNumber vs java int)
* Copyright (C) 2015 Martin Prout. This tool is free software; you can
* Copyright (C) 2015-16 Martin Prout. This tool is free software; you can
* redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
Expand Down

0 comments on commit 0f04d5b

Please sign in to comment.