You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2019/02/25 23:15:45 UTC
[buildr] 02/05: Ensure files end with a new line and have no lines
with trailing whitespace
This is an automated email from the ASF dual-hosted git repository.
donaldp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/buildr.git
commit 570ddc6789ab530be5510e3dadf282b41bdab0e5
Author: Peter Donald <pe...@realityforge.org>
AuthorDate: Tue Feb 26 10:04:59 2019 +1100
Ensure files end with a new line and have no lines with trailing whitespace
---
.gitignore | 2 +-
addon/buildr/jetty.rb | 2 +-
all-in-one/buildr.cmd | 2 +-
buildr.buildfile | 2 +-
lib/buildr/kotlin/compiler.rb | 6 ++---
.../org/apache/buildr/KotlinMessageCollector.java | 8 +++----
lib/buildr/packaging/archive.rb | 10 ++++-----
lib/buildr/packaging/tar.rb | 10 ++++-----
spec/kotlin/compiler_spec.rb | 10 ++++-----
spec/packaging/archive_spec.rb | 4 ++--
tests/BUILDR-320/Buildfile | 26 +++++++++++-----------
tests/JavaSystemProperty/Buildfile | 2 +-
tests/compile_with_parent/Buildfile | 7 +++---
tests/helloWorld/Buildfile | 6 ++---
tests/helloWorldEcj/Buildfile | 2 +-
tests/include_as/Buildfile | 4 ++--
tests/include_path/Buildfile | 4 ++--
tests/integration_testing.rb | 2 +-
tests/junit3/Buildfile | 4 ++--
tests/package_war_as_jar/Buildfile | 7 +++---
tests/run_jetty6/Buildfile | 8 +++----
tests/run_jetty6/src/main/java/MainServlet.java | 4 ++--
tests/run_jetty6/src/main/webapp/WEB-INF/web.xml | 4 ++--
tests/run_jetty9/Buildfile | 8 +++----
tests/run_jetty9/src/main/java/MainServlet.java | 4 ++--
tests/run_jetty9/src/main/webapp/WEB-INF/web.xml | 4 ++--
26 files changed, 75 insertions(+), 77 deletions(-)
diff --git a/.gitignore b/.gitignore
index fcb4db3..7a44280 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,4 +27,4 @@
/site
.bundle
.DS_Store
-*.class
\ No newline at end of file
+*.class
diff --git a/addon/buildr/jetty.rb b/addon/buildr/jetty.rb
index 9e0395b..2246dfb 100644
--- a/addon/buildr/jetty.rb
+++ b/addon/buildr/jetty.rb
@@ -52,7 +52,7 @@ module Buildr
"org.eclipse.jetty:jetty-security:jar:#{VERSION}",
"org.eclipse.jetty:jetty-xml:jar:#{VERSION}",
"org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}",
- "org.slf4j:slf4j-simple:jar:#{SLF4J_VERSION}",
+ "org.slf4j:slf4j-simple:jar:#{SLF4J_VERSION}",
"org.slf4j:jcl-over-slf4j:jar:#{SLF4J_VERSION}",
'javax.servlet:javax.servlet-api:jar:3.1.0' ]
diff --git a/all-in-one/buildr.cmd b/all-in-one/buildr.cmd
index d643b3a..afe0132 100755
--- a/all-in-one/buildr.cmd
+++ b/all-in-one/buildr.cmd
@@ -1 +1 @@
-@%~dp0\..\embedded\jruby.exe %*
\ No newline at end of file
+@%~dp0\..\embedded\jruby.exe %*
diff --git a/buildr.buildfile b/buildr.buildfile
index aa4d101..d1d03ca 100644
--- a/buildr.buildfile
+++ b/buildr.buildfile
@@ -33,7 +33,7 @@ define 'buildr' do
define 'scala' do
compile.using(:javac).from(FileList['lib/buildr/scala/**/*.java']).into('lib/buildr/scala')
end
-
+
define 'kotlin' do
compile.using(:javac).from(FileList['lib/buildr/kotlin/**/*.java']).into('lib/buildr/kotlin').with(Buildr::Kotlin::Kotlinc.dependencies)
end
diff --git a/lib/buildr/kotlin/compiler.rb b/lib/buildr/kotlin/compiler.rb
index cbb504b..f27e25c 100644
--- a/lib/buildr/kotlin/compiler.rb
+++ b/lib/buildr/kotlin/compiler.rb
@@ -140,15 +140,15 @@ module Buildr::Kotlin
hash[option] = options[option]
hash
end
-
+
options[:debug] = Buildr.options.debug || trace?(:kotlinc) if options[:debug].nil?
options[:warnings] = verbose if options[:warnings].nil?
options[:optimize] = false if options[:optimize].nil?
options[:noStdlib] = true if options[:noStdlib].nil?
@java = Javac.new(project, options[:javac])
end
-
-
+
+
def compile(sources, target, dependencies) #:nodoc:
check_options(options, OPTIONS)
diff --git a/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java b/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java
index cce8bfb..6b02cd7 100644
--- a/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java
+++ b/lib/buildr/kotlin/org/apache/buildr/KotlinMessageCollector.java
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation;
public class KotlinMessageCollector implements MessageCollector {
-
+
public void report(CompilerMessageSeverity severity, String message, CompilerMessageLocation location) {
switch(severity) {
case ERROR:
@@ -35,12 +35,12 @@ public class KotlinMessageCollector implements MessageCollector {
break;
}
}
-
+
public boolean hasErrors() {
return false;
}
-
+
public void clear() {
// not implemented
}
-}
\ No newline at end of file
+}
diff --git a/lib/buildr/packaging/archive.rb b/lib/buildr/packaging/archive.rb
index 78df00e..dfe664f 100644
--- a/lib/buildr/packaging/archive.rb
+++ b/lib/buildr/packaging/archive.rb
@@ -267,12 +267,12 @@ module Buildr #:nodoc:
@expanders.each { |expander| expander.exclude(*files) }
self
end
-
+
def concatenate(*files)
@expanders.each { |expander| expander.concatenate(*files) }
self
end
-
+
def transform(*files, &block)
@expanders.each { |expander| expander.transform(*files, &block) }
self
@@ -301,12 +301,12 @@ module Buildr #:nodoc:
@excludes |= files
self
end
-
+
def concatenate(*files)
@concatenates |= files
self
end
-
+
def transform(*files, &block)
@transforms[[files].flatten] = block
self
@@ -325,7 +325,7 @@ module Buildr #:nodoc:
elsif @transforms.each_pair.detect do |transform, transform_block|\
if transform.any? { |pattern| File.fnmatch(pattern, entry.name) }
file_map[dest] << ZipEntryData.new(source, entry)
-
+
transform_map[dest] = transform_block
true
end
diff --git a/lib/buildr/packaging/tar.rb b/lib/buildr/packaging/tar.rb
index 16a3816..0c58c8d 100644
--- a/lib/buildr/packaging/tar.rb
+++ b/lib/buildr/packaging/tar.rb
@@ -99,7 +99,7 @@ module Buildr #:nodoc:
tar.mkdir(path, options.merge(:mode=>stat.mode, :mtime=>stat.mtime, :uid=>stat.uid, :gid=>stat.gid))
else
contents = [contents].flatten
-
+
combined_options = options
if File.exists?(contents.first.to_s)
stat = File.stat(contents.first.to_s)
@@ -107,8 +107,8 @@ module Buildr #:nodoc:
elsif contents.first.respond_to?(:mode)
combined_options = combined_options.merge(:mode => contents.first.mode)
end
-
-
+
+
tar.add_file path, combined_options do |os, opts|
[contents].flatten.each do |content|
if content.respond_to?(:call)
@@ -120,7 +120,7 @@ module Buildr #:nodoc:
content.call os
end
else
- File.open content.to_s, 'rb' do |is|
+ File.open content.to_s, 'rb' do |is|
if transform
output = StringIO.new
while data = is.read(4096)
@@ -140,7 +140,7 @@ module Buildr #:nodoc:
end
end
end
-
+
end
end
end
diff --git a/spec/kotlin/compiler_spec.rb b/spec/kotlin/compiler_spec.rb
index 5d27884..64dd551 100644
--- a/spec/kotlin/compiler_spec.rb
+++ b/spec/kotlin/compiler_spec.rb
@@ -182,7 +182,7 @@ RSpec.shared_examples 'KotlincCompiler_CommonOptions' do
compile_task.using(:optimize=>false)
kotlinc_args.noOptimize.should be_true
end
-
+
it 'should set noStdlib option to true by default' do
compile_task.options.noStdlib.should be_true
kotlinc_args.noStdlib.should be_true
@@ -200,7 +200,7 @@ RSpec.shared_examples 'KotlincCompiler_CommonOptions' do
it 'should not set other option by default' do
compile_task.options.other.should be_nil
- end
+ end
it 'should complain about options it doesn\'t know' do
write 'source/Test.kt', 'class Test {}'
@@ -235,7 +235,7 @@ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.8"
it 'requires present KOTLIN_HOME' do
ENV['KOTLIN_HOME'].should_not be_nil
end
-
+
def compile_task
@compile_task ||= define('foo').compile.using(:kotlinc)
end
@@ -255,11 +255,11 @@ if Java.java.lang.System.getProperty("java.runtime.version") >= "1.8"
it 'requires absent KOTLIN_HOME' do
ENV['KOTLIN_HOME'].should be_nil
end
-
+
def compile_task
@compile_task ||= define('foo').compile.using(:kotlinc)
end
-
+
def kotlinc_args
compile_task.instance_eval { @compiler }.send(:kotlinc_args)
end
diff --git a/spec/packaging/archive_spec.rb b/spec/packaging/archive_spec.rb
index 827c4e8..8a097ce 100644
--- a/spec/packaging/archive_spec.rb
+++ b/spec/packaging/archive_spec.rb
@@ -306,7 +306,7 @@ RSpec.shared_examples 'ArchiveTask' do
inspect_archive.should be_empty
end
end
-
+
it 'should merge archives, concatenate file contents' do
@files = %w{foo1 foo2}.map { |folder| File.join(@dir, folder) }.
map do |dir|
@@ -320,7 +320,7 @@ RSpec.shared_examples 'ArchiveTask' do
archive['test1.txt'].should eql(content_for('test1.txt') * @files.size)
end
end
-
+
it 'should merge archives, transforming file contents' do
@files = %w{foo1 foo2}.map { |folder| File.join(@dir, folder) }.
map do |dir|
diff --git a/tests/BUILDR-320/Buildfile b/tests/BUILDR-320/Buildfile
index 60a60e6..843570d 100644
--- a/tests/BUILDR-320/Buildfile
+++ b/tests/BUILDR-320/Buildfile
@@ -13,17 +13,17 @@
# License for the specific language governing permissions and limitations under
# the License.
-define "whole" do
- define 'sub' do
- define 'C' do
- compile.with project('sub:B')
- end
-
- define 'A' do
- end
+define "whole" do
+ define 'sub' do
+ define 'C' do
+ compile.with project('sub:B')
+ end
- define 'B' do
- compile.with project('sub:A')
- end
- end
-end
\ No newline at end of file
+ define 'A' do
+ end
+
+ define 'B' do
+ compile.with project('sub:A')
+ end
+ end
+end
diff --git a/tests/JavaSystemProperty/Buildfile b/tests/JavaSystemProperty/Buildfile
index 6fbfed5..affd850 100644
--- a/tests/JavaSystemProperty/Buildfile
+++ b/tests/JavaSystemProperty/Buildfile
@@ -15,4 +15,4 @@
define "proj" do
::Java.java.lang.System.setProperty("foo", "bar")
-end
\ No newline at end of file
+end
diff --git a/tests/compile_with_parent/Buildfile b/tests/compile_with_parent/Buildfile
index 0a2f085..97dbeab 100644
--- a/tests/compile_with_parent/Buildfile
+++ b/tests/compile_with_parent/Buildfile
@@ -8,11 +8,10 @@ unless File.exist? File.join("lib", File.basename(LOG4J.to_s))
end
define "parent" do
-
+
define "child" do
-
+
compile.with project.parent.path_to(File.join("lib", File.basename(LOG4J.to_s)))
-
+
end
end
-
diff --git a/tests/helloWorld/Buildfile b/tests/helloWorld/Buildfile
index 8a26a34..fadd530 100644
--- a/tests/helloWorld/Buildfile
+++ b/tests/helloWorld/Buildfile
@@ -14,7 +14,7 @@
# the License.
define "helloWorld", :version => "1.0", :group => "org.buildr" do
-
+
package(:jar)
-
-end
\ No newline at end of file
+
+end
diff --git a/tests/helloWorldEcj/Buildfile b/tests/helloWorldEcj/Buildfile
index ccce6c3..54aa7ff 100644
--- a/tests/helloWorldEcj/Buildfile
+++ b/tests/helloWorldEcj/Buildfile
@@ -14,7 +14,7 @@
# the License.
define "helloWorld", :version => "1.0", :group => "org.buildr" do
-
+
compile.using(:ecj) do
p Java.classpath
end
diff --git a/tests/include_as/Buildfile b/tests/include_as/Buildfile
index 67c1c8e..838621a 100644
--- a/tests/include_as/Buildfile
+++ b/tests/include_as/Buildfile
@@ -18,7 +18,7 @@ SLF4J_API = "org.slf4j:slf4j-api:jar:1.6.1"
define "proj" do
project.version = "1.0"
- project.group = "org.example"
+ project.group = "org.example"
package(:zip).include(_("doc"), :as => "docu")
package(:zip).include(artifact(SLF4J_API), :as => "lib/logging.jar")
-end
\ No newline at end of file
+end
diff --git a/tests/include_path/Buildfile b/tests/include_path/Buildfile
index 701fb44..da43d3e 100644
--- a/tests/include_path/Buildfile
+++ b/tests/include_path/Buildfile
@@ -18,7 +18,7 @@ SLF4J_API = "org.slf4j:slf4j-api:jar:1.6.1"
define "proj" do
project.version = "1.0"
- project.group = "org.example"
+ project.group = "org.example"
package(:zip).include(_("doc"), :path => "distrib")
package(:zip).include(artifact(SLF4J_API), :path => "distrib/lib")
-end
\ No newline at end of file
+end
diff --git a/tests/integration_testing.rb b/tests/integration_testing.rb
index 3144c95..739d1a5 100644
--- a/tests/integration_testing.rb
+++ b/tests/integration_testing.rb
@@ -109,7 +109,7 @@ assert(!zip.get_entry("lib/logging.jar").nil?)
end
end
-
+
class RunJetty9 < Test::Unit::TestCase
def test_RunJetty9
diff --git a/tests/junit3/Buildfile b/tests/junit3/Buildfile
index f3adf0a..9541d39 100644
--- a/tests/junit3/Buildfile
+++ b/tests/junit3/Buildfile
@@ -5,5 +5,5 @@ Buildr.settings.build['junit'] = '3.8.1'
define "foo" do
compile
test
-
-end
\ No newline at end of file
+
+end
diff --git a/tests/package_war_as_jar/Buildfile b/tests/package_war_as_jar/Buildfile
index 91e024a..31cebf0 100644
--- a/tests/package_war_as_jar/Buildfile
+++ b/tests/package_war_as_jar/Buildfile
@@ -1,6 +1,6 @@
module PackageWarAsJar
-
+
def package_as_war_spec(spec)
spec.merge(:type => "jar")
end
@@ -8,8 +8,7 @@ end
define "webapp", :version => "1.0", :group => "org.group" do
project.extend PackageWarAsJar
-
+
package(:war)
-
+
end
-
\ No newline at end of file
diff --git a/tests/run_jetty6/Buildfile b/tests/run_jetty6/Buildfile
index e049e05..cc4ebf0 100644
--- a/tests/run_jetty6/Buildfile
+++ b/tests/run_jetty6/Buildfile
@@ -1,13 +1,13 @@
require 'buildr/jetty6'
require 'readline'
-
+
define "webapp", :group => 'com.example', :version => '1.0' do
compile.with(Buildr::Jetty6::REQUIRES, 'javax.servlet:javax.servlet-api:jar:3.1.0')
-
+
task("deploy-app"=>[package(:war), jetty.use]) do |task|
class << task ; attr_accessor :url, :path ; end
task.url = "http://localhost:8080/hello"
task.path = jetty.deploy(task.url, task.prerequisites.first)
end
-
-end
\ No newline at end of file
+
+end
diff --git a/tests/run_jetty6/src/main/java/MainServlet.java b/tests/run_jetty6/src/main/java/MainServlet.java
index f94d354..8282648 100644
--- a/tests/run_jetty6/src/main/java/MainServlet.java
+++ b/tests/run_jetty6/src/main/java/MainServlet.java
@@ -4,9 +4,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class MainServlet extends HttpServlet {
-
+
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.getWriter().println("Hello!");
response.setStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/run_jetty6/src/main/webapp/WEB-INF/web.xml b/tests/run_jetty6/src/main/webapp/WEB-INF/web.xml
index 9e71b89..f40d8b6 100644
--- a/tests/run_jetty6/src/main/webapp/WEB-INF/web.xml
+++ b/tests/run_jetty6/src/main/webapp/WEB-INF/web.xml
@@ -9,9 +9,9 @@
<servlet-class>MainServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
-
+
<servlet-mapping>
<servlet-name>MainServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
-</web-app>
\ No newline at end of file
+</web-app>
diff --git a/tests/run_jetty9/Buildfile b/tests/run_jetty9/Buildfile
index 78def3d..f07e296 100644
--- a/tests/run_jetty9/Buildfile
+++ b/tests/run_jetty9/Buildfile
@@ -1,13 +1,13 @@
require 'buildr/jetty'
require 'readline'
-
+
define "webapp", :group => 'com.example', :version => '1.0' do
compile.with(Buildr::Jetty::REQUIRES)
-
+
task("deploy-app"=>[package(:war), jetty.use]) do |task|
class << task ; attr_accessor :url, :path ; end
task.url = "http://localhost:8080/hello"
task.path = jetty.deploy(task.url, task.prerequisites.first)
end
-
-end
\ No newline at end of file
+
+end
diff --git a/tests/run_jetty9/src/main/java/MainServlet.java b/tests/run_jetty9/src/main/java/MainServlet.java
index f94d354..8282648 100644
--- a/tests/run_jetty9/src/main/java/MainServlet.java
+++ b/tests/run_jetty9/src/main/java/MainServlet.java
@@ -4,9 +4,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class MainServlet extends HttpServlet {
-
+
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.getWriter().println("Hello!");
response.setStatus(200);
}
-}
\ No newline at end of file
+}
diff --git a/tests/run_jetty9/src/main/webapp/WEB-INF/web.xml b/tests/run_jetty9/src/main/webapp/WEB-INF/web.xml
index 9e71b89..f40d8b6 100644
--- a/tests/run_jetty9/src/main/webapp/WEB-INF/web.xml
+++ b/tests/run_jetty9/src/main/webapp/WEB-INF/web.xml
@@ -9,9 +9,9 @@
<servlet-class>MainServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
-
+
<servlet-mapping>
<servlet-name>MainServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
-</web-app>
\ No newline at end of file
+</web-app>