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: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 97330e060f00
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ca44f5958f9d
Choose a head ref
  • 2 commits
  • 15 files changed
  • 1 contributor

Commits on Dec 27, 2015

  1. Copy the full SHA
    2bb3e53 View commit details
  2. Copy the full SHA
    ca44f59 View commit details
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'mkmf'
$CFLAGS << ' -Wall'
create_makefile('foo/foo')
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require_relative '../../../../ruby/spec_helper'
require 'objspace'

8 changes: 8 additions & 0 deletions spec/truffle/truffle_formatter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'mspec/expectations/expectations'
require 'mspec/utils/ruby_name'
require 'mspec/runner/formatters/dotted'
8 changes: 8 additions & 0 deletions test/truffle/attachments-optimise.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

# -J-G:+TruffleCompilationExceptionsAreFatal

def foo
8 changes: 8 additions & 0 deletions test/truffle/cext/foo/ext/foo/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'mkmf'
$CFLAGS << ' -Wall'
create_makefile('foo/foo')
8 changes: 8 additions & 0 deletions test/truffle/cext/inline.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

p Truffle::CExt.supported?

Truffle::CExt.inline %{
8 changes: 8 additions & 0 deletions test/truffle/cext/inline_capi.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

p Truffle::CExt.supported?

Truffle::CExt.inline %{
8 changes: 8 additions & 0 deletions test/truffle/cext/inline_flags.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

p Truffle::CExt.supported?

Truffle::CExt.inline %{
8 changes: 8 additions & 0 deletions test/truffle/cext/require.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

p Truffle::CExt.supported?

require 'foo/foo'
8 changes: 8 additions & 0 deletions test/truffle/coverage/subject.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

a = 1
b = 2

8 changes: 8 additions & 0 deletions test/truffle/coverage/test.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'coverage'

Coverage.start
8 changes: 8 additions & 0 deletions test/truffle/simple-rack-server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'rack'

# bin/jruby bin/gem install rack
8 changes: 8 additions & 0 deletions test/truffle/simple-sinatra-server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'sinatra'

# bin/jruby bin/gem install sinatra
8 changes: 8 additions & 0 deletions test/truffle/simple-webrick-server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'webrick'

server = WEBrick::HTTPServer.new(:Port => 8080)
55 changes: 45 additions & 10 deletions tool/update_truffle_copyright.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,61 @@
# Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require 'rugged'

RB_COPYRIGHT = <<-EOS
# Copyright (c) #{Time.now.year} Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1
EOS

JAVA_COPYRIGHT = <<-EOS
/*
* Copyright (c) #{Time.now.year} Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
EOS

NEW_COPYRIGHT = {
'.rb' => RB_COPYRIGHT,
'.java' => JAVA_COPYRIGHT
}

EXTENSIONS = %w[.java .rb]

COPYRIGHT = /Copyright \(c\) (?<year1>\d{4})(?:, (?<year2>\d{4}))? Oracle\b/

OTHER_COPYRIGHTS = [
/Copyright \(c\) \d{4} Software Architecture Group, Hasso Plattner Institute/,
/Copyright \(c\) \d{4}(?:-\d{4})?,? Evan Phoenix/
/Copyright \(c\) \d{4}(?:-\d{4})?,? Evan Phoenix/,
/Copyright \(c\) \d{4} Engine Yard/
]

EXTENSIONS = %w[.java .rb]

truffle_paths = %w[
truffle/src/main/java/org/jruby/truffle
truffle/src/main/ruby
test/truffle/pe/pe.rb
truffle/src
test/truffle
spec/truffle
] + [__FILE__]

excludes = %w[
test/truffle/pack-real-usage.rb
]

truffle_paths.each do |path|
puts "WARNING: incorrect path #{path}" unless File.exist? path
end
@@ -53,7 +86,9 @@
paths = diff.each_delta.to_a.map { |delta|
delta.new_file[:path]
}.select { |path|
EXTENSIONS.include?(File.extname(path)) and truffle_paths.any? { |prefix| path.start_with? prefix }
EXTENSIONS.include?(File.extname(path)) &&
truffle_paths.any? { |prefix| path.start_with? prefix } &&
excludes.none? { |prefix| path.start_with? prefix }
}

paths.each do |file|
@@ -63,8 +98,8 @@

unless COPYRIGHT =~ header
if OTHER_COPYRIGHTS.none? { |copyright| copyright =~ header }
puts "WARNING: No copyright in #{file}"
puts header
puts "Adding copyright in #{file}"
File.write(file, NEW_COPYRIGHT[File.extname(file)]+File.read(file))
end
next
end