Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
max_line_length = 120
tab_width = 2

[*.java]
indent_size = 4
tab_width = 4
13 changes: 3 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ jobs:
matrix:
java-version: [8, 21]
ruby-version: [jruby-9.4, jruby-10]
bundler-version: [2.6.3, 2.7.1]
task: ['', integration]
exclude:
# JRuby 10 requires Java 21 minimum
- ruby-version: jruby-10
java-version: 8
# Bundler 2.7.1 requires Ruby 3.2
- ruby-version: jruby-9.4
bundler-version: 2.7.1

fail-fast: false

Expand All @@ -44,7 +40,7 @@ jobs:
- name: Set up java ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: zulu
distribution: temurin
java-version: ${{ matrix.java-version }}

- name: Set up ${{ matrix.ruby-version }}
Expand All @@ -55,11 +51,8 @@ jobs:
- name: Remove jruby-launcher # not sure where this is coming from but causes some specs to fail
run: gem uninstall -a jruby-launcher

- name: Remove jruby-launcher # not sure where this is coming from but causes some specs to fail
run: gem install bundler -v ${{ matrix.bundler-version }}

- name: Install dependencies
run: bundle _${{ matrix.bundler-version }}_ install --jobs=3 --retry=3
run: bundle install

- name: Run tests
run: bundle _${{ matrix.bundler-version }}_ exec rake ${{ matrix.task }}
run: bundle exec rake ${{ matrix.task }}
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ coverage*
pkg
doc
.bundle
vendor/
nbproject
**/target/*
!**/target/.keep
target/
out/
Gemfile.lock
.idea
warbler.iml
warbler.iws
warbler.ipr
warbler-*.gem
.polyglot.Mavenfile
pom.warbler.gemspec.xml
log
integration/**/*.iml
build.log
.ruby-version
.rspec_status
/integration/rails7_test/src/main/ruby/db/*.sqlite3*
*.sqlite3-*
19 changes: 12 additions & 7 deletions Mavenfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,35 @@ repository( :url => 'https://central.sonatype.com/repository/maven-snapshots/',
snapshots 'true'
end

properties( 'jruby.plugins.version' => '3.0.6',
'jruby.version' => '9.4.13.0',
'jetty.version' => '8.1.16.v20140903',
'bundler.version' => '2.6.3')
properties(
'project.build.sourceEncoding' => 'UTF-8',
'jruby.plugins.version' => '3.0.6',
'jetty.version' => '9.4.58.v20250814',
)

# dependencies needed for compilation
scope :provided do
jar 'org.jruby:jruby', '${jruby.version}'
jar 'org.eclipse.jetty:jetty-webapp', '${jetty.version}'
end

plugin :compiler, '3.1', :source => '8', :target => '8'
plugin :compiler, '3.14.1', :release => '8'
plugin :resources, '3.3.1'
plugin :jar, '2.6'
plugin :install, '3.1.4'

gem 'bundler', '${bundler.version}'
gem 'jruby-jars', '${jruby.version}'

plugin :invoker, '1.8' do
plugin :invoker, '3.9.1' do
execute_goals( :install, :run,
:id => 'integration-test',
:properties => { 'warbler.version' => '${project.version}',
'jruby.version' => '${jruby.version}',
'jetty.version' => '${jetty.version}',
'bundler.version' => '${bundler.version}',
'jruby.plugins.version' => '${jruby.plugins.version}' },
'jruby.plugins.version' => '${jruby.plugins.version}',
'style.color' => 'always' },

:goals => ['verify'],
:projectsDirectory => 'integration',
Expand Down
15 changes: 4 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
# See the file LICENSE.txt for details.
#++

begin
require 'bundler'
rescue LoadError
warn "\nPlease `gem install bundler' and run `bundle install' to ensure you have all dependencies.\n\n"
else
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks :dir => File.dirname(__FILE__)
end
require 'bundler/gem_helper'
Bundler::GemHelper.install_tasks :dir => File.dirname(__FILE__)

require 'rake/clean'
CLEAN << "pkg" << "doc" << Dir['integration/**/target']
Expand All @@ -31,10 +25,9 @@ mvn = Maven::Ruby::Maven.new
mvn << "-Djruby.version=#{JRUBY_VERSION}"
mvn << "-Dbundler.version=#{Bundler::VERSION}"
mvn << '--no-transfer-progress'
mvn << '--color=always'

if defined?(JRUBY_VERSION) && !JRUBY_VERSION.start_with?('9.0')
mvn.inherit_jruby_version
end
mvn.inherit_jruby_version

desc 'compile java sources and build jar'
task :jar do
Expand Down
101 changes: 72 additions & 29 deletions integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
<properties>
<jruby.plugins.version>3.0.6</jruby.plugins.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jruby.version>${jruby.version}</jruby.version>
<warbler.version>2.0.4</warbler.version>
<bundler.version>${bundler.version}</bundler.version>
<gem.home>${basedir}/../../pkg/rubygems</gem.home>
<gem.path>${basedir}/../../pkg/rubygems</gem.path>

<!-- Default versions, overridden from parent when running tests acros env -->
<warbler.version>2.0.5</warbler.version>
<jruby.version>9.4.14.0</jruby.version>
<bundler.version>2.6.3</bundler.version>
<jetty.version>9.4.58.v20250814</jetty.version>
</properties>

<repositories>
Expand Down Expand Up @@ -44,15 +47,15 @@
<type>gem</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.14.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<artifactId>hamcrest</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -72,10 +75,57 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<release>8</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.9</version>
<version>3.5.4</version>
<configuration>
<failIfNoTests>true</failIfNoTests>
</configuration>
<executions>
<execution>
<goals>
Expand All @@ -99,41 +149,26 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppConfig>
<contextPath>/</contextPath>
<configurationClasses>
<configurationClass>org.eclipse.jetty.webapp.WebXmlConfiguration</configurationClass>
<configurationClass>org.eclipse.jetty.webapp.WebInfConfiguration</configurationClass>
<configurationClass>org.eclipse.jetty.webapp.TagLibConfiguration</configurationClass>
<configurationClass>org.eclipse.jetty.webapp.MetaInfConfiguration</configurationClass>
<configurationClass>org.eclipse.jetty.webapp.FragmentConfiguration</configurationClass>
<configurationClass>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</configurationClass>
<!-- intentionally no AnnotationConfiguration -->
</configurationClasses>
</webAppConfig>
<stopPort>9966</stopPort>
<stopKey>warbler_stop</stopKey>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
<supportedPackagings>jar</supportedPackagings>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war</goal>
<!-- Change to run-war to interactively play with the server without running tests -->
<goal>deploy-war</goal>
</goals>
</execution>
<execution>
Expand All @@ -148,7 +183,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<version>3.6.1</version>
</plugin>
<plugin>
<groupId>org.jruby.maven</groupId>
Expand All @@ -175,6 +210,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<ignoredVersions>.*-(alpha|beta|M)[-0-9]+</ignoredVersions>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
4 changes: 1 addition & 3 deletions integration/rails7_test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
</parent>

<artifactId>rails7_test</artifactId>
<packaging>pom</packaging>

<name>rails7_test</name>

<build>
Expand All @@ -30,7 +28,7 @@
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<executions>
<execution>
Expand Down
7 changes: 2 additions & 5 deletions integration/rails7_test/src/main/ruby/Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '7.1.5.1'

gem 'puma'
gem 'rails', '~> 7.1.0'
gem 'rack', '~> 2.2.19'

gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0'

gem 'jbuilder'
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
# Enable server timing
config.server_timing = true

# Workaround https://github.com/jruby/jruby-rack/issues/329
config.logger = ActiveSupport::Logger.new(STDOUT)

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
Expand Down
2 changes: 2 additions & 0 deletions integration/rails7_test/src/main/ruby/config/warble.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Warbler::Config.new do |config|
config.autodeploy_dir = "../../../target"
config.jar_name = "rails7_test-1.0"

config.webxml.rails.env = 'development'
end
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreatePosts < ActiveRecord::Migration
class CreatePosts < ActiveRecord::Migration[7.1]
def change
create_table :posts do |t|
t.string :name
Expand Down
Loading