Skip to content

Commit 41224c2

Browse files
committed
Add license to Ruby code
[#121307413]
1 parent 09bf5e1 commit 41224c2

File tree

7 files changed

+269
-3
lines changed

7 files changed

+269
-3
lines changed

bin/add-license

5.71 KB
Binary file not shown.

codegen/Rakefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,26 @@ end
3434
desc "Generate everything"
3535
multitask generate: [:generate_methods, :generate_method_map, :generate_basic_properties]
3636

37-
desc "License and generate everything"
38-
task license_and_generate: :generate do
37+
desc "License and generate code"
38+
task license_code: :generate do
3939
command = [this_dir.join("../bin/add-license"),
40+
"swift,h,m",
41+
"'//'",
4042
this_dir.join("../license-header.txt"),
4143
code_dir,
4244
tests_dir,
4345
integration_tests_dir].join(" ")
4446
system(command)
4547
end
4648

47-
task default: :license_and_generate
49+
desc "License and generate codegen"
50+
task license_codegen: :generate do
51+
command = [this_dir.join("../bin/add-license"),
52+
"rb",
53+
"'#'",
54+
this_dir.join("../license-header-ruby.txt"),
55+
this_dir].join(" ")
56+
system(command)
57+
end
58+
59+
task default: [:license_code, :license_codegen]

codegen/codegen_helpers.rb

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# This source code is dual-licensed under the Mozilla Public License ("MPL"),
2+
# version 1.1 and the Apache License ("ASL"), version 2.0.
3+
#
4+
# The ASL v2.0:
5+
#
6+
# ---------------------------------------------------------------------------
7+
# Copyright 2016 Pivotal Software, Inc.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
# ---------------------------------------------------------------------------
21+
#
22+
# The MPL v1.1:
23+
#
24+
# ---------------------------------------------------------------------------
25+
# The contents of this file are subject to the Mozilla Public License
26+
# Version 1.1 (the "License"); you may not use this file except in
27+
# compliance with the License. You may obtain a copy of the License at
28+
# https://www.mozilla.org/MPL/
29+
#
30+
# Software distributed under the License is distributed on an "AS IS"
31+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
32+
# License for the specific language governing rights and limitations
33+
# under the License.
34+
#
35+
# The Original Code is RabbitMQ
36+
#
37+
# The Initial Developer of the Original Code is Pivotal Software, Inc.
38+
# All Rights Reserved.
39+
#
40+
# Alternatively, the contents of this file may be used under the terms
41+
# of the Apache Standard license (the "ASL License"), in which case the
42+
# provisions of the ASL License are applicable instead of those
43+
# above. If you wish to allow use of your version of this file only
44+
# under the terms of the ASL License and not to allow others to use
45+
# your version of this file under the MPL, indicate your decision by
46+
# deleting the provisions above and replace them with the notice and
47+
# other provisions required by the ASL License. If you do not delete
48+
# the provisions above, a recipient may use your version of this file
49+
# under either the MPL or the ASL License.
50+
# ---------------------------------------------------------------------------
51+
152
module CodegenHelpers
253
def template(name)
354
ERB.new(Pathname(__dir__).join("#{name}.erb").read, nil, '-')

codegen/generate_basic_properties.rb

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# This source code is dual-licensed under the Mozilla Public License ("MPL"),
2+
# version 1.1 and the Apache License ("ASL"), version 2.0.
3+
#
4+
# The ASL v2.0:
5+
#
6+
# ---------------------------------------------------------------------------
7+
# Copyright 2016 Pivotal Software, Inc.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
# ---------------------------------------------------------------------------
21+
#
22+
# The MPL v1.1:
23+
#
24+
# ---------------------------------------------------------------------------
25+
# The contents of this file are subject to the Mozilla Public License
26+
# Version 1.1 (the "License"); you may not use this file except in
27+
# compliance with the License. You may obtain a copy of the License at
28+
# https://www.mozilla.org/MPL/
29+
#
30+
# Software distributed under the License is distributed on an "AS IS"
31+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
32+
# License for the specific language governing rights and limitations
33+
# under the License.
34+
#
35+
# The Original Code is RabbitMQ
36+
#
37+
# The Initial Developer of the Original Code is Pivotal Software, Inc.
38+
# All Rights Reserved.
39+
#
40+
# Alternatively, the contents of this file may be used under the terms
41+
# of the Apache Standard license (the "ASL License"), in which case the
42+
# provisions of the ASL License are applicable instead of those
43+
# above. If you wish to allow use of your version of this file only
44+
# under the terms of the ASL License and not to allow others to use
45+
# your version of this file under the MPL, indicate your decision by
46+
# deleting the provisions above and replace them with the notice and
47+
# other provisions required by the ASL License. If you do not delete
48+
# the provisions above, a recipient may use your version of this file
49+
# under either the MPL or the ASL License.
50+
# ---------------------------------------------------------------------------
51+
152
require 'erb'
253
require 'pathname'
354
require_relative 'codegen_helpers'

codegen/generate_method_map.rb

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# This source code is dual-licensed under the Mozilla Public License ("MPL"),
2+
# version 1.1 and the Apache License ("ASL"), version 2.0.
3+
#
4+
# The ASL v2.0:
5+
#
6+
# ---------------------------------------------------------------------------
7+
# Copyright 2016 Pivotal Software, Inc.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
# ---------------------------------------------------------------------------
21+
#
22+
# The MPL v1.1:
23+
#
24+
# ---------------------------------------------------------------------------
25+
# The contents of this file are subject to the Mozilla Public License
26+
# Version 1.1 (the "License"); you may not use this file except in
27+
# compliance with the License. You may obtain a copy of the License at
28+
# https://www.mozilla.org/MPL/
29+
#
30+
# Software distributed under the License is distributed on an "AS IS"
31+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
32+
# License for the specific language governing rights and limitations
33+
# under the License.
34+
#
35+
# The Original Code is RabbitMQ
36+
#
37+
# The Initial Developer of the Original Code is Pivotal Software, Inc.
38+
# All Rights Reserved.
39+
#
40+
# Alternatively, the contents of this file may be used under the terms
41+
# of the Apache Standard license (the "ASL License"), in which case the
42+
# provisions of the ASL License are applicable instead of those
43+
# above. If you wish to allow use of your version of this file only
44+
# under the terms of the ASL License and not to allow others to use
45+
# your version of this file under the MPL, indicate your decision by
46+
# deleting the provisions above and replace them with the notice and
47+
# other provisions required by the ASL License. If you do not delete
48+
# the provisions above, a recipient may use your version of this file
49+
# under either the MPL or the ASL License.
50+
# ---------------------------------------------------------------------------
51+
152
class GenerateMethodMap
253
include CodegenHelpers
354

codegen/generate_methods.rb

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
# This source code is dual-licensed under the Mozilla Public License ("MPL"),
2+
# version 1.1 and the Apache License ("ASL"), version 2.0.
3+
#
4+
# The ASL v2.0:
5+
#
6+
# ---------------------------------------------------------------------------
7+
# Copyright 2016 Pivotal Software, Inc.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
# ---------------------------------------------------------------------------
21+
#
22+
# The MPL v1.1:
23+
#
24+
# ---------------------------------------------------------------------------
25+
# The contents of this file are subject to the Mozilla Public License
26+
# Version 1.1 (the "License"); you may not use this file except in
27+
# compliance with the License. You may obtain a copy of the License at
28+
# https://www.mozilla.org/MPL/
29+
#
30+
# Software distributed under the License is distributed on an "AS IS"
31+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
32+
# License for the specific language governing rights and limitations
33+
# under the License.
34+
#
35+
# The Original Code is RabbitMQ
36+
#
37+
# The Initial Developer of the Original Code is Pivotal Software, Inc.
38+
# All Rights Reserved.
39+
#
40+
# Alternatively, the contents of this file may be used under the terms
41+
# of the Apache Standard license (the "ASL License"), in which case the
42+
# provisions of the ASL License are applicable instead of those
43+
# above. If you wish to allow use of your version of this file only
44+
# under the terms of the ASL License and not to allow others to use
45+
# your version of this file under the MPL, indicate your decision by
46+
# deleting the provisions above and replace them with the notice and
47+
# other provisions required by the ASL License. If you do not delete
48+
# the provisions above, a recipient may use your version of this file
49+
# under either the MPL or the ASL License.
50+
# ---------------------------------------------------------------------------
51+
152
require 'active_support/inflector'
253
require 'erb'
354
require 'pathname'

license-header-ruby.txt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This source code is dual-licensed under the Mozilla Public License ("MPL"),
2+
# version 1.1 and the Apache License ("ASL"), version 2.0.
3+
#
4+
# The ASL v2.0:
5+
#
6+
# ---------------------------------------------------------------------------
7+
# Copyright 2016 Pivotal Software, Inc.
8+
#
9+
# Licensed under the Apache License, Version 2.0 (the "License");
10+
# you may not use this file except in compliance with the License.
11+
# You may obtain a copy of the License at
12+
#
13+
# http://www.apache.org/licenses/LICENSE-2.0
14+
#
15+
# Unless required by applicable law or agreed to in writing, software
16+
# distributed under the License is distributed on an "AS IS" BASIS,
17+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
# See the License for the specific language governing permissions and
19+
# limitations under the License.
20+
# ---------------------------------------------------------------------------
21+
#
22+
# The MPL v1.1:
23+
#
24+
# ---------------------------------------------------------------------------
25+
# The contents of this file are subject to the Mozilla Public License
26+
# Version 1.1 (the "License"); you may not use this file except in
27+
# compliance with the License. You may obtain a copy of the License at
28+
# https://www.mozilla.org/MPL/
29+
#
30+
# Software distributed under the License is distributed on an "AS IS"
31+
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
32+
# License for the specific language governing rights and limitations
33+
# under the License.
34+
#
35+
# The Original Code is RabbitMQ
36+
#
37+
# The Initial Developer of the Original Code is Pivotal Software, Inc.
38+
# All Rights Reserved.
39+
#
40+
# Alternatively, the contents of this file may be used under the terms
41+
# of the Apache Standard license (the "ASL License"), in which case the
42+
# provisions of the ASL License are applicable instead of those
43+
# above. If you wish to allow use of your version of this file only
44+
# under the terms of the ASL License and not to allow others to use
45+
# your version of this file under the MPL, indicate your decision by
46+
# deleting the provisions above and replace them with the notice and
47+
# other provisions required by the ASL License. If you do not delete
48+
# the provisions above, a recipient may use your version of this file
49+
# under either the MPL or the ASL License.
50+
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)