Skip to content
Browse files

Added license notice headers to src files.

  • Loading branch information...
1 parent 876ade0 commit 070705d6f3d9028179704640df2dd7f34b1ebd09 @tobias tobias committed Jul 6, 2013
View
14 examples/echo/echo-client.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns example.echo.echo-client
(:require [vertx.core :as vertx]
[vertx.net :as net]
View
14 examples/echo/echo-server.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns example.echo.echo-server
(:require [vertx.net :as net]
[vertx.buffer :as buf]
View
14 examples/eventbus/handler.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns example.handler
(:require [vertx.eventbus :as eb]))
View
14 examples/eventbus/sender.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns example.sender
(:require [vertx.core :as vertx]
[vertx.eventbus :as eb]))
View
14 src/main/clojure/vertx/buffer.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.buffer
"Functions for operating on Vert.x Buffers"
(:require [vertx.core :as core])
View
14 src/main/clojure/vertx/core.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.core
"Vert.x core functionality."
(:require [vertx.utils :refer :all])
View
14 src/main/clojure/vertx/eventbus.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.eventbus
"Functions for operating on the eventbus and its messages."
(:refer-clojure :exclude [send])
View
14 src/main/clojure/vertx/http.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.http
(:import (org.vertx.java.core.streams Pump)
(org.vertx.java.core Vertx Handler AsyncResultHandler)
View
14 src/main/clojure/vertx/net.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.net
(:require [vertx.core :as core]
[vertx.utils :as u]))
View
14 src/main/clojure/vertx/shareddata.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.shareddata
"Functions for operating on Vert.x Shareddata.
Though shareddata isn't that useful for Clojure,
View
14 src/main/clojure/vertx/stream.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.stream
"Functions that operate on Vert.x ReadStreams and WriteStreams."
(:require [vertx.core :as core])
View
14 src/main/clojure/vertx/testtools.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.testtools
(:refer-clojure :exclude [assert])
(:require [vertx.core :as core]
View
14 src/main/clojure/vertx/utils.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns ^:internal ^:no-doc vertx.utils
"Internal utility functions."
(:require [clojure.string :as s]
View
10 src/main/java/io/vertx/lang/clojure/ClojureVerticleFactory.java
@@ -1,12 +1,12 @@
/*
- * Copyright 2011-2012 the original author or authors.
- *
+ * Copyright 2013 the original author or authors.
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
View
14 src/test/clojure/vertx/utils_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.utils-test
(:require [vertx.utils :refer :all]
[clojure.test :refer :all])
View
16 src/test/java/io/vertx/lang/clojure/integration/APIIntegrationTests.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package io.vertx.lang.clojure.integration;
import org.junit.Test;
View
16 src/test/java/io/vertx/test/Biscuit.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package io.vertx.test;
public class Biscuit {
View
14 src/test/resources/buffer/buffer_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.buffer-test
(:require [vertx.buffer :as b]
[vertx.testtools :as t]
View
14 src/test/resources/deploy/child.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns deploy.child
(:require [vertx.core :as core]
[vertx.eventbus :as eb]
View
14 src/test/resources/deploy/deploy_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.deploy-test
(:require [vertx.testtools :as t]
[vertx.core :as core]
View
14 src/test/resources/eventbus/eventbus_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.eventbus-test
(:require [vertx.testtools :as t]
[vertx.core :as core]
View
14 src/test/resources/net/net_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.net-test
(:require [vertx.net :as net]
[vertx.buffer :as buf]
View
14 src/test/resources/shareddata/shareddata_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.shareddata-test
(:require [vertx.shareddata :as shared]
[vertx.testtools :as t]))
View
14 src/test/resources/timer/timer_test.clj
@@ -1,3 +1,17 @@
+;; Copyright 2013 the original author or authors.
+;;
+;; Licensed under the Apache License, Version 2.0 (the "License");
+;; you may not use this file except in compliance with the License.
+;; You may obtain a copy of the License at
+;;
+;; http://www.apache.org/licenses/LICENSE-2.0
+;;
+;; Unless required by applicable law or agreed to in writing, software
+;; distributed under the License is distributed on an "AS IS" BASIS,
+;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;; See the License for the specific language governing permissions and
+;; limitations under the License.
+
(ns vertx.timer-test
(:require [vertx.testtools :as t]
[vertx.core :as core]))
View
154 tools/copyrighter.rb
@@ -0,0 +1,154 @@
+#!/usr/bin/env ruby
+
+require 'find'
+require 'fileutils'
+
+COPYRIGHT_STATEMENT = <<END
+Copyright 2013 the original author or authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+END
+
+
+PRUNE_DIRS = [ 'target', 'tmp', '.git' ]
+
+def comment_wrap(text, comment_line, comment_begin=nil, comment_end=nil)
+ wrapped = ""
+ wrapped << "#{comment_begin}\n" if comment_begin
+ text.split("\n").each do |line|
+ wrapped << "#{comment_line} #{line}\n"
+ end
+ wrapped << "#{comment_end}\n" if comment_end
+ wrapped
+end
+
+LANGUAGE_COMMENT_DELIMS = {
+ :java => [ ' *', '/*', ' */' ],
+ :xml => [ ' ', '<!--', '-->' ],
+ #:ruby => [ '#' ],
+ :clojure => [ ';;' ]
+}
+
+COPYRIGHT_STATEMENTS = {
+ :java => comment_wrap( COPYRIGHT_STATEMENT, *LANGUAGE_COMMENT_DELIMS[:java] ),
+ :xml => comment_wrap( COPYRIGHT_STATEMENT, *LANGUAGE_COMMENT_DELIMS[:xml] ),
+ #:ruby => comment_wrap( COPYRIGHT_STATEMENT, *LANGUAGE_COMMENT_DELIMS[:ruby] ),
+ :clojure => comment_wrap( COPYRIGHT_STATEMENT, *LANGUAGE_COMMENT_DELIMS[:clojure] )
+}
+
+def header(lang)
+ COPYRIGHT_STATEMENTS[lang]
+end
+
+def project_dirs
+ dirs = []
+ Find.find( '.' ) do |path|
+ basename = File.basename( path )
+ Find.prune if ( PRUNE_DIRS.include?( basename ) )
+ dirs << File.dirname( path ) if ( basename == 'pom.xml' )
+ end
+ dirs
+end
+
+def copywrite_dir(dir, lang, glob)
+ $stderr.puts("Inspecting #{glob}")
+ Dir[ File.join( dir, glob ) ].each do |file|
+ copywrite_file( file, lang )
+ end
+end
+
+def copywrite_file(file, lang)
+ bak_file = file + '.bak'
+ FileUtils.cp( file, bak_file )
+ File.open( bak_file, 'r' ) do |input_file|
+ #output_file = $stdout
+ File.open( file, 'w' ) do |output_file|
+ skip_header_comment(input_file, lang)
+ output_file.puts header(lang)
+ output_file.puts "\n"
+ input_file.each_line do |line|
+ output_file.puts line
+ end
+ end
+ end
+ FileUtils.rm( bak_file )
+end
+
+def skip_header_comment(input, lang)
+ delims = LANGUAGE_COMMENT_DELIMS[lang]
+ skip_blank_lines( input )
+ if ( delims.size == 1 )
+ skip_simple_header_comment( input, *delims )
+ else
+ skip_block_header_comment( input, *delims )
+ end
+ skip_blank_lines( input )
+end
+
+def skip_blank_lines(input)
+ while ( ! input.eof? )
+ pos = input.pos
+ line = input.readline
+ if ( line.strip != '' )
+ input.seek( pos )
+ input.seek( pos )
+ return
+ end
+ end
+end
+
+def skip_simple_header_comment(input, comment_line)
+ while ( true )
+ pos = input.pos
+ line = input.readline
+ next if ( line.strip =~ /^#{Regexp.escape(comment_line.strip)}/ )
+ input.seek( pos )
+ return
+ end
+end
+
+def skip_block_header_comment(input, comment_line, comment_begin, comment_end )
+ state = :begin
+ while ( true )
+ pos = input.pos
+ line = input.readline
+ case ( state )
+ when :begin
+ if ( line.strip =~ /^#{Regexp.escape(comment_begin.strip)}/ )
+ return if ( line.strip =~ /#{Regexp.escape(comment_end.strip)}$/ )
+ state = :skip
+ next
+ else
+ input.seek( pos )
+ return
+ end
+ when :skip
+ if ( line.strip =~ /#{Regexp.escape(comment_end.strip)}$/ )
+ return
+ end
+ end
+ end
+ return
+end
+
+project_dirs.each do |dir|
+ $stderr.puts "Copywriting: #{dir}"
+ copywrite_dir( dir, :java, "src/*/java/**/*.java" )
+ copywrite_dir( dir, :clojure, "src/*/clojure/**/*.clj" )
+ copywrite_dir( dir, :clojure, "src/test/resources/**/*.clj" )
+ copywrite_dir( dir, :clojure, "examples/**/*.clj" )
+end
+
+
+
+

0 comments on commit 070705d

Please sign in to comment.
Something went wrong with that request. Please try again.