Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rake-compiler/rake-compiler
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.1
Choose a base ref
...
head repository: rake-compiler/rake-compiler
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.2
Choose a head ref
  • 9 commits
  • 8 files changed
  • 4 contributors

Commits on Dec 16, 2022

  1. Bump version

    kou committed Dec 16, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    7ba3d87 View commit details
  2. ci: add missing GH_TOKEN

    kou committed Dec 16, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    08cffbc View commit details

Commits on Mar 7, 2023

  1. baseextensiontask: provide an API to allow for dynamic sources (#211)

    If a build wishes to generate some of the extension source files then
    the pattern input is insufficient. Provide a place to stash an
    additional FileList that will then become a dependency of the compile
    tasks.
    
    Example:
    
    ```ruby
    file 'ext/libfoo/generated.c' do |t|
      open(t.name, 'w+) { |f| f << '#include <foo.h>' }
    end
    
    Rake::ExtensionTask.new('foo') do |ext|
      ext.extra_sources << 'generated.c'
    end
    ```
    raggi authored Mar 7, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    f845901 View commit details

Commits on Mar 26, 2023

  1. Fix typo (#212)

    janjagusch authored Mar 26, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    89df143 View commit details

Commits on Mar 30, 2023

  1. Don't use --release flag on Java 8 (#213)

    this allows using
    ```
      Rake::JavaExtensionTask.new("name", gemspec) do |ext|
        ext.release = '8'
      end
    ```
    on Java 8 (for building the gem), because the flag is available since
    Java 9, see
    https://maven.apache.org/plugins/maven-compiler-plugin/examples/set-compiler-source-and-target.html
    
    this flag is for backward compatibility, so it's safe to just skip it if
    we can't use it.
    
    relates to puma/puma#3109
    socketry/nio4r#292
    ahorek authored Mar 30, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    8e79814 View commit details

Commits on Apr 3, 2023

  1. ci release: add missing tag name

    kou committed Apr 3, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    adb0f67 View commit details

Commits on Apr 13, 2023

  1. ci release: fix a typo

    kou committed Apr 13, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    7fa360a View commit details

Commits on May 25, 2023

  1. Add support for extra options with space

    GitHub: fix GH-215
    
    Reported by Jun Aruga. Thanks!!!
    kou committed May 25, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    8a830fa View commit details
  2. Add 1.2.2 entry

    kou committed May 25, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    primeos Michael Weiss
    Copy the full SHA
    3865392 View commit details
Showing with 47 additions and 10 deletions.
  1. +4 −2 .github/workflows/release.yml
  2. +20 −0 History.md
  3. +1 −1 README.md
  4. +3 −1 lib/rake/baseextensiontask.rb
  5. +2 −4 lib/rake/extensiontask.rb
  6. +7 −1 lib/rake/javaextensiontask.rb
  7. +1 −1 rake-compiler.gemspec
  8. +9 −0 spec/lib/rake/extensiontask_spec.rb
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@ jobs:
History.md > release-note.md
- name: Upload to release
run: |
gh release create \
gh release create ${GITHUB_REF_NAME} \
--discussion-category Announcements \
--notes-file release-node.md
--notes-file release-note.md
env:
GH_TOKEN: ${{ github.token }}
20 changes: 20 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
### 1.2.2 / 2023-05-25

* Enhancements:
* GH-211: Added `extra_sources` that is for dynamic sources.
[Patch by James Tucker]
* GH-213: Stopped using `--release` on Java 8.
[Patch by James Pavel Rosický]
* GH-215: Added support for extra options with space.
[Reported by Jun Aruga]

* Fixes:
* GH-211: Fixed a typo in documentation.
[Patch by Jan-Benedikt Jagusch]

* Thanks:
* James Tucker
* Jan-Benedikt Jagusch
* Pavel Rosický
* Jun Aruga

### 1.2.1 / 2022-12-16

* Enhancements:
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -349,7 +349,7 @@ Now, you only need specify a few additional options in your extension definition
# platform build, with platform-specific options in a hash.
ext.cross_config_options << '--with-common-option'
ext.cross_config_options << {
'x86-mswin32-60 => '--with-some-option',
'x86-mswin32-60' => '--with-some-option',
'x64-mingw32' => '--enable-64bits',
}
ext.cross_config_options << '--with-final-option'
4 changes: 3 additions & 1 deletion lib/rake/baseextensiontask.rb
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ class BaseExtensionTask < TaskLib
attr_accessor :config_options
attr_accessor :source_pattern
attr_accessor :extra_options
attr_accessor :extra_sources
attr_writer :platform

def platform
@@ -41,6 +42,7 @@ def init(name = nil, gem_spec = nil)
end
@config_options = []
@extra_options = ARGV.select { |i| i =~ /\A--?/ }
@extra_sources = FileList[]
end

def define
@@ -71,7 +73,7 @@ def binary(platform = nil)
end

def source_files
FileList["#{@ext_dir}/#{@source_pattern}"]
FileList["#{@ext_dir}/#{@source_pattern}"] + @extra_sources
end

def warn_once(message)
6 changes: 2 additions & 4 deletions lib/rake/extensiontask.rb
Original file line number Diff line number Diff line change
@@ -199,7 +199,7 @@ def define_compile_tasks(for_platform = nil, ruby_ver = RUBY_VERSION)
abs_extconf = (Pathname.new(Dir.pwd) + extconf).realpath

# now add the extconf script
cmd << abs_extconf.relative_path_from(abs_tmp_path)
cmd << abs_extconf.relative_path_from(abs_tmp_path).to_s

# fake.rb will be present if we are cross compiling
if t.prerequisites.include?("#{tmp_path}/fake.rb") then
@@ -215,9 +215,7 @@ def define_compile_tasks(for_platform = nil, ruby_ver = RUBY_VERSION)
end

chdir tmp_path do
# FIXME: Rake is broken for multiple arguments system() calls.
# Add current directory to the search path of Ruby
sh cmd.join(' ')
sh *cmd
end
end

8 changes: 7 additions & 1 deletion lib/rake/javaextensiontask.rb
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ def define_java_platform_tasks
end

def java_target_args
if @release
if @release && release_flag_supported?
["--release=#{@release}"]
else
["-target", @target_version, "-source", @source_version]
@@ -303,5 +303,11 @@ def java_lint_arg

"-Xlint:#{@lint_option}"
end

def release_flag_supported?
return true unless RUBY_PLATFORM =~ /java/

Gem::Version.new(Java::java.lang.System.getProperty('java.version')) >= Gem::Version.new("9")
end
end
end
2 changes: 1 addition & 1 deletion rake-compiler.gemspec
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
Gem::Specification.new do |s|
# basic information
s.name = "rake-compiler"
s.version = "1.2.1"
s.version = "1.2.2"
s.platform = Gem::Platform::RUBY

# description and details
9 changes: 9 additions & 0 deletions spec/lib/rake/extensiontask_spec.rb
Original file line number Diff line number Diff line change
@@ -58,6 +58,15 @@
end
ext.platform.should == 'universal-foo-bar-10.5'
end

it 'should allow extra sources to be added' do
ext = Rake::ExtensionTask.new('extension_one') do |ext|
ext.extra_sources << 'extra.c'
end
ext.extra_sources.should include('extra.c')
# Private API between the base task and the extension task
ext.send(:source_files).should include('extra.c')
end
end
end