blob: a5eecce34e80d6465e5d081a065033afabdb9290 [file] [log] [blame]
#
# Test merge of uses-library:
# - Merge is OK if destination already has one with the same @name.
# - required defaults to "true"
# - when merging, a required=true (explicit or implicit) overwrites a required=false.
#
@main
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app1"
android:versionCode="100"
android:versionName="1.0.0">
<application
android:label="@string/app_name"
android:icon="@drawable/app_icon"
android:backupAgent="com.example.app.BackupAgentClass"
android:restoreAnyVersion="true"
android:allowBackup="true"
android:killAfterRestore="true"
android:name="com.example.TheApp" >
<!-- A library that is implicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary0_DefaultTrue" />
<!-- A library that is implicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary1_DefaultTrue" />
<!-- A library that is explicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary2_RequiredTrue"
android:required="true" />
<!-- A library that is explicitly marked as required=false -->
<uses-library
android:name="com.example.SomeLibrary3_RequiredFalse"
android:required="false" />
<!-- A library that is explicitly marked as required=false -->
<uses-library
android:name="com.example.SomeLibrary4_RequiredFalse"
android:required="false" />
</application>
</manifest>
@lib1
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<application android:label="@string/lib_name1" >
<!-- Same as 1 from main, marking it as required=false -->
<uses-library
android:name="com.example.SomeLibrary1_DefaultTrue"
android:required="false" />
<!-- Same as 3 from main -->
<uses-library
android:name="com.example.SomeLibrary3_RequiredFalse"
android:required="false" />
<!-- Same as 4 from main -->
<uses-library
android:name="com.example.SomeLibrary4_RequiredFalse"
android:required="false" />
<!-- Add a new lib that is implicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary5_RequiredTrue"
android:required="true" />
<!-- Add a new lib that is implicitly marked as required=false -->
<uses-library
android:name="com.example.SomeLibrary6_RequiredFalse"
android:required="false" />
</application>
</manifest>
@lib2
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib2">
<application android:label="@string/lib_name1" >
<!-- Overrides 3, changing it from required=false to true -->
<uses-library
android:name="com.example.SomeLibrary3_RequiredFalse"
android:required="true" />
<!-- Same as 4 from main -->
<uses-library
android:name="com.example.SomeLibrary4_RequiredFalse"
android:required="false" />
<!-- Overrides 6, but implicitly declaring required=True -->
<uses-library
android:name="com.example.SomeLibrary6_RequiredFalse" />
</application>
</manifest>
@result
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app1"
android:versionCode="100"
android:versionName="1.0.0">
<application
android:label="@string/app_name"
android:icon="@drawable/app_icon"
android:backupAgent="com.example.app.BackupAgentClass"
android:restoreAnyVersion="true"
android:allowBackup="true"
android:killAfterRestore="true"
android:name="com.example.TheApp" >
<!-- A library that is implicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary0_DefaultTrue" />
<!-- A library that is implicitly marked as required=true -->
# required=false from lib1 is ignored, it stays at the default
<uses-library
android:name="com.example.SomeLibrary1_DefaultTrue" />
<!-- A library that is explicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary2_RequiredTrue"
android:required="true" />
<!-- A library that is explicitly marked as required=false -->
# lib1 keeps it required=false but lib2 makes it switch to required=true
<uses-library
android:name="com.example.SomeLibrary3_RequiredFalse"
android:required="true" />
<!-- A library that is explicitly marked as required=false -->
<uses-library
android:name="com.example.SomeLibrary4_RequiredFalse"
android:required="false" />
# new from lib1
<!-- Add a new lib that is implicitly marked as required=true -->
<uses-library
android:name="com.example.SomeLibrary5_RequiredTrue"
android:required="true" />
# new from lib1, but lib2 makes it switch to required=true
<!-- Add a new lib that is implicitly marked as required=false -->
<uses-library
android:name="com.example.SomeLibrary6_RequiredFalse"
android:required="true" />
</application>
</manifest>
@errors