14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ # Add Apache license header to a file
18
+ add_license_header () {
19
+ local license=" \
20
+ /*
21
+ * Licensed to the Apache Software Foundation (ASF) under one
22
+ * or more contributor license agreements. See the NOTICE file
23
+ * distributed with this work for additional information
24
+ * regarding copyright ownership. The ASF licenses this file
25
+ * to you under the Apache License, Version 2.0 (the
26
+ * \" License\" ); you may not use this file except in compliance
27
+ * with the License. You may obtain a copy of the License at
28
+ *
29
+ * http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing,
32
+ * software distributed under the License is distributed on an
33
+ * \" AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
34
+ * KIND, either express or implied. See the License for the
35
+ * specific language governing permissions and limitations
36
+ * under the License.
37
+ */"
38
+
39
+ local file=" $1 "
40
+ local temp_file=" ${file} .tmp"
41
+
42
+ echo " $license " > " $temp_file "
43
+ cat " $file " >> " $temp_file "
44
+ mv " $temp_file " " $file "
45
+ }
46
+
17
47
# generate model
18
48
mvn typescript-generator:generate -f streampipes-model/pom.xml
19
49
50
+ # add license header to the generated model file
51
+ add_license_header streampipes-model/target/typescript-generator/streampipes-model.ts
52
+
53
+ # copy the model file to the UI project
54
+ cp streampipes-model/target/typescript-generator/streampipes-model.ts ui/projects/streampipes/platform-services/src/lib/model/gen/
55
+
20
56
# generate model-client
21
57
mvn typescript-generator:generate -f streampipes-model-client/pom.xml
22
58
23
- # copy files
24
- mv streampipes-model/target/typescript-generator/streampipes-model.ts ui/projects/streampipes/platform-services/src/lib/model/gen/
25
- mv streampipes-model-client/target/typescript-generator/streampipes-model-client.ts ui/projects/streampipes/platform-services/src/lib/model/gen/
59
+ # add license header to the generated model-client file
60
+ add_license_header streampipes-model-client/target/typescript-generator/streampipes-model-client.ts
61
+
62
+ # copy the model-client file to the UI project
63
+ cp streampipes-model-client/target/typescript-generator/streampipes-model-client.ts ui/projects/streampipes/platform-services/src/lib/model/gen/
0 commit comments