diff options
Diffstat (limited to 'tools/aapt2/integration-tests/MergeOnlyTest/LocalLib')
5 files changed, 135 insertions, 0 deletions
diff --git a/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk new file mode 100644 index 000000000000..ba781c56a913 --- /dev/null +++ b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk @@ -0,0 +1,28 @@ +// +// Copyright (C) 2019 The Android Open Source Project +// +// 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. +// + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_USE_AAPT2 := true +LOCAL_AAPT_NAMESPACES := true +LOCAL_MODULE := AaptTestMergeOnly_LocalLib +LOCAL_SDK_VERSION := current +LOCAL_MODULE_TAGS := tests +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res +LOCAL_MIN_SDK_VERSION := 21 +LOCAL_AAPT_FLAGS := --merge-only +include $(BUILD_STATIC_JAVA_LIBRARY)
\ No newline at end of file diff --git a/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/AndroidManifest.xml b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/AndroidManifest.xml new file mode 100644 index 000000000000..aa0ff5dcb4b6 --- /dev/null +++ b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/AndroidManifest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 The Android Open Source Project + + 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. +--> + +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.local.lib"> + + <application> + + <activity + android:name="com.myapp.MyActivity" + android:theme="@com.leaf.lib:style/LeafParentStyle.DottedChild"/> + + </application> + +</manifest> diff --git a/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/activity.xml b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/activity.xml new file mode 100644 index 000000000000..80d2fd6bcd09 --- /dev/null +++ b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/activity.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 The Android Open Source Project + + 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. +--> + +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:leaf="http://schemas.android.com/apk/res/com.leaf.lib"> + + <TextView android:text="@*com.leaf.lib:string/leaf_string" + leaf:leaf_attr="hello" + style="@com.leaf.lib:style/LeafChildStyle"/> + +</RelativeLayout>
\ No newline at end of file diff --git a/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/includer.xml b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/includer.xml new file mode 100644 index 000000000000..f06371874a45 --- /dev/null +++ b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/layout/includer.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 The Android Open Source Project + + 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. +--> + +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:leaf="http://schemas.android.com/apk/res/com.leaf.lib"> + + <include layout="@layout/activity"/> + + <include layout="@*com.leaf.lib:layout/activity"/> + +</RelativeLayout>
\ No newline at end of file diff --git a/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/values/values.xml b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/values/values.xml new file mode 100644 index 000000000000..2f9704df0570 --- /dev/null +++ b/tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/res/values/values.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2019 The Android Open Source Project + + 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. +--> + +<resources> + <string name="lib_string">@*com.leaf.lib:string/leaf_string</string> + + <style name="lib_style" parent="@com.leaf.lib:style/LeafChildStyle"> + <item name="com.leaf.lib:leaf_attr">hello</item> + </style> + + <style name="LeafParentStyle.DottedChild.LocalLibStyle" + parent="@com.leaf.lib:style/LeafParentStyle.DottedChild"/> + + <public type="style" name="LeafParentStyle.DottedChild.LocalLibStyle"/> + +</resources>
\ No newline at end of file |