blob: 7b9502730c1faa6a69765969da140a1f6e5ff144 [file] [log] [blame]
#
# Test how FQCN class names are expanded and handled:
# - A library application can be merged doesn't have an app class name.
# - A library application can be merged if it has the same class name as the app.
# - A partial class name is expanded using the package name in a library or app.
#
# All tests fail with just warnings, no solid errors.
#
@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:name="TheApp"
android:backupAgent=".MyBackupAgent" >
<activity android:name=".MainActivity" />
<receiver android:name="AppReceiver" />
<activity android:name="com.example.lib2.LibActivity" />
</application>
</manifest>
@lib1_widget
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<!-- App name is different, will not merge. -->
<application android:name="TheApp" >
<activity android:name=".WidgetLibrary1" />
</application>
</manifest>
@lib2_widget
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib2">
<!-- App name is good, but backupAgent is mentioned and is different, will not merge. -->
<application
android:name="com.example.app1.TheApp"
android:backupAgent=".MyBackupAgent" >
<activity android:name=".WidgetLibrary2" />
<activity android:name=".LibActivity" />
</application>
</manifest>
@lib3_widget
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib3">
<application android:name="com.example.app1.TheApp">
<activity android:name=".WidgetLibrary3" />
</application>
</manifest>
@lib4_not_package
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- It's an error for the manifest to lack a 'package' attribute. -->
<application>
<!-- These class name can't be expanded due to the lack of 'package' attribute. -->
<activity android:name=".LibActivity4" />
<service android:name=".LibService4" />
<receiver android:name=".LibReceiver4" />
<provider android:name=".LibProvider4" />
</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:name="com.example.app1.TheApp"
android:backupAgent="com.example.app1.MyBackupAgent" >
<activity android:name="com.example.app1.MainActivity" />
<receiver android:name="com.example.app1.AppReceiver" />
<activity android:name="com.example.lib2.LibActivity" />
<activity android:name="com.example.lib1.WidgetLibrary1" />
<activity android:name="com.example.lib2.WidgetLibrary2" />
<activity android:name="com.example.lib3.WidgetLibrary3" />
# from @lib4_alias
<!-- These class name can't be expanded due to the lack of 'package' attribute. -->
<activity android:name=".LibActivity4" />
<service android:name=".LibService4" />
<receiver android:name=".LibReceiver4" />
<provider android:name=".LibProvider4" />
</application>
</manifest>
@errors
W [ManifestMergerTest0_main.xml:3, ManifestMergerTest1_lib1_widget.xml:4] Main manifest has <application android:name='com.example.app1.TheApp'> but library uses name='com.example.lib1.TheApp'.
W [ManifestMergerTest0_main.xml:3, ManifestMergerTest2_lib2_widget.xml:4] Main manifest has <application android:backupAgent='com.example.app1.MyBackupAgent'> but library uses backupAgent='com.example.lib2.MyBackupAgent'.
P [ManifestMergerTest0_main.xml:6, ManifestMergerTest2_lib2_widget.xml:6] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity] element.
W [ManifestMergerTest4_lib4_not_package.xml:1] Missing 'package' attribute in manifest.