diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e6bb7bad3615a7c236d2933bc946e2f74b6c59d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/compiler/.eslintrc b/compiler/.eslintrc index 4d857e85cafde8e72b9ce215bd7bf2b5cac85f48..4d0ce2fbc8e899cda28eade277d131ae92ed1acc 100644 --- a/compiler/.eslintrc +++ b/compiler/.eslintrc @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + { "parserOptions": { "ecmaVersion": 7, diff --git a/compiler/README.md b/compiler/README.md index f3d80c2f2906eea6b48227f4cfb7c16b35f3678e..ed7654a890ada7250afe7ea3557cbfca27189603 100644 --- a/compiler/README.md +++ b/compiler/README.md @@ -21,7 +21,7 @@ First, check whether your node version is 12.x or later; Secondly, config npm proxy and run `npm install` again. ``` npm config set strict-ssl false -npm config set registry https://cmc.centralrepo.rnd.huawei.com/npm/ +npm config set registry http://registry.npm.taobao.org ``` ### 2. Quick Start diff --git a/compiler/sample/app.ets b/compiler/sample/app.ets index 30a1983810a7bd729f821e64efc93e0ffa2b6424..0759beef2578458d5729cf17914545f210f0402d 100644 --- a/compiler/sample/app.ets +++ b/compiler/sample/app.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export default { onCreate() { console.info('Application onCreate') diff --git a/compiler/sample/pages/home.ets b/compiler/sample/pages/home.ets index 0fce6542cd8bdb2ce744974a95ef3be677e037b4..3079671f16adc3851d7a76bbceec343c10929e9c 100644 --- a/compiler/sample/pages/home.ets +++ b/compiler/sample/pages/home.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct HomeComponent { diff --git a/compiler/sample/pages/home_preview.ets b/compiler/sample/pages/home_preview.ets index 9ae05aaf335a3db82cc286f11b625408b6d2e8ed..c11cf63193c1db258160c16ba6792c4069454a8f 100644 --- a/compiler/sample/pages/home_preview.ets +++ b/compiler/sample/pages/home_preview.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct HomePreviewComponent { diff --git a/compiler/sample/pages/index.ets b/compiler/sample/pages/index.ets index 2f37ded2f7717821942bc0a93560585b3fe31eb5..2dd5eb53dad6ada0716d6ee513b0cbad26eff259 100644 --- a/compiler/sample/pages/index.ets +++ b/compiler/sample/pages/index.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct Banner { private value1: string = "hello world 4" diff --git a/compiler/sample/pages/testcases/component-01.ets b/compiler/sample/pages/testcases/component-01.ets index 44c4c183f02c5c61b92d0a3532be00504b25672a..27c1a6be7af03569a440504188aa6dbcda8020a2 100644 --- a/compiler/sample/pages/testcases/component-01.ets +++ b/compiler/sample/pages/testcases/component-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct MyComponent1 { diff --git a/compiler/sample/pages/testcases/componentGridTest.ets b/compiler/sample/pages/testcases/componentGridTest.ets index ef46eff71b79377a3d58f28e8d522047a0f2b072..54d1cd8e39fcebe5448c100049bdc8349b47fe04 100644 --- a/compiler/sample/pages/testcases/componentGridTest.ets +++ b/compiler/sample/pages/testcases/componentGridTest.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct GridRootView { diff --git a/compiler/sample/pages/testcases/componentListTest.ets b/compiler/sample/pages/testcases/componentListTest.ets index 361a80233f86e0d1be983be6ec4490b2ae11f692..37d42cfcb0ce0f2619dbace1ef6d7a112a0916e8 100644 --- a/compiler/sample/pages/testcases/componentListTest.ets +++ b/compiler/sample/pages/testcases/componentListTest.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct ListRootView { diff --git a/compiler/sample/pages/testcases/constructor-01.ets b/compiler/sample/pages/testcases/constructor-01.ets index f2befe6cb1c789ab8676d800f43dc9c3b82f27e9..139b5c496001d15415b3267f73a096376373bd19 100644 --- a/compiler/sample/pages/testcases/constructor-01.ets +++ b/compiler/sample/pages/testcases/constructor-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class DataModel{ private myData1: number = 0 } diff --git a/compiler/sample/pages/testcases/constructor-02.ets b/compiler/sample/pages/testcases/constructor-02.ets index 03b017c9f154889f751e9b296322be81ab21d0e5..72eb633272a43923f46f2afab68192f072cd84ac 100644 --- a/compiler/sample/pages/testcases/constructor-02.ets +++ b/compiler/sample/pages/testcases/constructor-02.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct MyLinkComponent { diff --git a/compiler/sample/pages/testcases/constructor-03.ets b/compiler/sample/pages/testcases/constructor-03.ets index 1d790e2acdf70c6119f5ba5019ab44db6c376c3b..4a482cb70b0401576ee1595d71294987dc5ca323 100644 --- a/compiler/sample/pages/testcases/constructor-03.ets +++ b/compiler/sample/pages/testcases/constructor-03.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct MyPropComponent { diff --git a/compiler/sample/pages/testcases/expected/component-01-expected.js b/compiler/sample/pages/testcases/expected/component-01-expected.js index 849492f2a944440c64727ad13c4dc2bd3d736b30..eda0bbd2193add331685b560314985f47c646fdd 100644 --- a/compiler/sample/pages/testcases/expected/component-01-expected.js +++ b/compiler/sample/pages/testcases/expected/component-01-expected.js @@ -1,6 +1,21 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyComponent extends View { constructor() { - super(); + super(); this.value1 = value1; this.value2 = value2; this.value3 = value3; diff --git a/compiler/sample/pages/testcases/expected/constructor-01-expected.js b/compiler/sample/pages/testcases/expected/constructor-01-expected.js index 76555d8b3c700e84cdc1686b80cad24dc22a0a3a..0dd9982885d93edc7aadb36287e298a4fb382bf1 100644 --- a/compiler/sample/pages/testcases/expected/constructor-01-expected.js +++ b/compiler/sample/pages/testcases/expected/constructor-01-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyStateComponent extends View { constructor(inputParams) { super(); diff --git a/compiler/sample/pages/testcases/expected/constructor-02-expected.js b/compiler/sample/pages/testcases/expected/constructor-02-expected.js index c257a6b1653a81279550fa655b94dadeeb6f374b..6c5de4e0c4dddb0e6e804aed797b923e99b25eec 100644 --- a/compiler/sample/pages/testcases/expected/constructor-02-expected.js +++ b/compiler/sample/pages/testcases/expected/constructor-02-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyLinkComponent extends View { constructor(inputParams) { super(); diff --git a/compiler/sample/pages/testcases/expected/constructor-03-expected.js b/compiler/sample/pages/testcases/expected/constructor-03-expected.js index ae75c757dd8d5be9f372047e3549e0417c12b277..67382c3d3f2678cf22c25f8fe17d61d5a5c458e0 100644 --- a/compiler/sample/pages/testcases/expected/constructor-03-expected.js +++ b/compiler/sample/pages/testcases/expected/constructor-03-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyPropComponent extends View { constructor(inputParams) { super(); diff --git a/compiler/sample/pages/testcases/expected/link-01-expected.js b/compiler/sample/pages/testcases/expected/link-01-expected.js index 46c737697f8d459a3a230e390411faeb19ec4367..2d3a148a513f9b09af0b431e4236cadf3f5d2777 100644 --- a/compiler/sample/pages/testcases/expected/link-01-expected.js +++ b/compiler/sample/pages/testcases/expected/link-01-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyLinkTestComponent extends View { constructor(inputParams) { super(); diff --git a/compiler/sample/pages/testcases/expected/new-01-expected.js b/compiler/sample/pages/testcases/expected/new-01-expected.js index 68c475807c92a9d8c5f2c1e60b11b0b52d5cf394..7e46d89c68f69fa2d865519c7f7eb3906409765a 100644 --- a/compiler/sample/pages/testcases/expected/new-01-expected.js +++ b/compiler/sample/pages/testcases/expected/new-01-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyComponent extends View { constructor(value1 = "hello world 1", value2 = "hello world 2", value3 = "hello world 3") { super(); diff --git a/compiler/sample/pages/testcases/expected/new-02-expected.js b/compiler/sample/pages/testcases/expected/new-02-expected.js index 68c475807c92a9d8c5f2c1e60b11b0b52d5cf394..7e46d89c68f69fa2d865519c7f7eb3906409765a 100644 --- a/compiler/sample/pages/testcases/expected/new-02-expected.js +++ b/compiler/sample/pages/testcases/expected/new-02-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyComponent extends View { constructor(value1 = "hello world 1", value2 = "hello world 2", value3 = "hello world 3") { super(); diff --git a/compiler/sample/pages/testcases/expected/new-03-expected.js b/compiler/sample/pages/testcases/expected/new-03-expected.js index 4f153f34b13189530a6e242ff82ec80ffb8dbfd3..9bf4eae84c9276e69ef908b5f7946966024e2f32 100644 --- a/compiler/sample/pages/testcases/expected/new-03-expected.js +++ b/compiler/sample/pages/testcases/expected/new-03-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class Banner extends View { constructor(value1 = "hello world 2") { super(); diff --git a/compiler/sample/pages/testcases/expected/new-04-expected.js b/compiler/sample/pages/testcases/expected/new-04-expected.js index 4f153f34b13189530a6e242ff82ec80ffb8dbfd3..9bf4eae84c9276e69ef908b5f7946966024e2f32 100644 --- a/compiler/sample/pages/testcases/expected/new-04-expected.js +++ b/compiler/sample/pages/testcases/expected/new-04-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class Banner extends View { constructor(value1 = "hello world 2") { super(); diff --git a/compiler/sample/pages/testcases/expected/struct-01-expected.js b/compiler/sample/pages/testcases/expected/struct-01-expected.js index 8df48157ba1d981fa2a00133569a080fde1bf3b9..3808218eacadff387251c6e52389904dc28681e8 100644 --- a/compiler/sample/pages/testcases/expected/struct-01-expected.js +++ b/compiler/sample/pages/testcases/expected/struct-01-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyComponent extends View { render() { } diff --git a/compiler/sample/pages/testcases/expected/struct-02-expected.js b/compiler/sample/pages/testcases/expected/struct-02-expected.js index a9ba8932dcf2f4afbc116d1519df79962a74720e..c68c35b33b95e61665dca1647a453a3d06542f53 100644 --- a/compiler/sample/pages/testcases/expected/struct-02-expected.js +++ b/compiler/sample/pages/testcases/expected/struct-02-expected.js @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class MyComponent { build() { } diff --git a/compiler/sample/pages/testcases/forEachComplexModel.ets b/compiler/sample/pages/testcases/forEachComplexModel.ets index 64ad0c5046b615f6a9df4b4ec0a7a8439e7040db..5b0a58a805c2afa0b22cd223ebae7719645246f4 100644 --- a/compiler/sample/pages/testcases/forEachComplexModel.ets +++ b/compiler/sample/pages/testcases/forEachComplexModel.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + // class without @Component convert tool will not process. class Month { year: number = 2010; // why add assignment here, TS grammar required, if not it will omit by TSC. diff --git a/compiler/sample/pages/testcases/forEachSimpleModel.ets b/compiler/sample/pages/testcases/forEachSimpleModel.ets index f98c4e704a78f3f7cd0145fb83915fc4ff505e84..ad1a0a2de35cd5d216b2c6d1adf1f9969037d19e 100644 --- a/compiler/sample/pages/testcases/forEachSimpleModel.ets +++ b/compiler/sample/pages/testcases/forEachSimpleModel.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct MyComponent2 { diff --git a/compiler/sample/pages/testcases/image.ets b/compiler/sample/pages/testcases/image.ets index 1fc8380654d797295abef6207eb1092a32323ba5..632256b50b845e1aab7bf0df165da4143bbae525 100644 --- a/compiler/sample/pages/testcases/image.ets +++ b/compiler/sample/pages/testcases/image.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct UserView1 { diff --git a/compiler/sample/pages/testcases/import-api-01.ets b/compiler/sample/pages/testcases/import-api-01.ets index 2256c7e58601be023750fec011a0afb5b92cf204..7c1d6a6bc1c80c2517ab6c88a7728674eb701a7f 100644 --- a/compiler/sample/pages/testcases/import-api-01.ets +++ b/compiler/sample/pages/testcases/import-api-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import fetch from '@system.fetch' import router from '@system.router' diff --git a/compiler/sample/pages/testcases/link-01.ets b/compiler/sample/pages/testcases/link-01.ets index 55ffc8ca530a694eb33b01756195f78b286dd801..1af77002e12cb719fda81c56b4da139ddc6141a5 100644 --- a/compiler/sample/pages/testcases/link-01.ets +++ b/compiler/sample/pages/testcases/link-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct MyLinkTestComponent { @Link myLink1?: any diff --git a/compiler/sample/pages/testcases/linkArrayModel.ets b/compiler/sample/pages/testcases/linkArrayModel.ets index 45a1d9ccfac971082df8e997acab8f126c722b07..882e7916998f12b80c9bdf0d63b62a492f0ae41a 100644 --- a/compiler/sample/pages/testcases/linkArrayModel.ets +++ b/compiler/sample/pages/testcases/linkArrayModel.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct Parent { diff --git a/compiler/sample/pages/testcases/linkPropCombo.ets b/compiler/sample/pages/testcases/linkPropCombo.ets index 7c689737d28d1be8f8680a869544fb6e5e9a78b8..8ba060e718598fd20df71a5233f0d2a0b1956f84 100644 --- a/compiler/sample/pages/testcases/linkPropCombo.ets +++ b/compiler/sample/pages/testcases/linkPropCombo.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct ParentView { diff --git a/compiler/sample/pages/testcases/linkSimpleModel.ets b/compiler/sample/pages/testcases/linkSimpleModel.ets index bf2ccc351bf40febb5f4a503fe2f0dcc40871dbb..c68c24863c25467144d51e9647bc5ea44e832740 100644 --- a/compiler/sample/pages/testcases/linkSimpleModel.ets +++ b/compiler/sample/pages/testcases/linkSimpleModel.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct Player { diff --git a/compiler/sample/pages/testcases/new-01.ets b/compiler/sample/pages/testcases/new-01.ets index 235c5dd3f751559c48e8d6b68f474bb5b14d8d73..cbe88d23a63c2a3d016078b45e7e1008ea3a29b2 100644 --- a/compiler/sample/pages/testcases/new-01.ets +++ b/compiler/sample/pages/testcases/new-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct MyComponent3 { diff --git a/compiler/sample/pages/testcases/new-0101.ets b/compiler/sample/pages/testcases/new-0101.ets index 235c5dd3f751559c48e8d6b68f474bb5b14d8d73..cbe88d23a63c2a3d016078b45e7e1008ea3a29b2 100644 --- a/compiler/sample/pages/testcases/new-0101.ets +++ b/compiler/sample/pages/testcases/new-0101.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct MyComponent3 { diff --git a/compiler/sample/pages/testcases/new-02.ets b/compiler/sample/pages/testcases/new-02.ets index ea285c94ff09bc9ca5a19dd2231380a43946a93f..d60117669f59c630651f365e7d815a79068aaf26 100644 --- a/compiler/sample/pages/testcases/new-02.ets +++ b/compiler/sample/pages/testcases/new-02.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct MyComponent4 { diff --git a/compiler/sample/pages/testcases/new-03.ets b/compiler/sample/pages/testcases/new-03.ets index fa0bc708c9c6dbbd681864a869b78fe7bcaaf9aa..de28fd142d9ebf6766f4bafb0bc5355c178c6894 100644 --- a/compiler/sample/pages/testcases/new-03.ets +++ b/compiler/sample/pages/testcases/new-03.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct Banner { private value1: string = "hello world 2"; diff --git a/compiler/sample/pages/testcases/new-04.ets b/compiler/sample/pages/testcases/new-04.ets index 73e6fff351673a89e14cdd08db640e0b50d9ed1c..b3e93de2cf4c499e2289ac3679fc05323a9223f4 100644 --- a/compiler/sample/pages/testcases/new-04.ets +++ b/compiler/sample/pages/testcases/new-04.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct Banner { private value1: string = "hello world 2"; diff --git a/compiler/sample/pages/testcases/onclicktest.ets b/compiler/sample/pages/testcases/onclicktest.ets index 2a11f36ed4acb1a59f33e9bc5d372ce1ef2c09a9..305ff1e58b1da5184c9ae43fdb7c0b396d93eee2 100644 --- a/compiler/sample/pages/testcases/onclicktest.ets +++ b/compiler/sample/pages/testcases/onclicktest.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ @Entry @Component diff --git a/compiler/sample/pages/testcases/propSimpleModel.ets b/compiler/sample/pages/testcases/propSimpleModel.ets index 5c1569bfc653f1be8838d007f2ca0c5649a75c56..6d7b371b0b5d3d10a0d09acbf9cde38a698a6a09 100644 --- a/compiler/sample/pages/testcases/propSimpleModel.ets +++ b/compiler/sample/pages/testcases/propSimpleModel.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct ParentComponent { diff --git a/compiler/sample/pages/testcases/showcaseCovid19.ets b/compiler/sample/pages/testcases/showcaseCovid19.ets index b92d5a3cd31d7d71fae704932413a43eecb67758..01a058645b6bd5327e49a350d80f541b7752ce05 100644 --- a/compiler/sample/pages/testcases/showcaseCovid19.ets +++ b/compiler/sample/pages/testcases/showcaseCovid19.ets @@ -1,4 +1,17 @@ - +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ /** * COVID Showcase App @@ -8,10 +21,9 @@ * * ACE @ Web Helsinki * + */ - - const enum FlexAlign { AUTO, diff --git a/compiler/sample/pages/testcases/simpleText.ets b/compiler/sample/pages/testcases/simpleText.ets index 2d93d031800386184d77976df1dcfe1f5609db37..e05d17131fa4ca4f6c3118eb092ba10d48f595db 100644 --- a/compiler/sample/pages/testcases/simpleText.ets +++ b/compiler/sample/pages/testcases/simpleText.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Entry @Component struct UserView { diff --git a/compiler/sample/pages/testcases/stacktestsuite.ets b/compiler/sample/pages/testcases/stacktestsuite.ets index dfc9fcfd5329e9baee439f199ccb38855f6ca735..56908b36b5f6b4152eb51b2682dc7ea615912e24 100644 --- a/compiler/sample/pages/testcases/stacktestsuite.ets +++ b/compiler/sample/pages/testcases/stacktestsuite.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ class Test { align:number = 0; diff --git a/compiler/sample/pages/testcases/stateArrayReverse.ets b/compiler/sample/pages/testcases/stateArrayReverse.ets index d6a8903e44075a6d07d6f55191a97bcc1591fb04..e63d8937f023bf36b3a51428cc49acb76db4f5fb 100644 --- a/compiler/sample/pages/testcases/stateArrayReverse.ets +++ b/compiler/sample/pages/testcases/stateArrayReverse.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ /* StateArrayReverse test case diff --git a/compiler/sample/pages/testcases/stateArrayReverseCustomView.ets b/compiler/sample/pages/testcases/stateArrayReverseCustomView.ets index 5a1a8119cbb32c30a353042f7bb8593172192df1..b127cb00ed59acd6d678bd02849d3c34535a4e3b 100644 --- a/compiler/sample/pages/testcases/stateArrayReverseCustomView.ets +++ b/compiler/sample/pages/testcases/stateArrayReverseCustomView.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class Item{ id:number = 0; label:string = ''; diff --git a/compiler/sample/pages/testcases/stateComplexType.ets b/compiler/sample/pages/testcases/stateComplexType.ets index abbe5c6b224b450d68f9a05406d91c7298dc2ef6..0d58d8b94d794e32e73d30b8f6c0736515dc0a75 100644 --- a/compiler/sample/pages/testcases/stateComplexType.ets +++ b/compiler/sample/pages/testcases/stateComplexType.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + // Customize the status data class. class Model { value: string = ''; diff --git a/compiler/sample/pages/testcases/stateStateBindingProp.ets b/compiler/sample/pages/testcases/stateStateBindingProp.ets index d2ab7f71009dc46f3f25a0f6fa4db21859d443a1..6fdad55c49996405b7295000663e887b11fccac7 100644 --- a/compiler/sample/pages/testcases/stateStateBindingProp.ets +++ b/compiler/sample/pages/testcases/stateStateBindingProp.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + class GreenButtonState { width:number = 0; diff --git a/compiler/sample/pages/testcases/struct-01.ets b/compiler/sample/pages/testcases/struct-01.ets index 0c8c1b7892eb3b94624ec3813dde50efa62bd539..941dd29f74edb6977dc3df1802b08d0b65fc916f 100644 --- a/compiler/sample/pages/testcases/struct-01.ets +++ b/compiler/sample/pages/testcases/struct-01.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component @Entry struct MyComponent7 { diff --git a/compiler/sample/pages/testcases/struct-02.ets b/compiler/sample/pages/testcases/struct-02.ets index ee57c9cde71ef7fb63e4f028d23506e74790ffa4..e98ed82f81a00fd6a7c30e5c1549621061231299 100644 --- a/compiler/sample/pages/testcases/struct-02.ets +++ b/compiler/sample/pages/testcases/struct-02.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + struct MyComponent8 { build() { } diff --git a/compiler/sample/pages/todo.ets b/compiler/sample/pages/todo.ets index f1b21f224a59140f5aca7560d5f538bfe8e4d71b..e3cbe4b4cb71587c69214dfbb2643645b4399c4f 100644 --- a/compiler/sample/pages/todo.ets +++ b/compiler/sample/pages/todo.ets @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ /** * ACE @ Web Helsinki @@ -10,7 +24,7 @@ * https://rnd-gitlab-eu-c.huawei.com/zidanehbs/ace/ace/-/blob/fin-hmf-dev-ace-diff-clean/samples/common/res/hi_topapp/assets/js/default/acediff/todoListForEach.js * This is the ouput the eDSL transpiler should generate. */ - + let tasks: Array = [ { label: "Wash the car" }, { label: "Buy some milk" }, diff --git a/compiler/test/pages/AMDComponent.ets b/compiler/test/pages/AMDComponent.ets index ab714803e55a7d73f9bc43debbeab19b0fd4f844..3135f0d8598a2fa95ab5ae35ce0a036ab2a56bfd 100644 --- a/compiler/test/pages/AMDComponent.ets +++ b/compiler/test/pages/AMDComponent.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct AMDComponent { @Link AMDComponentLink1?: any diff --git a/compiler/test/pages/DefaultComponent.ets b/compiler/test/pages/DefaultComponent.ets index 94c842e7a0d22aaf4bbbe51638286c796970807b..e0add522488de166375c7c60cecf105898bf2dfc 100644 --- a/compiler/test/pages/DefaultComponent.ets +++ b/compiler/test/pages/DefaultComponent.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct DefaultComponent { @Link DefaultComponentLink1?: any diff --git a/compiler/test/pages/ExportComponent.ets b/compiler/test/pages/ExportComponent.ets index c8332c7f6dc3aa1a17bed7e9f648270e03472b0f..d3d65b4253d9265bbc82b4acc6533ca4df606039 100644 --- a/compiler/test/pages/ExportComponent.ets +++ b/compiler/test/pages/ExportComponent.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import DefaultComponent from "./test/pages/DefaultComponent.ets" @Component diff --git a/compiler/test/pages/ExportStarComponent.ets b/compiler/test/pages/ExportStarComponent.ets index ada6303134ea7f88014baeeb65b0ec777900a49a..164a1cc91ef9db08bbff5ff4e596d7ee3ca79fbe 100644 --- a/compiler/test/pages/ExportStarComponent.ets +++ b/compiler/test/pages/ExportStarComponent.ets @@ -1 +1,16 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + export * as AllStarComponent from './test/pages/ExportComponent'; diff --git a/compiler/test/pages/LinkComponent.ets b/compiler/test/pages/LinkComponent.ets index 1357500ba993e32068b1aead74541d300de1f5fa..ffcc6115539d450f7d75d472720071acd0882e41 100644 --- a/compiler/test/pages/LinkComponent.ets +++ b/compiler/test/pages/LinkComponent.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + import DefaultComponent from "./DefaultComponent.ets" @Component diff --git a/compiler/test/pages/NamespaceComponent.ets b/compiler/test/pages/NamespaceComponent.ets index 5f3b3e87a950633c0064aeda69933e2d0b800d12..5b33ec85f474c8347637964fac2159144331975d 100644 --- a/compiler/test/pages/NamespaceComponent.ets +++ b/compiler/test/pages/NamespaceComponent.ets @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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. + */ + @Component struct NamespaceComponent1 { @Link NamespaceComponent1Link1?: any diff --git a/generateSysResource.py b/generateSysResource.py index 95f0c0bf72b8cae3acb0662e99b88ed152ecfb59..2a80ebe7bd02f0896dc54f4345528d167bed78d1 100644 --- a/generateSysResource.py +++ b/generateSysResource.py @@ -1,5 +1,20 @@ +# /* +# Copyright (c) 2021 Huawei Device Co., Ltd. +# 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. + #!/usr/bin/env python # -*- coding: utf-8 -*- + import json import os import argparse