diff --git a/compiler/.eslintrc b/compiler/.eslintrc index 4d857e85cafde8e72b9ce215bd7bf2b5cac85f48..afcd89d55da468915f0cdb8a68cd4c440f6fa7de 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/sample/app.ets b/compiler/sample/app.ets index 30a1983810a7bd729f821e64efc93e0ffa2b6424..80a0395d87d2881cccb0b20b428aa88fbca44a96 100644 --- a/compiler/sample/app.ets +++ b/compiler/sample/app.ets @@ -1,8 +1,23 @@ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} +/* + * 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') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} 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..c4352e7190d2e6d4d5118477317f5a3e62c79b21 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..d9a41597ddc2f10af22ed64c26d5a993f5b5828c 100644 --- a/compiler/sample/pages/testcases/expected/component-01-expected.js +++ b/compiler/sample/pages/testcases/expected/component-01-expected.js @@ -1,11 +1,26 @@ -class MyComponent extends View { - constructor() { - super(); - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - console.info('into constructor'); - } - render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } -} -loadDocument(new MyComponent()); +/* + * 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(); + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + console.info('into constructor'); + } + render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } +} +loadDocument(new MyComponent()); 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..9d579b48ad93e2a04339cf61dd56ed16b7e69b48 100644 --- a/compiler/sample/pages/testcases/expected/new-01-expected.js +++ b/compiler/sample/pages/testcases/expected/new-01-expected.js @@ -1,10 +1,25 @@ -class MyComponent extends View { - constructor(value1 = "hello world 1", value2 = "hello world 2", value3 = "hello world 3") { - super(); - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } -} -loadDocument(new MyComponent()); +/* + * 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(); + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } +} +loadDocument(new MyComponent()); diff --git a/compiler/sample/pages/testcases/expected/new-02-expected.js b/compiler/sample/pages/testcases/expected/new-02-expected.js index 68c475807c92a9d8c5f2c1e60b11b0b52d5cf394..9d579b48ad93e2a04339cf61dd56ed16b7e69b48 100644 --- a/compiler/sample/pages/testcases/expected/new-02-expected.js +++ b/compiler/sample/pages/testcases/expected/new-02-expected.js @@ -1,10 +1,25 @@ -class MyComponent extends View { - constructor(value1 = "hello world 1", value2 = "hello world 2", value3 = "hello world 3") { - super(); - this.value1 = value1; - this.value2 = value2; - this.value3 = value3; - } - render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } -} -loadDocument(new MyComponent()); +/* + * 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(); + this.value1 = value1; + this.value2 = value2; + this.value3 = value3; + } + render() { return new Column(new Text(this.value1), new Text(this.value2), new Text(this.value3)); } +} +loadDocument(new MyComponent()); 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..18472ca131447605c7af2f8db4afec3dd496563b 100644 --- a/compiler/sample/pages/testcases/expected/struct-01-expected.js +++ b/compiler/sample/pages/testcases/expected/struct-01-expected.js @@ -1,6 +1,21 @@ -class MyComponent extends View { - render() { - } - constructor() { super(); } -} -loadDocument(new MyComponent()); +/* + * 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() { + } + constructor() { super(); } +} +loadDocument(new MyComponent()); diff --git a/compiler/sample/pages/testcases/expected/struct-02-expected.js b/compiler/sample/pages/testcases/expected/struct-02-expected.js index a9ba8932dcf2f4afbc116d1519df79962a74720e..7dfcd1bcd229d6529cab2869553ae8e6aaf031ac 100644 --- a/compiler/sample/pages/testcases/expected/struct-02-expected.js +++ b/compiler/sample/pages/testcases/expected/struct-02-expected.js @@ -1,4 +1,19 @@ -class MyComponent { - build() { - } -} +/* + * 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..508d4619bc37237cc457d49b5c2d803fd14672f3 100644 --- a/compiler/sample/pages/testcases/onclicktest.ets +++ b/compiler/sample/pages/testcases/onclicktest.ets @@ -1,3 +1,4 @@ +/* * 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..fe3f6abdfb958e854c2cc58e4414b7446d7d73f0 100644 --- a/compiler/sample/pages/testcases/showcaseCovid19.ets +++ b/compiler/sample/pages/testcases/showcaseCovid19.ets @@ -1,3 +1,4 @@ +/* * 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. */ /** 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..20235078e0fcc5cec27ee04e0c9f03f5caabfe48 100644 --- a/compiler/sample/pages/testcases/stacktestsuite.ets +++ b/compiler/sample/pages/testcases/stacktestsuite.ets @@ -1,3 +1,4 @@ +/* * 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..09ab14f0e11eeccb92d2825421ef614a02c07325 100644 --- a/compiler/sample/pages/testcases/stateArrayReverse.ets +++ b/compiler/sample/pages/testcases/stateArrayReverse.ets @@ -1,3 +1,4 @@ +/* * 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..df92093238190fb16cdafa85b63f9225db6f9e3b 100644 --- a/compiler/sample/pages/testcases/struct-01.ets +++ b/compiler/sample/pages/testcases/struct-01.ets @@ -1,6 +1,21 @@ -@Component -@Entry -struct MyComponent7 { - build() { - } +/* + * 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 { + build() { + } } \ No newline at end of file diff --git a/compiler/sample/pages/testcases/struct-02.ets b/compiler/sample/pages/testcases/struct-02.ets index ee57c9cde71ef7fb63e4f028d23506e74790ffa4..b1a1fa3fa3688d62779dc54c4be1da33144a909f 100644 --- a/compiler/sample/pages/testcases/struct-02.ets +++ b/compiler/sample/pages/testcases/struct-02.ets @@ -1,4 +1,19 @@ -struct MyComponent8 { - build() { - } +/* + * 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() { + } } \ No newline at end of file diff --git a/compiler/sample/pages/todo.ets b/compiler/sample/pages/todo.ets index f1b21f224a59140f5aca7560d5f538bfe8e4d71b..6e90358af8151272180cd9b16a0b5f4d77da80dd 100644 --- a/compiler/sample/pages/todo.ets +++ b/compiler/sample/pages/todo.ets @@ -1,3 +1,4 @@ +/* * 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 diff --git a/compiler/src/create.ts b/compiler/src/create.ts index f24f1443eaa757e77a69a90fce5ba052606c9736..127dd03db85ebb1a28a1bb75def7b4f89e164131 100644 --- a/compiler/src/create.ts +++ b/compiler/src/create.ts @@ -54,7 +54,7 @@ function createProject(dist: string) { }`; const manifest:string = `{ - "appID": "com.huawei.` + appID + `", + "id": "com.huawei.` + appID + `", "appName": "` + appName + `", "versionName": "1.0.0", "versionCode": 1, 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..969e0fe71a67ae9494abfb5e81f7bbec3a81ea20 100644 --- a/compiler/test/pages/ExportStarComponent.ets +++ b/compiler/test/pages/ExportStarComponent.ets @@ -1 +1,16 @@ -export * as AllStarComponent from './test/pages/ExportComponent'; +/* + * 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