Skip to content

Commit 443d57d

Browse files
author
Vitor Silva
committed
add new gulp task to append the license text; append to all files in src folder the license;
1 parent 2ff4b0c commit 443d57d

33 files changed

+751
-0
lines changed

gulpfile.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,71 @@ var uglify = require('gulp-uglify');
6060
var bump = require('gulp-bump');
6161
var gulpif = require('gulp-if');
6262
var argv = require('yargs').argv;
63+
var path = require('path');
6364

6465
var pkg = require('./package.json');
6566

67+
gulp.task('license', function() {
68+
69+
var clean = argv.clean;
70+
if (!clean) clean = false;
71+
72+
return gulp.src(['src/**/*.js'])
73+
.pipe(prependLicense(clean));
74+
75+
});
76+
77+
function prependLicense(clean) {
78+
79+
var license = `/**
80+
* Copyright 2016 PT Inovação e Sistemas SA
81+
* Copyright 2016 INESC-ID
82+
* Copyright 2016 QUOBIS NETWORKS SL
83+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
84+
* Copyright 2016 ORANGE SA
85+
* Copyright 2016 Deutsche Telekom AG
86+
* Copyright 2016 Apizee
87+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
88+
*
89+
* Licensed under the Apache License, Version 2.0 (the "License");
90+
* you may not use this file except in compliance with the License.
91+
* You may obtain a copy of the License at
92+
*
93+
* http://www.apache.org/licenses/LICENSE-2.0
94+
*
95+
* Unless required by applicable law or agreed to in writing, software
96+
* distributed under the License is distributed on an "AS IS" BASIS,
97+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
98+
* See the License for the specific language governing permissions and
99+
* limitations under the License.
100+
**/
101+
`;
102+
103+
return through.obj(function(file, enc, cb) {
104+
105+
if (file.isNull()) {
106+
return cb(new Error('Fil is null'));
107+
}
108+
109+
if (file.isStream()) {
110+
return cb(new Error('Streaming not supported'));
111+
}
112+
113+
var dest = path.dirname(file.path);
114+
115+
return gulp.src(file.path)
116+
.pipe(replace(license, ''))
117+
.pipe(gulpif(!clean, insert.prepend(license)))
118+
.pipe(gulp.dest(dest))
119+
.on('end', function() {
120+
cb();
121+
});
122+
123+
});
124+
125+
}
126+
127+
66128
gulp.task('runtime', function() {
67129

68130
var compact = argv.compact;

readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ To run karma tests is mandatory to run **live-server** because of the mock-up's
217217
#### <a id="Tasks">Gulp Tasks</a>
218218
219219
- [Documentation](#documentation)
220+
- [License](#license)
220221
- [Dist](#dist)
221222
- [Build](#build)
222223
- [Encode](#encode)
@@ -237,6 +238,12 @@ Generate all documentation associated to runtime core;
237238
238239
`gulp docx`
239240
241+
##### License
242+
243+
To add the license text to all files in src folder;
244+
245+
`gulp license`
246+
240247
##### Dist
241248
242249
To distribute the runtime-core, you can make a distribution file.

src/bus/Bus.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
23+
/**
224
* @author micaelpedrosa@gmail.com
325
* Minimal interface and implementation to send and receive messages. It can be reused in many type of components.
426
* Components that need a message system should receive this class as a dependency or extend it.

src/bus/MessageBus.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
123
import Bus from './Bus';
224
import Pipeline from './Pipeline';
325
/**

src/bus/MiniBus.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
123
import Bus from './Bus';
224

325
class MiniBus extends Bus {

src/bus/Pipeline.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
23+
/**
224
* @author micaelpedrosa@gmail.com
325
* Pipeline
426
* Sequencial processor of methods. Similar to how Sequential Promise's work, but better fit for message processing.

src/graphconnector/BloomFilter.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
123
/*
224
Adapted from https://github.com/jasondavies/bloomfilter.js
325

src/graphconnector/GlobalRegistryRecord.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
23+
/**
224
* Represents the user's information for the global registry.
325
* @author beierle@tu-berlin.de
426
*/

src/graphconnector/GraphConnector.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
123
import GraphConnectorContactData from './GraphConnectorContactData';
224
import BloomFilter from './BloomFilter';
325
import GlobalRegistryRecord from './GlobalRegistryRecord';

src/graphconnector/GraphConnectorContactData.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
/**
2+
* Copyright 2016 PT Inovação e Sistemas SA
3+
* Copyright 2016 INESC-ID
4+
* Copyright 2016 QUOBIS NETWORKS SL
5+
* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V
6+
* Copyright 2016 ORANGE SA
7+
* Copyright 2016 Deutsche Telekom AG
8+
* Copyright 2016 Apizee
9+
* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License");
12+
* you may not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS,
19+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
**/
23+
/**
224
* Represents information about a contact.
325
* @author beierle@tu-berlin.de
426
*/

0 commit comments

Comments
 (0)