From e38755ec8fb77adfb5e7e96d8631dd04a1626422 Mon Sep 17 00:00:00 2001 From: shifujun Date: Tue, 16 Nov 2021 17:32:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(core.gradle-plugin):=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BAFlavor=EF=BC=8C=E5=B9=B6=E5=8F=AA=E5=9C=A8plu?= =?UTF-8?q?gin=E4=B8=8A=E5=BA=94=E7=94=A8Transform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在正常可安装运行的app工程上apply plugin: 'com.tencent.shadow.plugin'后, 不影响原工程正常安装运行。插件自动创建一个Flavor Dimension:Shadow,并创建两个Flavor: normal和plugin。同时只在plugin上应用ShadowTransform。 这样不再需要将插件工程先重构为Android Library,再新建两个壳工程分别对应正常安装的app和插件了。 同时,删除了multidex相关自动化测试。因其稳定且后续大概率无相关修改。 --- .../sample/source/sample-host/build.gradle | 2 +- .../sample-plugin/sample-app-lib/build.gradle | 38 ------ .../{sample-app-lib => sample-app}/.gitignore | 0 .../build.gradle | 110 ++++++++++----- .../proguard-rules.pro | 0 .../src/main/AndroidManifest.xml | 4 +- .../src/main/assets/web/test.html | 0 .../plugin/app/lib/gallery/BaseActivity.java | 0 .../plugin/app/lib/gallery/MainActivity.java | 0 .../app/lib/gallery/TestApplication.java | 0 .../app/lib/gallery/cases/UseCaseManager.java | 0 .../gallery/cases/UseCaseSummaryFragment.java | 0 .../app/lib/gallery/cases/entity/UseCase.java | 0 .../gallery/cases/entity/UseCaseCategory.java | 0 .../lib/gallery/splash/ISplashAnimation.java | 0 .../lib/gallery/splash/SplashActivity.java | 0 .../lib/gallery/splash/SplashAnimation.java | 0 .../app/lib/gallery/util/PluginChecker.java | 0 .../app/lib/gallery/util/ToastUtil.java | 0 .../plugin/app/lib/gallery/util/UiUtil.java | 4 +- .../activity/TestActivityOnCreate.java | 0 .../activity/TestActivityOptionMenu.java | 0 .../activity/TestActivityOrientation.java | 0 .../activity/TestActivityReCreate.java | 0 .../TestActivityReCreateBySystem.java | 0 .../activity/TestActivitySetTheme.java | 0 .../activity/TestActivityWindowSoftMode.java | 0 .../TestAppCompatActivityOnCreate.java | 1 + .../application/TestApplicationActivity.java | 0 .../ActivityContextSubDirTestActivity.java | 0 .../ApplicationContextSubDirTestActivity.java | 0 ...SubDirContextThemeWrapperTestActivity.java | 6 +- .../app/lib/usecases/dialog/TestDialog.java | 0 .../usecases/dialog/TestDialogActivity.java | 0 .../usecases/fragment/TestDialogFragment.java | 0 .../fragment/TestDialogFragmentActivity.java | 0 .../fragment/TestDynamicFragmentActivity.java | 0 .../lib/usecases/fragment/TestFragment.java | 0 .../fragment/TestXmlFragmentActivity.java | 0 .../PluginUseHostClassActivity.java | 0 .../TestPackageManagerActivity.java | 0 .../TestDBContentProviderActivity.java | 0 .../lib/usecases/provider/TestDBHelper.java | 0 .../provider/TestFileProviderActivity.java | 3 +- .../lib/usecases/provider/TestProvider.java | 0 .../usecases/provider/TestProviderInfo.java | 5 +- .../app/lib/usecases/receiver/MyReceiver.java | 0 .../receiver/TestDynamicReceiverActivity.java | 0 .../receiver/TestReceiverActivity.java | 0 .../lib/usecases/webview/WebViewActivity.java | 0 .../main/res/anim/dialog_exit_fade_out.xml | 0 .../src/main/res/drawable/child_bg.xml | 0 .../src/main/res/drawable/collapse.png | Bin .../src/main/res/drawable/expanded.png | Bin .../src/main/res/drawable/selector_group.xml | 0 .../src/main/res/drawable/selector_item.xml | 0 .../layout/activity_test_file_provider.xml | 0 .../activity_test_re_create_by_system.xml | 0 .../res/layout/layout_activity_lifecycle.xml | 0 .../res/layout/layout_activity_settheme.xml | 0 .../res/layout/layout_case_category_item.xml | 0 .../src/main/res/layout/layout_case_item.xml | 0 .../src/main/res/layout/layout_common.xml | 0 .../src/main/res/layout/layout_dialog.xml | 0 .../res/layout/layout_dialog_activity.xml | 0 .../res/layout/layout_fragment_activity.xml | 0 .../layout/layout_fragment_case_summary.xml | 0 .../main/res/layout/layout_fragment_test.xml | 0 .../layout/layout_fragment_xml_activity.xml | 0 .../src/main/res/layout/layout_main.xml | 0 .../src/main/res/layout/layout_main_above.xml | 0 .../main/res/layout/layout_main_behind.xml | 0 .../main/res/layout/layout_orientation.xml | 0 .../main/res/layout/layout_packagemanager.xml | 0 .../main/res/layout/layout_provider_db.xml | 0 .../src/main/res/layout/layout_receiver.xml | 0 .../src/main/res/layout/layout_recreate.xml | 0 .../src/main/res/layout/layout_result.xml | 0 .../src/main/res/layout/layout_service.xml | 0 .../src/main/res/layout/layout_softmode.xml | 0 .../src/main/res/layout/layout_splash.xml | 0 .../layout/layout_test_view_cons_cache.xml | 0 .../menu/case_test_activity_option_menu.xml | 0 .../src/main/res/values-v21/themes.xml | 0 .../src/main/res/values/dimens.xml | 0 .../src/main/res/values/strings.xml | 0 .../src/main/res/values/styles.xml | 0 .../src/main/res/values/themes.xml | 0 .../src/main/res/xml/filepaths.xml | 0 .../sample-normal-app/.gitignore | 1 - .../sample-normal-app/build.gradle | 32 ----- .../sample-normal-app/proguard-rules.pro | 13 -- .../src/main/AndroidManifest.xml | 1 - .../sample-plugin-app/.gitignore | 1 - .../sample-plugin-app/proguard-rules.pro | 13 -- .../src/main/AndroidManifest.xml | 1 - .../shadow/core/gradle/ShadowPlugin.kt | 92 +++++++++---- .../core/gradle/PackageMultiPluginTest.kt | 6 +- .../core/gradle/PackageOnlyPluginTest.kt | 4 +- .../core/gradle/PackagePluginTaskTest.kt | 4 +- .../testProjects/case1/plugin1/build.gradle | 12 +- .../testProjects/case1/plugin2/build.gradle | 6 +- .../shadow/core/transform/ShadowTransform.kt | 9 ++ .../host/test-dynamic-host/build.gradle | 15 --- .../CommonApplicationInfoTest.java | 2 +- .../cases/plugin_multidex/MultiDexTest.java | 9 -- .../plugin_multidex/MultiDexV102Test.java | 15 --- .../plugin_multidex/MultiDexV201Test.java | 15 --- .../PluginMultiDexAppTest.java | 48 ------- .../test/dynamic/host/MainActivity.java | 10 +- .../shadow/test/lib/constant/Constant.java | 2 - .../host/test-none-dynamic-host/build.gradle | 7 +- .../androidx-cases-app/.gitignore | 1 - .../androidx-cases-app/build.gradle | 33 ----- .../androidx-cases-app/proguard-rules.pro | 13 -- .../src/main/AndroidManifest.xml | 12 -- .../androidx-cases-lib/.gitignore | 1 - .../androidx-cases-lib/build.gradle | 34 ----- .../androidx-cases-lib/proguard-rules.pro | 17 --- .../src/main/AndroidManifest.xml | 16 --- .../test-plugin-androidx-cases/build.gradle | 43 +++++- .../src/main/AndroidManifest.xml | 23 +++- .../lib/AppCompatTestActivity.java | 0 .../lib/AppComponentFactoryTestActivity.java | 0 .../lib/LiveDataWithActivityTestActivity.java | 0 .../lib/TestComponentFactory.java | 1 - .../plugin/androidx_cases/lib/UiUtil.java | 4 +- .../general-cases-app/.gitignore | 1 - .../general-cases-app/build.gradle | 41 ------ .../general-cases-app/proguard-rules.pro | 13 -- .../src/main/AndroidManifest.xml | 1 - .../general-cases-lib/.gitignore | 1 - .../general-cases-lib/build.gradle | 36 ----- .../general-cases-lib/proguard-rules.pro | 17 --- .../src/main/AndroidManifest.xml | 107 --------------- .../test-plugin-general-cases/build.gradle | 125 ++++++++---------- .../app/ActivityLifecycleCallbacksTest.java | 0 .../app/CustomAndroidJUnitRunner.java | 0 .../general_cases/app/NormalAppTest.java | 0 .../general_cases/app/PackageManagerTest.java | 0 .../src/main/AndroidManifest.xml | 114 +++++++++++++++- .../lib/gallery/TestApplication.java | 0 .../lib/gallery/util/ToastUtil.java | 0 .../lib/gallery/util/UiUtil.java | 4 +- .../lib/usecases/SimpleIdlingResource.java | 0 .../usecases/WithIdlingResourceActivity.java | 0 .../activity/ApplicationContextActivity.java | 0 .../activity/PrintActivityResultActivity.java | 2 +- .../activity/TestActivityOnCreate.java | 2 +- .../activity/TestActivityOrientation.java | 2 +- .../activity/TestActivityReCreate.java | 2 +- .../TestActivityReCreateBySystem.java | 2 +- .../activity/TestActivityWindowSoftMode.java | 0 .../activity/TestCallingActivity.java | 0 .../usecases/activity/TestListActivity.java | 2 +- .../activity/WindowSoftModeJumpActivity.java | 2 +- ...ctivityLifecycleCallbacksTestActivity.java | 0 .../application/TestApplicationActivity.java | 0 .../TestGetApplicationInfoActivity.java | 4 +- .../TestBootClassloaderActivity.java | 0 .../ActivityContextSubDirTestActivity.java | 0 .../ApplicationContextSubDirTestActivity.java | 0 .../context/RegisterNullReceiverActivity.java | 0 .../ServiceContextSubDirTestActivity.java | 0 ...SubDirContextThemeWrapperTestActivity.java | 6 +- .../context/TestLayoutInflaterActivity.java | 0 .../usecases/context/TestThemeActivity.java | 0 .../dialog/TestAlertDialogActivity.java | 0 .../lib/usecases/dialog/TestDialog.java | 0 .../usecases/dialog/TestDialogActivity.java | 0 .../lib/usecases/fragment/BaseFragment.java | 0 .../fragment/FragmentStartedActivity.java | 0 ...nlyOverrideActivityMethodBaseFragment.java | 0 ...OnlyOverrideContextMethodBaseFragment.java | 0 .../ProgrammaticallyAddFragmentActivity.java | 2 +- .../fragment/SubTestBaseFragment.java | 0 .../fragment/TargetFragmentTestActivity.java | 0 .../usecases/fragment/TestBaseFragment.java | 0 .../usecases/fragment/TestDialogFragment.java | 0 .../lib/usecases/fragment/TestFragment.java | 0 .../fragment/TestFragmentCommonLogic.java | 2 +- .../usecases/fragment/TestNormalFragment.java | 0 .../usecases/fragment/TestSubFragment.java | 0 ...bOnlyOverrideOnAttachActivityFragment.java | 0 ...ubOnlyOverrideOnAttachContextFragment.java | 0 .../fragment/XmlAddFragmentActivity.java | 2 +- .../instrumentation/MyInstrumentation.java | 0 .../TestInstrumentationActivity.java | 0 .../interfaces/TestHostInterfaceActivity.java | 0 .../TestPackageManagerActivity.java | 0 .../TestDBContentProviderActivity.java | 2 +- .../lib/usecases/provider/TestDBHelper.java | 0 .../provider/TestFileProviderActivity.java | 5 +- .../lib/usecases/provider/TestProvider.java | 0 .../usecases/provider/TestProviderInfo.java | 7 +- .../usecases/receiver/BroadCastHelper.java | 0 .../lib/usecases/receiver/MyReceiver.java | 0 .../receiver/TestReceiverActivity.java | 4 +- .../lib/usecases/service/TestService.java | 0 .../service/TestStartServiceActivity.java | 2 +- .../view/TestViewConstructorCache.java | 2 +- .../java/org/xmlpull/v1/XmlPullParser.java | 0 .../src/main/res/layout/activity_list.xml | 0 .../layout/activity_test_file_provider.xml | 0 .../activity_test_re_create_by_system.xml | 0 .../res/layout/layout_activity_lifecycle.xml | 0 .../src/main/res/layout/layout_common.xml | 0 .../res/layout/layout_fragment_activity.xml | 0 .../main/res/layout/layout_fragment_test.xml | 0 .../src/main/res/layout/layout_list_item.xml | 0 .../main/res/layout/layout_orientation.xml | 0 .../main/res/layout/layout_packagemanager.xml | 0 .../main/res/layout/layout_provider_db.xml | 0 .../src/main/res/layout/layout_receiver.xml | 0 .../src/main/res/layout/layout_recreate.xml | 0 .../src/main/res/layout/layout_result.xml | 0 .../src/main/res/layout/layout_service.xml | 0 .../src/main/res/layout/layout_softmode.xml | 0 .../layout/layout_test_view_cons_cache.xml | 0 .../layout_xml_add_base_fragment_activity.xml | 0 ...ayout_xml_add_normal_fragment_activity.xml | 0 .../layout_xml_add_sub_fragment_activity.xml | 0 .../src/main/res/values/strings.xml | 0 .../src/main/res/values/themes.xml | 0 .../src/main/res/xml/filepaths.xml | 0 .../multidex/apk-module-common.gradle | 39 ------ .../multidex/multidex-config.pro | 2 - .../multidex/proguard-rules.pro | 2 - .../multidex/test-multidex-lib/.gitignore | 1 - .../multidex/test-multidex-lib/build.gradle | 30 ----- .../src/main/AndroidManifest.xml | 2 - .../lib/PluginMultidexMainActivity.kt | 34 ----- .../src/main/res/values/strings.xml | 22 --- .../test-plugin-multidex-v1_0_2/.gitignore | 1 - .../test-plugin-multidex-v1_0_2/build.gradle | 27 ---- .../src/main/AndroidManifest.xml | 17 --- .../v1_0_2/PluginMultidexV1_0_2Activity.java | 24 ---- .../test-plugin-multidex-v2_0_1/.gitignore | 1 - .../test-plugin-multidex-v2_0_1/build.gradle | 27 ---- .../src/main/AndroidManifest.xml | 16 --- .../v2_0_1/PluginMultidexV2_0_1Activity.java | 24 ---- .../plugin-service-for-host/build.gradle | 11 +- settings.gradle | 14 +- 243 files changed, 454 insertions(+), 1041 deletions(-) delete mode 100644 projects/sample/source/sample-plugin/sample-app-lib/build.gradle rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/.gitignore (100%) rename projects/sample/source/sample-plugin/{sample-plugin-app => sample-app}/build.gradle (57%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/proguard-rules.pro (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/AndroidManifest.xml (96%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/assets/web/test.html (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/BaseActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/MainActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/TestApplication.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/cases/UseCaseManager.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/cases/UseCaseSummaryFragment.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/cases/entity/UseCase.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/cases/entity/UseCaseCategory.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/splash/ISplashAnimation.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/splash/SplashActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/splash/SplashAnimation.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/util/PluginChecker.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/util/ToastUtil.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/gallery/util/UiUtil.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityOnCreate.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityOptionMenu.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityOrientation.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityReCreate.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityReCreateBySystem.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivitySetTheme.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestActivityWindowSoftMode.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/activity/TestAppCompatActivityOnCreate.java (99%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/application/TestApplicationActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/context/ActivityContextSubDirTestActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/context/ApplicationContextSubDirTestActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/dialog/TestDialog.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/dialog/TestDialogActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/fragment/TestDialogFragment.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/fragment/TestDialogFragmentActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/fragment/TestDynamicFragmentActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/fragment/TestFragment.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/fragment/TestXmlFragmentActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/host_communication/PluginUseHostClassActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/packagemanager/TestPackageManagerActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestDBContentProviderActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestDBHelper.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestFileProviderActivity.java (97%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProvider.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java (90%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/MyReceiver.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestReceiverActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/webview/WebViewActivity.java (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/anim/dialog_exit_fade_out.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/drawable/child_bg.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/drawable/collapse.png (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/drawable/expanded.png (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/drawable/selector_group.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/drawable/selector_item.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/activity_test_file_provider.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/activity_test_re_create_by_system.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_activity_lifecycle.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_activity_settheme.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_case_category_item.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_case_item.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_common.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_dialog.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_dialog_activity.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_fragment_activity.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_fragment_case_summary.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_fragment_test.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_fragment_xml_activity.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_main.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_main_above.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_main_behind.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_orientation.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_packagemanager.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_provider_db.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_receiver.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_recreate.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_result.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_service.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_softmode.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_splash.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/layout/layout_test_view_cons_cache.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/menu/case_test_activity_option_menu.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/values-v21/themes.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/values/dimens.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/values/strings.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/values/styles.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/values/themes.xml (100%) rename projects/sample/source/sample-plugin/{sample-app-lib => sample-app}/src/main/res/xml/filepaths.xml (100%) delete mode 100644 projects/sample/source/sample-plugin/sample-normal-app/.gitignore delete mode 100644 projects/sample/source/sample-plugin/sample-normal-app/build.gradle delete mode 100644 projects/sample/source/sample-plugin/sample-normal-app/proguard-rules.pro delete mode 100644 projects/sample/source/sample-plugin/sample-normal-app/src/main/AndroidManifest.xml delete mode 100644 projects/sample/source/sample-plugin/sample-plugin-app/.gitignore delete mode 100644 projects/sample/source/sample-plugin/sample-plugin-app/proguard-rules.pro delete mode 100644 projects/sample/source/sample-plugin/sample-plugin-app/src/main/AndroidManifest.xml delete mode 100644 projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexTest.java delete mode 100644 projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV102Test.java delete mode 100644 projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV201Test.java delete mode 100644 projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/PluginMultiDexAppTest.java delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-app/.gitignore delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-app/build.gradle delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-app/proguard-rules.pro delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-app/src/main/AndroidManifest.xml delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-lib/.gitignore delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-lib/build.gradle delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-lib/proguard-rules.pro delete mode 100644 projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/AndroidManifest.xml rename projects/test/plugin/androidx-cases/{androidx-cases-lib => test-plugin-androidx-cases}/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppCompatTestActivity.java (100%) rename projects/test/plugin/androidx-cases/{androidx-cases-lib => test-plugin-androidx-cases}/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java (100%) rename projects/test/plugin/androidx-cases/{androidx-cases-lib => test-plugin-androidx-cases}/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/LiveDataWithActivityTestActivity.java (100%) rename projects/test/plugin/androidx-cases/{androidx-cases-lib => test-plugin-androidx-cases}/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java (96%) rename projects/test/plugin/androidx-cases/{androidx-cases-lib => test-plugin-androidx-cases}/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java (100%) delete mode 100644 projects/test/plugin/general-cases/general-cases-app/.gitignore delete mode 100644 projects/test/plugin/general-cases/general-cases-app/build.gradle delete mode 100644 projects/test/plugin/general-cases/general-cases-app/proguard-rules.pro delete mode 100644 projects/test/plugin/general-cases/general-cases-app/src/main/AndroidManifest.xml delete mode 100644 projects/test/plugin/general-cases/general-cases-lib/.gitignore delete mode 100644 projects/test/plugin/general-cases/general-cases-lib/build.gradle delete mode 100644 projects/test/plugin/general-cases/general-cases-lib/proguard-rules.pro delete mode 100644 projects/test/plugin/general-cases/general-cases-lib/src/main/AndroidManifest.xml rename projects/test/plugin/general-cases/{general-cases-app => test-plugin-general-cases}/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/ActivityLifecycleCallbacksTest.java (100%) rename projects/test/plugin/general-cases/{general-cases-app => test-plugin-general-cases}/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/CustomAndroidJUnitRunner.java (100%) rename projects/test/plugin/general-cases/{general-cases-app => test-plugin-general-cases}/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java (100%) rename projects/test/plugin/general-cases/{general-cases-app => test-plugin-general-cases}/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/PackageManagerTest.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/TestApplication.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/ToastUtil.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/SimpleIdlingResource.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/WithIdlingResourceActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/ApplicationContextActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java (96%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java (95%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityWindowSoftMode.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestCallingActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/ActivityLifecycleCallbacksTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestApplicationActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/classloader/TestBootClassloaderActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ActivityContextSubDirTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ApplicationContextSubDirTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/RegisterNullReceiverActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ServiceContextSubDirTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestLayoutInflaterActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestThemeActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestAlertDialogActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialog.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialogActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/BaseFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/FragmentStartedActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideActivityMethodBaseFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideContextMethodBaseFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/SubTestBaseFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TargetFragmentTestActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestBaseFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestDialogFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java (99%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestNormalFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachActivityFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachContextFragment.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/MyInstrumentation.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/TestInstrumentationActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/interfaces/TestHostInterfaceActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/packagemanager/TestPackageManagerActivity.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java (99%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBHelper.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java (95%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProvider.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java (89%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/BroadCastHelper.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/MyReceiver.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestService.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java (98%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java (97%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/java/org/xmlpull/v1/XmlPullParser.java (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/activity_list.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/activity_test_file_provider.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/activity_test_re_create_by_system.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_activity_lifecycle.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_common.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_fragment_activity.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_fragment_test.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_list_item.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_orientation.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_packagemanager.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_provider_db.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_receiver.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_recreate.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_result.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_service.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_softmode.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_test_view_cons_cache.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_xml_add_base_fragment_activity.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_xml_add_normal_fragment_activity.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/layout/layout_xml_add_sub_fragment_activity.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/values/strings.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/values/themes.xml (100%) rename projects/test/plugin/general-cases/{general-cases-lib => test-plugin-general-cases}/src/main/res/xml/filepaths.xml (100%) delete mode 100644 projects/test/plugin/particular-cases/multidex/apk-module-common.gradle delete mode 100644 projects/test/plugin/particular-cases/multidex/multidex-config.pro delete mode 100644 projects/test/plugin/particular-cases/multidex/proguard-rules.pro delete mode 100644 projects/test/plugin/particular-cases/multidex/test-multidex-lib/.gitignore delete mode 100644 projects/test/plugin/particular-cases/multidex/test-multidex-lib/build.gradle delete mode 100644 projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/AndroidManifest.xml delete mode 100644 projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/kotlin/com/tencent/shadow/test/plugin/particular_cases/multidex/lib/PluginMultidexMainActivity.kt delete mode 100644 projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/res/values/strings.xml delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/.gitignore delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build.gradle delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/AndroidManifest.xml delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v1_0_2/PluginMultidexV1_0_2Activity.java delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/.gitignore delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build.gradle delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/AndroidManifest.xml delete mode 100644 projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v2_0_1/PluginMultidexV2_0_1Activity.java diff --git a/projects/sample/source/sample-host/build.gradle b/projects/sample/source/sample-host/build.gradle index 574f416d8..a21d62bbc 100644 --- a/projects/sample/source/sample-host/build.gradle +++ b/projects/sample/source/sample-host/build.gradle @@ -84,7 +84,7 @@ def generateAssets(generateAssetsTask, buildType) { def pluginZip = file("${getRootProject().getBuildDir()}/plugin-${buildType}.zip") generateAssetsTask.dependsOn createCopyTask( - ':sample-plugin-app', + ':sample-app', buildType, 'plugin-zip', "plugin-${buildType}.zip", diff --git a/projects/sample/source/sample-plugin/sample-app-lib/build.gradle b/projects/sample/source/sample-plugin/sample-app-lib/build.gradle deleted file mode 100644 index 3fe59a1c4..000000000 --- a/projects/sample/source/sample-plugin/sample-app-lib/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation project(":slidingmenu") - implementation project(":pinnedheaderexpandablelistview") - implementation 'com.android.support:support-annotations:28.0.0' - implementation 'com.android.support:support-v4:27.1.1' - implementation 'com.android.support:appcompat-v7:27.1.1' - //注意sample-host-lib要用compileOnly编译而不打包在插件中。在packagePlugin任务中配置hostWhiteList允许插件访问宿主的类。 - compileOnly files("${project(":sample-host-lib").getBuildDir()}/outputs/jar/sample-host-lib-debug.jar") -} - -preBuild.dependsOn(":sample-host-lib:jarDebugPackage") \ No newline at end of file diff --git a/projects/sample/source/sample-plugin/sample-app-lib/.gitignore b/projects/sample/source/sample-plugin/sample-app/.gitignore similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/.gitignore rename to projects/sample/source/sample-plugin/sample-app/.gitignore diff --git a/projects/sample/source/sample-plugin/sample-plugin-app/build.gradle b/projects/sample/source/sample-plugin/sample-app/build.gradle similarity index 57% rename from projects/sample/source/sample-plugin/sample-plugin-app/build.gradle rename to projects/sample/source/sample-plugin/sample-app/build.gradle index 2b5ae0a50..2dd9483a7 100644 --- a/projects/sample/source/sample-plugin/sample-plugin-app/build.gradle +++ b/projects/sample/source/sample-plugin/sample-app/build.gradle @@ -1,17 +1,3 @@ -apply from: "../sample-normal-app/build.gradle" - -android { - defaultConfig { - applicationId project.SAMPLE_HOST_APP_APPLICATION_ID - } -} - -dependencies { - //Shadow Transform后业务代码会有一部分实际引用runtime中的类 - //如果不以compileOnly方式依赖,会导致其他Transform或者Proguard找不到这些类 - compileOnly 'com.tencent.shadow.core:runtime' -} - buildscript { repositories { if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) { @@ -30,34 +16,88 @@ buildscript { } } +apply plugin: 'com.android.application' +apply plugin: 'com.tencent.shadow.plugin' + +android { + compileSdkVersion project.COMPILE_SDK_VERSION + + defaultConfig { + applicationId 'com.tencent.shadow.sample.plugin.app' + minSdkVersion project.MIN_SDK_VERSION + targetSdkVersion project.TARGET_SDK_VERSION + versionCode project.VERSION_CODE + versionName project.VERSION_NAME + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + + signingConfig signingConfigs.create("release") + signingConfig.initWith(buildTypes.debug.signingConfig) + } + } + + // 将插件applicationId设置为和宿主相同 + productFlavors { + plugin { + applicationId project.SAMPLE_HOST_APP_APPLICATION_ID + } + } + + lintOptions { + abortOnError false + } +} + +dependencies { + implementation project(":slidingmenu") + implementation project(":pinnedheaderexpandablelistview") + implementation 'com.android.support:support-annotations:28.0.0' + implementation 'com.android.support:support-v4:27.1.1' + implementation 'com.android.support:appcompat-v7:27.1.1' + + //注意sample-host-lib要用compileOnly编译而不打包在插件中。在packagePlugin任务中配置hostWhiteList允许插件访问宿主的类。 + pluginCompileOnly project(":sample-host-lib") + normalImplementation project(":sample-host-lib") + + + //Shadow Transform后业务代码会有一部分实际引用runtime中的类 + //如果不以compileOnly方式依赖,会导致其他Transform或者Proguard找不到这些类 + pluginCompileOnly 'com.tencent.shadow.core:runtime' +} + +preBuild.dependsOn(":sample-host-lib:jarDebugPackage") + + def createDuplicateApkTask(buildType) { - def apkDir = file("${getBuildDir()}/outputs/apk/$buildType") + def apkDir = file("${getBuildDir()}/outputs/apk/plugin/$buildType") - return tasks.create("duplicate${buildType.capitalize()}ApkTask", Copy) { + return tasks.create("duplicatePlugin${buildType.capitalize()}ApkTask", Copy) { group = 'build' - description = "复制一个sample-plugin-app-${buildType}.apk用于测试目的" + description = "复制一个sample-app-plugin-${buildType}.apk用于测试目的" from(apkDir) { - include("sample-plugin-app-${buildType}.apk") - rename { "sample-plugin-app-${buildType}2.apk" } + include("sample-app-plugin-${buildType}.apk") + rename { "sample-app-plugin-${buildType}2.apk" } } into(apkDir) - }.dependsOn(":sample-plugin-app:assemble${buildType.capitalize()}") + }.dependsOn(":sample-app:assemblePlugin${buildType.capitalize()}") } tasks.whenTaskAdded { task -> - if (task.name == "assembleDebug") { + if (task.name == "assemblePluginDebug") { def createTask = createDuplicateApkTask('debug') task.finalizedBy(createTask) } - if (task.name == "assembleRelease") { + if (task.name == "assemblePluginRelease") { def createTask = createDuplicateApkTask('release') task.finalizedBy(createTask) } } -apply plugin: 'com.tencent.shadow.plugin' - shadow { transform { @@ -73,17 +113,17 @@ shadow { pluginApk1 { businessName = 'sample-plugin-app' partKey = 'sample-plugin-app' - buildTask = ':sample-plugin-app:assembleDebug' - apkName = 'sample-plugin-app-debug.apk' - apkPath = 'projects/sample/source/sample-plugin/sample-plugin-app/build/outputs/apk/debug/sample-plugin-app-debug.apk' + buildTask = ':sample-app:assemblePluginDebug' + apkName = 'sample-app-plugin-debug.apk' + apkPath = 'projects/sample/source/sample-plugin/sample-app/build/outputs/apk/plugin/debug/sample-app-plugin-debug.apk' hostWhiteList = ["com.tencent.shadow.sample.host.lib"] } pluginApk2 { businessName = 'sample-plugin-app2' partKey = 'sample-plugin-app2' - buildTask = ':sample-plugin-app:assembleDebug' - apkName = 'sample-plugin-app-debug2.apk' - apkPath = 'projects/sample/source/sample-plugin/sample-plugin-app/build/outputs/apk/debug/sample-plugin-app-debug2.apk' + buildTask = ':sample-app:assemblePluginDebug' + apkName = 'sample-app-plugin-debug2.apk' + apkPath = 'projects/sample/source/sample-plugin/sample-app/build/outputs/apk/plugin/debug/sample-app-plugin-debug2.apk' hostWhiteList = ["com.tencent.shadow.sample.host.lib"] } } @@ -96,17 +136,17 @@ shadow { pluginApk1 { businessName = 'sample-plugin-app' partKey = 'sample-plugin-app' - buildTask = ':sample-plugin-app:assembleRelease' + buildTask = ':sample-app:assemblePluginRelease' apkName = 'sample-plugin-app-release.apk' - apkPath = 'projects/sample/source/sample-plugin/sample-plugin-app/build/outputs/apk/release/sample-plugin-app-release.apk' + apkPath = 'projects/sample/source/sample-plugin/sample-app/build/outputs/apk/plugin/release/sample-app-plugin-release.apk' hostWhiteList = ["com.tencent.shadow.sample.host.lib"] } pluginApk2 { businessName = 'sample-plugin-app2' partKey = 'sample-plugin-app2' - buildTask = ':sample-plugin-app:assembleRelease' + buildTask = ':sample-app:assemblePluginRelease' apkName = 'sample-plugin-app-release2.apk' - apkPath = 'projects/sample/source/sample-plugin/sample-plugin-app/build/outputs/apk/release/sample-plugin-app-release2.apk' + apkPath = 'projects/sample/source/sample-plugin/sample-app/build/outputs/apk/plugin/release/sample-app-plugin-release2.apk' hostWhiteList = ["com.tencent.shadow.sample.host.lib"] } } @@ -124,4 +164,4 @@ shadow { compactVersion = [1, 2, 3] uuidNickName = "1.1.5" } -} \ No newline at end of file +} diff --git a/projects/sample/source/sample-plugin/sample-app-lib/proguard-rules.pro b/projects/sample/source/sample-plugin/sample-app/proguard-rules.pro similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/proguard-rules.pro rename to projects/sample/source/sample-plugin/sample-app/proguard-rules.pro diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/AndroidManifest.xml b/projects/sample/source/sample-plugin/sample-app/src/main/AndroidManifest.xml similarity index 96% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/AndroidManifest.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/AndroidManifest.xml index 94910476e..592989f0a 100644 --- a/projects/sample/source/sample-plugin/sample-app-lib/src/main/AndroidManifest.xml +++ b/projects/sample/source/sample-plugin/sample-app/src/main/AndroidManifest.xml @@ -79,12 +79,12 @@ = Build.VERSION_CODES.N) { contentUri = FileProvider.getUriForFile(TestFileProviderActivity.this, - "com.tencent.shadow.test.plugin.general_cases.fileprovider", mFile); + BuildConfig.APPLICATION_ID + ".general_cases.fileprovider", mFile); // contentUri = Uri.parse("content://com.tencent.shadow.contentprovider.authority/com.tencent.shadow.test.plugin.general_cases.lib.gallery.fileprovider" + // "/name/data/data/com.tencent.shadow.test.hostapp/files/images/1548417832706.jpg"); } else { diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProvider.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProvider.java similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProvider.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProvider.java diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java similarity index 90% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java index 300133c0b..3715a0a63 100755 --- a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java +++ b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/provider/TestProviderInfo.java @@ -22,13 +22,16 @@ import android.net.Uri; import android.provider.BaseColumns; +import com.tencent.shadow.sample.plugin.app.lib.BuildConfig; + public class TestProviderInfo { - protected static final String CONTENT_AUTHORITY = "com.tencent.shadow.provider.test"; + protected static final String CONTENT_AUTHORITY = BuildConfig.APPLICATION_ID + ".provider.test"; protected static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY); protected static final String PATH_TEST = "test"; + public static final class TestEntry implements BaseColumns { public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_TEST).build(); diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/MyReceiver.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/MyReceiver.java similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/MyReceiver.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/MyReceiver.java diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestDynamicReceiverActivity.java diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestReceiverActivity.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestReceiverActivity.java similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestReceiverActivity.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/receiver/TestReceiverActivity.java diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/webview/WebViewActivity.java b/projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/webview/WebViewActivity.java similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/webview/WebViewActivity.java rename to projects/sample/source/sample-plugin/sample-app/src/main/java/com/tencent/shadow/sample/plugin/app/lib/usecases/webview/WebViewActivity.java diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/anim/dialog_exit_fade_out.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/anim/dialog_exit_fade_out.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/anim/dialog_exit_fade_out.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/anim/dialog_exit_fade_out.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/child_bg.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/child_bg.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/child_bg.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/child_bg.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/collapse.png b/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/collapse.png similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/collapse.png rename to projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/collapse.png diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/expanded.png b/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/expanded.png similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/expanded.png rename to projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/expanded.png diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/selector_group.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/selector_group.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/selector_group.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/selector_group.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/selector_item.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/selector_item.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/drawable/selector_item.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/drawable/selector_item.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/activity_test_file_provider.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/activity_test_file_provider.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/activity_test_file_provider.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/activity_test_file_provider.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/activity_test_re_create_by_system.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/activity_test_re_create_by_system.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/activity_test_re_create_by_system.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/activity_test_re_create_by_system.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_activity_lifecycle.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_activity_lifecycle.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_activity_lifecycle.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_activity_lifecycle.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_activity_settheme.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_activity_settheme.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_activity_settheme.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_activity_settheme.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_case_category_item.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_case_category_item.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_case_category_item.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_case_category_item.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_case_item.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_case_item.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_case_item.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_case_item.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_common.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_common.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_common.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_common.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_dialog.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_dialog.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_dialog.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_dialog.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_dialog_activity.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_dialog_activity.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_dialog_activity.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_dialog_activity.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_activity.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_activity.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_activity.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_activity.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_case_summary.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_case_summary.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_case_summary.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_case_summary.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_test.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_test.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_test.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_test.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_xml_activity.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_xml_activity.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_fragment_xml_activity.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_fragment_xml_activity.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main_above.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main_above.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main_above.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main_above.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main_behind.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main_behind.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_main_behind.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_main_behind.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_orientation.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_orientation.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_orientation.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_orientation.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_packagemanager.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_packagemanager.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_packagemanager.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_packagemanager.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_provider_db.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_provider_db.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_provider_db.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_provider_db.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_receiver.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_receiver.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_receiver.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_receiver.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_recreate.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_recreate.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_recreate.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_recreate.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_result.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_result.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_result.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_result.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_service.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_service.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_service.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_service.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_softmode.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_softmode.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_softmode.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_softmode.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_splash.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_splash.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_splash.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_splash.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_test_view_cons_cache.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_test_view_cons_cache.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/layout/layout_test_view_cons_cache.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/layout/layout_test_view_cons_cache.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/menu/case_test_activity_option_menu.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/menu/case_test_activity_option_menu.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/menu/case_test_activity_option_menu.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/menu/case_test_activity_option_menu.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values-v21/themes.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/values-v21/themes.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values-v21/themes.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/values-v21/themes.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/dimens.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/values/dimens.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/dimens.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/values/dimens.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/strings.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/values/strings.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/strings.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/values/strings.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/styles.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/values/styles.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/styles.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/values/styles.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/themes.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/values/themes.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/values/themes.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/values/themes.xml diff --git a/projects/sample/source/sample-plugin/sample-app-lib/src/main/res/xml/filepaths.xml b/projects/sample/source/sample-plugin/sample-app/src/main/res/xml/filepaths.xml similarity index 100% rename from projects/sample/source/sample-plugin/sample-app-lib/src/main/res/xml/filepaths.xml rename to projects/sample/source/sample-plugin/sample-app/src/main/res/xml/filepaths.xml diff --git a/projects/sample/source/sample-plugin/sample-normal-app/.gitignore b/projects/sample/source/sample-plugin/sample-normal-app/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/sample/source/sample-plugin/sample-normal-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/sample/source/sample-plugin/sample-normal-app/build.gradle b/projects/sample/source/sample-plugin/sample-normal-app/build.gradle deleted file mode 100644 index 788897917..000000000 --- a/projects/sample/source/sample-plugin/sample-normal-app/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - applicationId project.SAMPLE_HOST_APP_APPLICATION_ID - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation project(':sample-app-lib') -} - diff --git a/projects/sample/source/sample-plugin/sample-normal-app/proguard-rules.pro b/projects/sample/source/sample-plugin/sample-normal-app/proguard-rules.pro deleted file mode 100644 index 3c7532c6d..000000000 --- a/projects/sample/source/sample-plugin/sample-normal-app/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/sample/source/sample-plugin/sample-normal-app/src/main/AndroidManifest.xml b/projects/sample/source/sample-plugin/sample-normal-app/src/main/AndroidManifest.xml deleted file mode 100644 index a1221504f..000000000 --- a/projects/sample/source/sample-plugin/sample-normal-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/sample/source/sample-plugin/sample-plugin-app/.gitignore b/projects/sample/source/sample-plugin/sample-plugin-app/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/sample/source/sample-plugin/sample-plugin-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/sample/source/sample-plugin/sample-plugin-app/proguard-rules.pro b/projects/sample/source/sample-plugin/sample-plugin-app/proguard-rules.pro deleted file mode 100644 index 3c7532c6d..000000000 --- a/projects/sample/source/sample-plugin/sample-plugin-app/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/sample/source/sample-plugin/sample-plugin-app/src/main/AndroidManifest.xml b/projects/sample/source/sample-plugin/sample-plugin-app/src/main/AndroidManifest.xml deleted file mode 100644 index c02b028f9..000000000 --- a/projects/sample/source/sample-plugin/sample-plugin-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/sdk/core/gradle-plugin/src/main/kotlin/com/tencent/shadow/core/gradle/ShadowPlugin.kt b/projects/sdk/core/gradle-plugin/src/main/kotlin/com/tencent/shadow/core/gradle/ShadowPlugin.kt index 6e7fb04a3..665fb4ba4 100644 --- a/projects/sdk/core/gradle-plugin/src/main/kotlin/com/tencent/shadow/core/gradle/ShadowPlugin.kt +++ b/projects/sdk/core/gradle-plugin/src/main/kotlin/com/tencent/shadow/core/gradle/ShadowPlugin.kt @@ -23,10 +23,8 @@ import com.android.build.gradle.BaseExtension import com.tencent.shadow.core.gradle.extensions.PackagePluginExtension import com.tencent.shadow.core.transform.ShadowTransform import com.tencent.shadow.core.transform_kit.AndroidClassPoolBuilder -import org.gradle.api.Action -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.Task +import com.tencent.shadow.core.transform_kit.ClassPoolBuilder +import org.gradle.api.* import org.gradle.api.plugins.BasePlugin import java.io.File import kotlin.reflect.full.declaredFunctions @@ -34,50 +32,86 @@ import kotlin.reflect.jvm.isAccessible class ShadowPlugin : Plugin { - override fun apply(project: Project) { - System.err.println("ShadowPlugin project.name==" + project.name) + private lateinit var androidClassPoolBuilder: ClassPoolBuilder + private lateinit var contextClassLoader: ClassLoader + override fun apply(project: Project) { val baseExtension = getBaseExtension(project) - val sdkDirectory = baseExtension.sdkDirectory - val androidJarPath = "platforms/${baseExtension.compileSdkVersion}/android.jar" - val androidJar = File(sdkDirectory, androidJarPath) //在这里取到的contextClassLoader包含运行时库(classpath方式引入的)shadow-runtime - val contextClassLoader = Thread.currentThread().contextClassLoader - - val classPoolBuilder = AndroidClassPoolBuilder(project, contextClassLoader, androidJar) + contextClassLoader = Thread.currentThread().contextClassLoader + val lateInitBuilder = object : ClassPoolBuilder { + override fun build() = androidClassPoolBuilder.build() + } val shadowExtension = project.extensions.create("shadow", ShadowExtension::class.java) if (!project.hasProperty("disable_shadow_transform")) { baseExtension.registerTransform(ShadowTransform( - project, - classPoolBuilder, - { shadowExtension.transformConfig.useHostContext } + project, + lateInitBuilder, + { shadowExtension.transformConfig.useHostContext } )) } + addFlavorForTransform(baseExtension) + project.extensions.create("packagePlugin", PackagePluginExtension::class.java, project) project.afterEvaluate { - val packagePlugin = project.extensions.findByName("packagePlugin") - val extension = packagePlugin as PackagePluginExtension - val buildTypes = extension.buildTypes - - val tasks = mutableListOf() - for (i in buildTypes) { - println("buildTypes = " + i.name) - val task = createPackagePluginTask(project, i) - tasks.add(task) + initAndroidClassPoolBuilder(baseExtension, project) + + createPackagePluginTasks(project) + } + } + + private fun createPackagePluginTasks(project: Project) { + val packagePlugin = project.extensions.findByName("packagePlugin") + val extension = packagePlugin as PackagePluginExtension + val buildTypes = extension.buildTypes + + val tasks = mutableListOf() + for (i in buildTypes) { + println("buildTypes = " + i.name) + val task = createPackagePluginTask(project, i) + tasks.add(task) + } + if (tasks.isNotEmpty()) { + project.tasks.create("packageAllPlugin") { + it.group = "plugin" + it.description = "打包所有插件" + }.dependsOn(tasks) + } + } + + private fun addFlavorForTransform(baseExtension: BaseExtension) { + baseExtension.flavorDimensionList.add(ShadowTransform.DimensionName) + try { + baseExtension.productFlavors.create(ShadowTransform.NoShadowTransformFlavorName) { + it.dimension = ShadowTransform.DimensionName + it.isDefault = true } - if (tasks.isNotEmpty()) { - project.tasks.create("packageAllPlugin") { - it.group = "plugin" - it.description = "打包所有插件" - }.dependsOn(tasks) + baseExtension.productFlavors.create(ShadowTransform.ApplyShadowTransformFlavorName) { + it.dimension = ShadowTransform.DimensionName + it.isDefault = false } + } catch (e: InvalidUserDataException) { + throw Error("请在android{} DSL之前apply plugin: 'com.tencent.shadow.plugin'", e) } } + private fun initAndroidClassPoolBuilder( + baseExtension: BaseExtension, + project: Project + ) { + val sdkDirectory = baseExtension.sdkDirectory + val compileSdkVersion = + baseExtension.compileSdkVersion ?: throw IllegalStateException("compileSdkVersion获取失败") + val androidJarPath = "platforms/${compileSdkVersion}/android.jar" + val androidJar = File(sdkDirectory, androidJarPath) + + androidClassPoolBuilder = AndroidClassPoolBuilder(project, contextClassLoader, androidJar) + } + open class ShadowExtension { var transformConfig = TransformConfig() fun transform(action: Action) { diff --git a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageMultiPluginTest.kt b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageMultiPluginTest.kt index 33f0d6603..b3c22bda4 100644 --- a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageMultiPluginTest.kt +++ b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageMultiPluginTest.kt @@ -65,7 +65,7 @@ class PackageMultiPluginTest { val zipFile = ZipFile(ROOT_PROJECT_DIR.absolutePath + "/build/plugin-debug.zip") val zipFileNames = mutableSetOf() zipFileNames.add("config.json") - zipFileNames.add("plugin1-debug.apk") + zipFileNames.add("plugin1-plugin-debug.apk") zipFileNames.add("loader-debug.apk") zipFileNames.add("runtime-debug.apk") @@ -79,7 +79,7 @@ class PackageMultiPluginTest { val case2ZipFile = ZipFile(ROOT_PROJECT_DIR.absolutePath + "/build/plugin-plugin2Debug.zip") zipFileNames.add("config.json") - zipFileNames.add("plugin2-debug.apk") + zipFileNames.add("plugin2-plugin-debug.apk") entries = case2ZipFile.entries() Assert.assertEquals(2, case2ZipFile.size()) @@ -111,7 +111,7 @@ class PackageMultiPluginTest { val pluginsJson = json["plugins"] as JSONArray val pluginJson = pluginsJson[0] as JSONObject Assert.assertEquals("plugin1", pluginJson["partKey"]) - Assert.assertEquals("plugin1-debug.apk", pluginJson["apkName"]) + Assert.assertEquals("plugin1-plugin-debug.apk", pluginJson["apkName"]) val dependsOnJson = pluginJson["dependsOn"] as JSONArray Assert.assertEquals(2, dependsOnJson.size) Assert.assertNotNull(pluginJson["hash"]) diff --git a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageOnlyPluginTest.kt b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageOnlyPluginTest.kt index 3c9e93628..76f247cc5 100644 --- a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageOnlyPluginTest.kt +++ b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackageOnlyPluginTest.kt @@ -66,7 +66,7 @@ class PackageOnlyPluginTest { private fun assertFile(zipFile: ZipFile) { val zipFileNames = mutableSetOf() zipFileNames.add("config.json") - zipFileNames.add("plugin1-debug.apk") + zipFileNames.add("plugin1-plugin-debug.apk") val entries = zipFile.entries() Assert.assertEquals(2, zipFile.size()) @@ -92,7 +92,7 @@ class PackageOnlyPluginTest { val pluginsJson = json["plugins"] as JSONArray val pluginJson = pluginsJson[0] as JSONObject Assert.assertEquals("plugin1", pluginJson["partKey"]) - Assert.assertEquals("plugin1-debug.apk", pluginJson["apkName"]) + Assert.assertEquals("plugin1-plugin-debug.apk", pluginJson["apkName"]) val dependsOnJson = pluginJson["dependsOn"] as JSONArray Assert.assertEquals(2, dependsOnJson.size) Assert.assertNotNull(pluginJson["hash"]) diff --git a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackagePluginTaskTest.kt b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackagePluginTaskTest.kt index 2a740706a..ffb80c1d0 100644 --- a/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackagePluginTaskTest.kt +++ b/projects/sdk/core/gradle-plugin/src/test/kotlin/com/tencent/shadow/core/gradle/PackagePluginTaskTest.kt @@ -68,7 +68,7 @@ class PackagePluginTaskTest { private fun assertFile(zipFile: ZipFile) { val zipFileNames = mutableSetOf() zipFileNames.add("config.json") - zipFileNames.add("plugin1-debug.apk") + zipFileNames.add("plugin1-plugin-debug.apk") zipFileNames.add("loader-debug.apk") zipFileNames.add("runtime-debug.apk") @@ -104,7 +104,7 @@ class PackagePluginTaskTest { val pluginJson = pluginsJson[0] as JSONObject assertEquals("plugin1", pluginJson["partKey"]) assertEquals("plugin1", pluginJson["businessName"]) - assertEquals("plugin1-debug.apk", pluginJson["apkName"]) + assertEquals("plugin1-plugin-debug.apk", pluginJson["apkName"]) val dependsOnJson = pluginJson["dependsOn"] as JSONArray assertEquals(2, dependsOnJson.size) assertNotNull(pluginJson["hash"]) diff --git a/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/build.gradle b/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/build.gradle index 64149b407..d8f0ef62b 100644 --- a/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/build.gradle +++ b/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin1/build.gradle @@ -58,9 +58,9 @@ shadow { pluginApk1 { businessName = 'plugin1' partKey = 'plugin1' - buildTask = ':plugin1:assembleDebug' - apkName = 'plugin1-debug.apk' - apkPath = 'plugin1/build/outputs/apk/debug/plugin1-debug.apk' + buildTask = ':plugin1:assemblePluginDebug' + apkName = 'plugin1-plugin-debug.apk' + apkPath = 'plugin1/build/outputs/apk/plugin/debug/plugin1-plugin-debug.apk' dependsOn = ['Core', 'Base'] hostWhiteList = ["androidx.test.espresso", "com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces"] @@ -72,9 +72,9 @@ shadow { pluginApks { pluginApk1 { partKey = 'plugin1' - buildTask = ':plugin1:assembleDebug' - apkName = 'plugin1-debug.apk' - apkPath = 'plugin1/build/outputs/apk/debug/plugin1-debug.apk' + buildTask = ':plugin1:assemblePluginDebug' + apkName = 'plugin1-plugin-debug.apk' + apkPath = 'plugin1/build/outputs/apk/plugin/debug/plugin1-plugin-debug.apk' dependsOn = ['Core', 'Base'] hostWhiteList = ["androidx.test.espresso", "com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces"] diff --git a/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/build.gradle b/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/build.gradle index 04b9e48c1..cb1d7d5f0 100644 --- a/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/build.gradle +++ b/projects/sdk/core/gradle-plugin/src/test/testProjects/case1/plugin2/build.gradle @@ -55,10 +55,10 @@ shadow { pluginApks { pluginApk1 { partKey = 'plugin2' - buildTask = ':plugin2:assembleDebug' - apkName = 'plugin2-debug.apk' + buildTask = ':plugin2:assemblePluginDebug' + apkName = 'plugin2-plugin-debug.apk' //这里因为单元测试时,会把项目根目录设置成case1的根目录 - apkPath = 'plugin2/build/outputs/apk/debug/plugin2-debug.apk' + apkPath = 'plugin2/build/outputs/apk/plugin/debug/plugin2-plugin-debug.apk' dependsOn = ['Core', 'Base'] hostWhiteList = ["androidx.test.espresso", "com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces"] diff --git a/projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/ShadowTransform.kt b/projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/ShadowTransform.kt index 899863d14..290d6c914 100644 --- a/projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/ShadowTransform.kt +++ b/projects/sdk/core/transform/src/main/kotlin/com/tencent/shadow/core/transform/ShadowTransform.kt @@ -19,6 +19,7 @@ package com.tencent.shadow.core.transform import com.android.build.api.transform.TransformInvocation +import com.android.build.api.variant.VariantInfo import com.tencent.shadow.core.transform_kit.AbstractTransform import com.tencent.shadow.core.transform_kit.AbstractTransformManager import com.tencent.shadow.core.transform_kit.ClassPoolBuilder @@ -32,6 +33,9 @@ class ShadowTransform( companion object { const val SelfClassNamePlaceholder = "com.tencent.shadow.core.transform.SelfClassNamePlaceholder" + const val DimensionName = "Shadow" + const val NoShadowTransformFlavorName = "normal" + const val ApplyShadowTransformFlavorName = "plugin" } lateinit var _mTransformManager: TransformManager @@ -50,4 +54,9 @@ class ShadowTransform( } override fun getName(): String = "ShadowTransform" + + override fun applyToVariant(variant: VariantInfo): Boolean { + return if (variant.isTest) false + else variant.flavorNames.contains(ApplyShadowTransformFlavorName) + } } \ No newline at end of file diff --git a/projects/test/dynamic/host/test-dynamic-host/build.gradle b/projects/test/dynamic/host/test-dynamic-host/build.gradle index 0ebafcd5f..7ffff5c5e 100644 --- a/projects/test/dynamic/host/test-dynamic-host/build.gradle +++ b/projects/test/dynamic/host/test-dynamic-host/build.gradle @@ -15,24 +15,12 @@ android { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } - - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } } sourceSets { debug { assets.srcDir('build/generated/assets/test-dynamic-manager/debug/') assets.srcDir('build/generated/assets/plugin-zip/debug/') } - release { - assets.srcDir('build/generated/assets/test-dynamic-manager/release/') - assets.srcDir('build/generated/assets/plugin-zip/release/') - } } lintOptions { checkReleaseBuilds false @@ -113,7 +101,4 @@ tasks.whenTaskAdded { task -> if (task.name == "generateDebugAssets") { generateAssets(task, 'debug') } - if (task.name == "generateReleaseAssets") { - generateAssets(task, 'release') - } } \ No newline at end of file diff --git a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/CommonApplicationInfoTest.java b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/CommonApplicationInfoTest.java index 78acb94a0..00c77885a 100644 --- a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/CommonApplicationInfoTest.java +++ b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_main/application_info/CommonApplicationInfoTest.java @@ -10,7 +10,7 @@ import org.junit.Test; abstract class CommonApplicationInfoTest extends PluginMainAppTest { - private static final String PLUGIN_APK_FILENAME = "test-plugin-general-cases-debug.apk"; + private static final String PLUGIN_APK_FILENAME = "test-plugin-general-cases-plugin-debug.apk"; protected abstract String getTag(); diff --git a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexTest.java b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexTest.java deleted file mode 100644 index ef7a0f31a..000000000 --- a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexTest.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.tencent.shadow.test.cases.plugin_multidex; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(Suite.class) -@Suite.SuiteClasses({MultiDexV102Test.class, MultiDexV201Test.class}) -public class MultiDexTest { -} diff --git a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV102Test.java b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV102Test.java deleted file mode 100644 index 32e5613a1..000000000 --- a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV102Test.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.tencent.shadow.test.cases.plugin_multidex; - -import com.tencent.shadow.test.lib.constant.Constant; - -public class MultiDexV102Test extends PluginMultiDexAppTest { - @Override - protected String getPartKey() { - return Constant.PART_KEY_MULTIDEX_V1_0_2; - } - - @Override - protected String getActivityName() { - return "com.tencent.shadow.test.plugin.particular_cases.multidex.v1_0_2.PluginMultidexV1_0_2Activity"; - } -} diff --git a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV201Test.java b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV201Test.java deleted file mode 100644 index 49b2323fb..000000000 --- a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/MultiDexV201Test.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.tencent.shadow.test.cases.plugin_multidex; - -import com.tencent.shadow.test.lib.constant.Constant; - -public class MultiDexV201Test extends PluginMultiDexAppTest { - @Override - protected String getPartKey() { - return Constant.PART_KEY_MULTIDEX_V2_0_1; - } - - @Override - protected String getActivityName() { - return "com.tencent.shadow.test.plugin.particular_cases.multidex.v2_0_1.PluginMultidexV2_0_1Activity"; - } -} diff --git a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/PluginMultiDexAppTest.java b/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/PluginMultiDexAppTest.java deleted file mode 100644 index 522f9760b..000000000 --- a/projects/test/dynamic/host/test-dynamic-host/src/androidTest/java/com/tencent/shadow/test/cases/plugin_multidex/PluginMultiDexAppTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Tencent Shadow available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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. - * - */ - -package com.tencent.shadow.test.cases.plugin_multidex; - -import android.content.Intent; - -import androidx.test.core.app.ApplicationProvider; - -import com.tencent.shadow.test.PluginTest; - -import org.junit.Test; - -public abstract class PluginMultiDexAppTest extends PluginTest { - - abstract protected String getActivityName(); - - @Override - protected Intent getLaunchIntent() { - Intent pluginIntent = new Intent(); - String packageName = ApplicationProvider.getApplicationContext().getPackageName(); - pluginIntent.setClassName( - packageName, - getActivityName() - ); - return pluginIntent; - } - - @Test - public void testSuccessLaunch() { - //assert no crash - } -} diff --git a/projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/MainActivity.java b/projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/MainActivity.java index 4fdaf212c..9a7a97c22 100644 --- a/projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/MainActivity.java +++ b/projects/test/dynamic/host/test-dynamic-host/src/main/java/com/tencent/shadow/test/dynamic/host/MainActivity.java @@ -52,9 +52,7 @@ protected void onCreate(Bundle savedInstanceState) { final Spinner partKeySpinner = new Spinner(this); ArrayAdapter partKeysAdapter = new ArrayAdapter<>(this, R.layout.part_key_adapter); partKeysAdapter.addAll( - Constant.PART_KEY_PLUGIN_MAIN_APP, - Constant.PART_KEY_MULTIDEX_V1_0_2, - Constant.PART_KEY_MULTIDEX_V2_0_1 + Constant.PART_KEY_PLUGIN_MAIN_APP ); partKeySpinner.setAdapter(partKeysAdapter); @@ -72,12 +70,6 @@ public void onClick(View v) { case Constant.PART_KEY_PLUGIN_MAIN_APP: intent.putExtra(Constant.KEY_ACTIVITY_CLASSNAME, "com.tencent.shadow.test.plugin.general_cases.lib.usecases.application.TestApplicationActivity"); break; - case Constant.PART_KEY_MULTIDEX_V1_0_2: - intent.putExtra(Constant.KEY_ACTIVITY_CLASSNAME, "com.tencent.shadow.test.plugin.particular_cases.multidex.v1_0_2.PluginMultidexV1_0_2Activity"); - break; - case Constant.PART_KEY_MULTIDEX_V2_0_1: - intent.putExtra(Constant.KEY_ACTIVITY_CLASSNAME, "com.tencent.shadow.test.plugin.particular_cases.multidex.v2_0_1.PluginMultidexV2_0_1Activity"); - break; } startActivity(intent); } diff --git a/projects/test/lib/constant/src/main/java/com/tencent/shadow/test/lib/constant/Constant.java b/projects/test/lib/constant/src/main/java/com/tencent/shadow/test/lib/constant/Constant.java index 534e7e779..0be751ebf 100644 --- a/projects/test/lib/constant/src/main/java/com/tencent/shadow/test/lib/constant/Constant.java +++ b/projects/test/lib/constant/src/main/java/com/tencent/shadow/test/lib/constant/Constant.java @@ -24,8 +24,6 @@ final public class Constant { public static final String KEY_EXTRAS = "KEY_EXTRAS"; public static final String KEY_PLUGIN_PART_KEY = "KEY_PLUGIN_PART_KEY"; public static final String PART_KEY_PLUGIN_MAIN_APP = "test-plugin-general-cases"; - public static final String PART_KEY_MULTIDEX_V1_0_2 = "test-plugin-multidex-v1_0_2"; - public static final String PART_KEY_MULTIDEX_V2_0_1 = "test-plugin-multidex-v2_0_1"; public static final String PART_KEY_PLUGIN_SERVICE_FOR_HOST = "plugin-service-for-host"; public static final String PART_KEY_PLUGIN_ANDROIDX = "test-plugin-androidx-cases"; public static final int FROM_ID_NOOP = 1000; diff --git a/projects/test/none-dynamic/host/test-none-dynamic-host/build.gradle b/projects/test/none-dynamic/host/test-none-dynamic-host/build.gradle index 63ebcab46..93e3c64ea 100644 --- a/projects/test/none-dynamic/host/test-none-dynamic-host/build.gradle +++ b/projects/test/none-dynamic/host/test-none-dynamic-host/build.gradle @@ -54,7 +54,7 @@ def createCopyTask(projectName, buildType, name, apkName) { def moduleName = split[split.length - 1] def outputFile = file("${getBuildDir()}/generated/assets/${name}/${buildType}/${apkName}") outputFile.getParentFile().mkdirs() - def inputFile = file("${project("${projectName}").getBuildDir()}/outputs/apk/${buildType}/${moduleName}-${buildType}.apk") + def inputFile = file("${project("${projectName}").getBuildDir()}/outputs/apk/plugin/${buildType}/${moduleName}-plugin-${buildType}.apk") return tasks.create("copy${buildType.capitalize()}${name.capitalize()}Task", Copy) { group = 'build' description = "复制${name}到assets中." @@ -64,14 +64,11 @@ def createCopyTask(projectName, buildType, name, apkName) { } into(outputFile.getParent()) - }.dependsOn("${projectName}:assemble${buildType.capitalize()}") + }.dependsOn("${projectName}:assemblePlugin${buildType.capitalize()}") } tasks.whenTaskAdded { task -> if (task.name == "generateDebugAssets") { task.dependsOn createCopyTask(':test-plugin-general-cases', 'debug', 'test-plugin-general-cases', 'plugin.apk') } - if (task.name == "generateReleaseAssets") { - task.dependsOn createCopyTask(':test-plugin-general-cases', 'release', 'test-plugin-general-cases', 'plugin.apk') - } } \ No newline at end of file diff --git a/projects/test/plugin/androidx-cases/androidx-cases-app/.gitignore b/projects/test/plugin/androidx-cases/androidx-cases-app/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/androidx-cases/androidx-cases-app/build.gradle b/projects/test/plugin/androidx-cases/androidx-cases-app/build.gradle deleted file mode 100644 index f0dcceb7f..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-app/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - applicationId project.TEST_HOST_APP_APPLICATION_ID - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - testInstrumentationRunner "com.tencent.shadow.test.plugin.androidx_cases.app.CustomAndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation project(':androidx-cases-lib') -} - diff --git a/projects/test/plugin/androidx-cases/androidx-cases-app/proguard-rules.pro b/projects/test/plugin/androidx-cases/androidx-cases-app/proguard-rules.pro deleted file mode 100644 index 3c7532c6d..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-app/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/test/plugin/androidx-cases/androidx-cases-app/src/main/AndroidManifest.xml b/projects/test/plugin/androidx-cases/androidx-cases-app/src/main/AndroidManifest.xml deleted file mode 100644 index ccec86d7c..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/.gitignore b/projects/test/plugin/androidx-cases/androidx-cases-lib/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/build.gradle b/projects/test/plugin/androidx-cases/androidx-cases-lib/build.gradle deleted file mode 100644 index 524cf6c33..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - def activity_version = "1.2.2" - def appcompat_version = "1.3.1" - - implementation "androidx.activity:activity:$activity_version" - implementation "androidx.appcompat:appcompat:$appcompat_version" -} diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/proguard-rules.pro b/projects/test/plugin/androidx-cases/androidx-cases-lib/proguard-rules.pro deleted file mode 100644 index 4cb7103e9..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /usr/local/google/home/jalc/sw/android-sdks/android-sdk-linux/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/AndroidManifest.xml b/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/AndroidManifest.xml deleted file mode 100644 index cdf6e5fa0..000000000 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build.gradle b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build.gradle index 520eabf3e..82bb6690c 100644 --- a/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build.gradle +++ b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build.gradle @@ -1,11 +1,48 @@ -apply from: "../androidx-cases-app/build.gradle" +apply plugin: 'com.android.application' +apply plugin: 'com.tencent.shadow.plugin' android { + compileSdkVersion project.COMPILE_SDK_VERSION + defaultConfig { - applicationId project.TEST_HOST_APP_APPLICATION_ID + applicationId 'com.tencent.shadow.test.plugin.androidx_cases' + minSdkVersion project.MIN_SDK_VERSION + targetSdkVersion project.TARGET_SDK_VERSION + versionCode project.VERSION_CODE + versionName project.VERSION_NAME + testInstrumentationRunner "com.tencent.shadow.test.plugin.androidx_cases.app.CustomAndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + + signingConfig signingConfigs.create("release") + signingConfig.initWith(buildTypes.debug.signingConfig) + } + } + + // 将插件applicationId设置为和宿主相同 + productFlavors { + plugin { + applicationId project.TEST_HOST_APP_APPLICATION_ID + } + } + + lintOptions { + abortOnError false } } +dependencies { + def activity_version = "1.2.2" + def appcompat_version = "1.3.1" + + implementation "androidx.activity:activity:$activity_version" + implementation "androidx.appcompat:appcompat:$appcompat_version" +} + buildscript { repositories { if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) { @@ -23,5 +60,3 @@ buildscript { classpath 'org.javassist:javassist:3.28.0-GA' } } - -apply plugin: 'com.tencent.shadow.plugin' \ No newline at end of file diff --git a/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/AndroidManifest.xml b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/AndroidManifest.xml index 37521ea23..675dfa03a 100644 --- a/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/AndroidManifest.xml +++ b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/AndroidManifest.xml @@ -1 +1,22 @@ - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppCompatTestActivity.java b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppCompatTestActivity.java similarity index 100% rename from projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppCompatTestActivity.java rename to projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppCompatTestActivity.java diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java similarity index 100% rename from projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java rename to projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/AppComponentFactoryTestActivity.java diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/LiveDataWithActivityTestActivity.java b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/LiveDataWithActivityTestActivity.java similarity index 100% rename from projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/LiveDataWithActivityTestActivity.java rename to projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/LiveDataWithActivityTestActivity.java diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java similarity index 96% rename from projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java rename to projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java index f77323950..cec1d24df 100644 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java +++ b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/TestComponentFactory.java @@ -2,7 +2,6 @@ import android.annotation.SuppressLint; import android.app.Activity; -import android.app.AppComponentFactory; import android.content.Intent; import android.os.Build; diff --git a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java similarity index 100% rename from projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java rename to projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java index 08aaebe19..2ef34f40f 100644 --- a/projects/test/plugin/androidx-cases/androidx-cases-lib/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java +++ b/projects/test/plugin/androidx-cases/test-plugin-androidx-cases/src/main/java/com/tencent/shadow/test/plugin/androidx_cases/lib/UiUtil.java @@ -18,6 +18,8 @@ package com.tencent.shadow.test.plugin.androidx_cases.lib; +import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; + import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; @@ -29,8 +31,6 @@ import android.widget.ScrollView; import android.widget.TextView; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - final public class UiUtil { public static ViewGroup setActivityContentView(Activity activity) { ViewGroup viewGroup = makeItemViewGroup(activity); diff --git a/projects/test/plugin/general-cases/general-cases-app/.gitignore b/projects/test/plugin/general-cases/general-cases-app/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/general-cases/general-cases-app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/general-cases/general-cases-app/build.gradle b/projects/test/plugin/general-cases/general-cases-app/build.gradle deleted file mode 100644 index 55288bd48..000000000 --- a/projects/test/plugin/general-cases/general-cases-app/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - applicationId project.TEST_HOST_APP_APPLICATION_ID - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - testInstrumentationRunner "com.tencent.shadow.test.plugin.general_cases.app.CustomAndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation project(':general-cases-lib') - - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:core:1.3.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - androidTestImplementation 'androidx.test.espresso:espresso-remote:3.3.0' - implementation 'androidx.test.espresso:espresso-idling-resource:3.3.0' - androidTestImplementation "androidx.test:runner:1.3.0" -} - diff --git a/projects/test/plugin/general-cases/general-cases-app/proguard-rules.pro b/projects/test/plugin/general-cases/general-cases-app/proguard-rules.pro deleted file mode 100644 index 3c7532c6d..000000000 --- a/projects/test/plugin/general-cases/general-cases-app/proguard-rules.pro +++ /dev/null @@ -1,13 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/test/plugin/general-cases/general-cases-app/src/main/AndroidManifest.xml b/projects/test/plugin/general-cases/general-cases-app/src/main/AndroidManifest.xml deleted file mode 100644 index ca5dc2d6d..000000000 --- a/projects/test/plugin/general-cases/general-cases-app/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/projects/test/plugin/general-cases/general-cases-lib/.gitignore b/projects/test/plugin/general-cases/general-cases-lib/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/general-cases/general-cases-lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/general-cases/general-cases-lib/build.gradle b/projects/test/plugin/general-cases/general-cases-lib/build.gradle deleted file mode 100644 index 08d85c9fd..000000000 --- a/projects/test/plugin/general-cases/general-cases-lib/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfig signingConfigs.create("release") - signingConfig.initWith(buildTypes.debug.signingConfig) - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation 'com.android.support:support-annotations:28.0.0' - implementation 'com.android.support:support-v4:27.1.1' - implementation project(':custom-view') - - compileOnly 'androidx.test.espresso:espresso-idling-resource:3.3.0' - - compileOnly project(':plugin-use-host-code-lib') -} diff --git a/projects/test/plugin/general-cases/general-cases-lib/proguard-rules.pro b/projects/test/plugin/general-cases/general-cases-lib/proguard-rules.pro deleted file mode 100644 index d0579e86f..000000000 --- a/projects/test/plugin/general-cases/general-cases-lib/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/cubershi/Library/Android/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/AndroidManifest.xml b/projects/test/plugin/general-cases/general-cases-lib/src/main/AndroidManifest.xml deleted file mode 100644 index 9ae3ea799..000000000 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/test/plugin/general-cases/test-plugin-general-cases/build.gradle b/projects/test/plugin/general-cases/test-plugin-general-cases/build.gradle index 198faa788..6de836ed0 100644 --- a/projects/test/plugin/general-cases/test-plugin-general-cases/build.gradle +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/build.gradle @@ -1,11 +1,56 @@ -apply from: "../general-cases-app/build.gradle" +apply plugin: 'com.android.application' +apply plugin: 'com.tencent.shadow.plugin' android { + compileSdkVersion project.COMPILE_SDK_VERSION + defaultConfig { applicationId project.TEST_HOST_APP_APPLICATION_ID + minSdkVersion project.MIN_SDK_VERSION + targetSdkVersion project.TARGET_SDK_VERSION + versionCode project.VERSION_CODE + versionName project.VERSION_NAME + testInstrumentationRunner "com.tencent.shadow.test.plugin.general_cases.app.CustomAndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + + signingConfig signingConfigs.create("release") + signingConfig.initWith(buildTypes.debug.signingConfig) + } + } + + // 将插件applicationId设置为和宿主相同 + productFlavors { + plugin { + applicationId project.TEST_HOST_APP_APPLICATION_ID + } + } + + lintOptions { + abortOnError false } } +dependencies { + implementation 'com.android.support:support-annotations:28.0.0' + implementation 'com.android.support:support-v4:27.1.1' + implementation project(':custom-view') + pluginCompileOnly 'androidx.test.espresso:espresso-idling-resource:3.3.0' + normalImplementation 'androidx.test.espresso:espresso-idling-resource:3.3.0' + pluginCompileOnly project(':plugin-use-host-code-lib') + + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test:core:1.3.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + androidTestImplementation 'androidx.test.espresso:espresso-remote:3.3.0' + androidTestImplementation "androidx.test:runner:1.3.0" +} + buildscript { repositories { if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) { @@ -24,9 +69,6 @@ buildscript { } } -apply plugin: 'com.tencent.shadow.plugin' - - shadow { transform { // useHostContext = ['abc'] @@ -41,86 +83,29 @@ shadow { pluginApk1 { businessName = 'general-cases' partKey = 'test-plugin-general-cases' - buildTask = ':test-plugin-general-cases:assembleDebug' - apkName = 'test-plugin-general-cases-debug.apk' - apkPath = 'projects/test/plugin/general-cases/test-plugin-general-cases/build/outputs/apk/debug/test-plugin-general-cases-debug.apk' + buildTask = ':test-plugin-general-cases:assemblePluginDebug' + apkName = 'test-plugin-general-cases-plugin-debug.apk' + apkPath = 'projects/test/plugin/general-cases/test-plugin-general-cases/build/outputs/apk/plugin/debug/test-plugin-general-cases-plugin-debug.apk' hostWhiteList = ["androidx.test.espresso",//这个包添加是为了general-cases插件中可以访问测试框架的类 "com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces"]//测试插件访问宿主白名单类 } - pluginApk2 { - businessName = 'plugin-multidex' - partKey = 'test-plugin-multidex-v1_0_2' - buildTask = ':test-plugin-multidex-v1_0_2:assembleDebug' - apkName = 'test-plugin-multidex-v1_0_2-debug.apk' - apkPath = 'projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build/outputs/apk/debug/test-plugin-multidex-v1_0_2-debug.apk' - } - pluginApk3 { - businessName = 'plugin-multidex' - partKey = 'test-plugin-multidex-v2_0_1' - buildTask = ':test-plugin-multidex-v2_0_1:assembleDebug' - apkName = 'test-plugin-multidex-v2_0_1-debug.apk' - apkPath = 'projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build/outputs/apk/debug/test-plugin-multidex-v2_0_1-debug.apk' - } pluginApk4 { businessName = 'plugin-service-for-host' partKey = 'plugin-service-for-host' - buildTask = ':plugin-service-for-host:assembleDebug' - apkName = 'plugin-service-for-host-debug.apk' - apkPath = 'projects/test/plugin/particular-cases/plugin-service-for-host/build/outputs/apk/debug/plugin-service-for-host-debug.apk' + buildTask = ':plugin-service-for-host:assemblePluginDebug' + apkName = 'plugin-service-for-host-plugin-debug.apk' + apkPath = 'projects/test/plugin/particular-cases/plugin-service-for-host/build/outputs/apk/plugin/debug/plugin-service-for-host-plugin-debug.apk' } pluginApk5 { businessName = 'androidx-cases' partKey = 'test-plugin-androidx-cases' - buildTask = ':test-plugin-androidx-cases:assembleDebug' - apkName = 'test-plugin-androidx-cases-debug.apk' - apkPath = 'projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build/outputs/apk/debug/test-plugin-androidx-cases-debug.apk' + buildTask = ':test-plugin-androidx-cases:assemblePluginDebug' + apkName = 'test-plugin-androidx-cases-plugin-debug.apk' + apkPath = 'projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build/outputs/apk/plugin/debug/test-plugin-androidx-cases-plugin-debug.apk' } } } - release { - loaderApkConfig = new Tuple2('test-dynamic-loader-release.apk', ':test-dynamic-loader:assembleRelease') - runtimeApkConfig = new Tuple2('test-dynamic-runtime-release.apk', ':test-dynamic-runtime:assembleRelease') - pluginApks { - pluginApk1 { - businessName = 'test-plugin-general-cases' - partKey = 'test-plugin-general-cases' - buildTask = ':test-plugin-general-cases:assembleRelease' - apkName = 'test-plugin-general-cases-release.apk' - apkPath = 'projects/test/plugin/general-cases/test-plugin-general-cases/build/outputs/apk/release/test-plugin-general-cases-release.apk' - hostWhiteList = ["androidx.test.espresso",//这个包添加是为了general-cases插件中可以访问测试框架的类 - "com.tencent.shadow.test.lib.plugin_use_host_code_lib.interfaces"]//测试插件访问宿主白名单类 - } - pluginApk2 { - businessName = 'plugin-multidex' - partKey = 'test-plugin-multidex-v1_0_2' - buildTask = ':test-plugin-multidex-v1_0_2:assembleRelease' - apkName = 'test-plugin-multidex-v1_0_2-release.apk' - apkPath = 'projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build/outputs/apk/release/test-plugin-multidex-v1_0_2-release-unsigned.apk' - } - pluginApk3 { - businessName = 'plugin-multidex' - partKey = 'test-plugin-multidex-v2_0_1' - buildTask = ':test-plugin-multidex-v2_0_1:assembleRelease' - apkName = 'test-plugin-multidex-v2_0_1-release.apk' - apkPath = 'projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build/outputs/apk/release/test-plugin-multidex-v2_0_1-release-unsigned.apk' - } - pluginApk4 { - businessName = 'plugin-service-for-host' - partKey = 'plugin-service-for-host' - buildTask = ':plugin-service-for-host:assembleRelease' - apkName = 'plugin-service-for-host-release.apk' - apkPath = 'projects/test/plugin/particular-cases/plugin-service-for-host/build/outputs/apk/release/plugin-service-for-host-release.apk' - } - pluginApk5 { - businessName = 'androidx-cases' - partKey = 'test-plugin-androidx-cases' - buildTask = ':test-plugin-androidx-cases:assembleRelease' - apkName = 'test-plugin-androidx-cases-release.apk' - apkPath = 'projects/test/plugin/androidx-cases/test-plugin-androidx-cases/build/outputs/apk/release/test-plugin-androidx-cases-release.apk' - } - } - } } loaderApkProjectPath = 'projects/test/dynamic/plugin/test-dynamic-loader' diff --git a/projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/ActivityLifecycleCallbacksTest.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/ActivityLifecycleCallbacksTest.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/ActivityLifecycleCallbacksTest.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/ActivityLifecycleCallbacksTest.java diff --git a/projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/CustomAndroidJUnitRunner.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/CustomAndroidJUnitRunner.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/CustomAndroidJUnitRunner.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/CustomAndroidJUnitRunner.java diff --git a/projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/NormalAppTest.java diff --git a/projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/PackageManagerTest.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/PackageManagerTest.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-app/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/PackageManagerTest.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/androidTest/java/com/tencent/shadow/test/plugin/general_cases/app/PackageManagerTest.java diff --git a/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/AndroidManifest.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/AndroidManifest.xml index 37521ea23..95d128cde 100644 --- a/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/AndroidManifest.xml +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/AndroidManifest.xml @@ -1 +1,113 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/TestApplication.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/TestApplication.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/TestApplication.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/TestApplication.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/ToastUtil.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/ToastUtil.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/ToastUtil.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/ToastUtil.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java index 5a62b8425..3b7a3e5a3 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/gallery/util/UiUtil.java @@ -18,6 +18,8 @@ package com.tencent.shadow.test.plugin.general_cases.lib.gallery.util; +import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; + import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; @@ -29,8 +31,6 @@ import android.widget.ScrollView; import android.widget.TextView; -import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; - final public class UiUtil { public static ViewGroup setActivityContentView(Activity activity) { ViewGroup viewGroup = makeItemViewGroup(activity); diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/SimpleIdlingResource.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/SimpleIdlingResource.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/SimpleIdlingResource.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/SimpleIdlingResource.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/WithIdlingResourceActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/WithIdlingResourceActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/WithIdlingResourceActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/WithIdlingResourceActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/ApplicationContextActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/ApplicationContextActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/ApplicationContextActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/ApplicationContextActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java index bcede480a..9c06678f9 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/PrintActivityResultActivity.java @@ -24,7 +24,7 @@ import android.view.View; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.usecases.WithIdlingResourceActivity; public class PrintActivityResultActivity extends WithIdlingResourceActivity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java index ac2043412..2bbdb98db 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOnCreate.java @@ -22,7 +22,7 @@ import android.os.Bundle; import android.support.annotation.Nullable; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.ToastUtil; public class TestActivityOnCreate extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java similarity index 96% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java index 105a81e3d..ea213d01f 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityOrientation.java @@ -25,7 +25,7 @@ import android.support.annotation.Nullable; import android.view.View; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.ToastUtil; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java index f68d3d926..2ee002b0b 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreate.java @@ -24,7 +24,7 @@ import android.view.View; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.ToastUtil; public class TestActivityReCreate extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java similarity index 95% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java index 17272c14e..5d5340603 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityReCreateBySystem.java @@ -22,7 +22,7 @@ import android.os.Bundle; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; public class TestActivityReCreateBySystem extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityWindowSoftMode.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityWindowSoftMode.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityWindowSoftMode.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestActivityWindowSoftMode.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestCallingActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestCallingActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestCallingActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestCallingActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java index ea29b2648..14af68ac7 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/TestListActivity.java @@ -11,7 +11,7 @@ import android.widget.ListView; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import java.util.ArrayList; import java.util.List; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java index 63c87981b..908531397 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/activity/WindowSoftModeJumpActivity.java @@ -24,7 +24,7 @@ import android.view.View; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.usecases.WithIdlingResourceActivity; public class WindowSoftModeJumpActivity extends WithIdlingResourceActivity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/ActivityLifecycleCallbacksTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/ActivityLifecycleCallbacksTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/ActivityLifecycleCallbacksTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/ActivityLifecycleCallbacksTestActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestApplicationActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestApplicationActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestApplicationActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestApplicationActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java index af8474f69..7b42c10f0 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/application/TestGetApplicationInfoActivity.java @@ -1,5 +1,7 @@ package com.tencent.shadow.test.plugin.general_cases.lib.usecases.application; +import static android.content.pm.PackageManager.GET_META_DATA; + import android.app.Activity; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; @@ -9,8 +11,6 @@ import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.UiUtil; -import static android.content.pm.PackageManager.GET_META_DATA; - public class TestGetApplicationInfoActivity extends Activity { private ViewGroup mItemViewGroup; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/classloader/TestBootClassloaderActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/classloader/TestBootClassloaderActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/classloader/TestBootClassloaderActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/classloader/TestBootClassloaderActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ActivityContextSubDirTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ActivityContextSubDirTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ActivityContextSubDirTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ActivityContextSubDirTestActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ApplicationContextSubDirTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ApplicationContextSubDirTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ApplicationContextSubDirTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ApplicationContextSubDirTestActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/RegisterNullReceiverActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/RegisterNullReceiverActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/RegisterNullReceiverActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/RegisterNullReceiverActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ServiceContextSubDirTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ServiceContextSubDirTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ServiceContextSubDirTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/ServiceContextSubDirTestActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java index 39db11d00..77e541d1c 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/SubDirContextThemeWrapperTestActivity.java @@ -18,6 +18,9 @@ package com.tencent.shadow.test.plugin.general_cases.lib.usecases.context; +import static android.os.Environment.DIRECTORY_MUSIC; +import static android.os.Environment.DIRECTORY_PODCASTS; + import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; @@ -40,9 +43,6 @@ import java.util.LinkedList; import java.util.List; -import static android.os.Environment.DIRECTORY_MUSIC; -import static android.os.Environment.DIRECTORY_PODCASTS; - abstract class SubDirContextThemeWrapperTestActivity extends Activity { private ViewGroup mItemViewGroup; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestLayoutInflaterActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestLayoutInflaterActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestLayoutInflaterActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestLayoutInflaterActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestThemeActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestThemeActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestThemeActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/context/TestThemeActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestAlertDialogActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestAlertDialogActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestAlertDialogActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestAlertDialogActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialog.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialog.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialog.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialog.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialogActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialogActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialogActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/dialog/TestDialogActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/BaseFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/BaseFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/BaseFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/BaseFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/FragmentStartedActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/FragmentStartedActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/FragmentStartedActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/FragmentStartedActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideActivityMethodBaseFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideActivityMethodBaseFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideActivityMethodBaseFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideActivityMethodBaseFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideContextMethodBaseFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideContextMethodBaseFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideContextMethodBaseFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/OnlyOverrideContextMethodBaseFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java index b974aa030..4b3088fb5 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/ProgrammaticallyAddFragmentActivity.java @@ -23,7 +23,7 @@ import android.os.Bundle; import android.support.annotation.Nullable; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; public class ProgrammaticallyAddFragmentActivity extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/SubTestBaseFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/SubTestBaseFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/SubTestBaseFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/SubTestBaseFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TargetFragmentTestActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TargetFragmentTestActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TargetFragmentTestActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TargetFragmentTestActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestBaseFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestBaseFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestBaseFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestBaseFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestDialogFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestDialogFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestDialogFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestDialogFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java similarity index 99% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java index 9ad975c6c..affaf5bfe 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestFragmentCommonLogic.java @@ -19,7 +19,7 @@ import android.widget.LinearLayout; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; @SuppressLint("SetTextI18n") class TestFragmentCommonLogic { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestNormalFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestNormalFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestNormalFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestNormalFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachActivityFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachActivityFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachActivityFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachActivityFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachContextFragment.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachContextFragment.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachContextFragment.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/TestSubOnlyOverrideOnAttachContextFragment.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java index b46300fad..70fc3f274 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/fragment/XmlAddFragmentActivity.java @@ -23,7 +23,7 @@ import android.os.Bundle; import android.support.annotation.Nullable; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; public class XmlAddFragmentActivity extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/MyInstrumentation.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/MyInstrumentation.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/MyInstrumentation.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/MyInstrumentation.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/TestInstrumentationActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/TestInstrumentationActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/TestInstrumentationActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/instrumentation/TestInstrumentationActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/interfaces/TestHostInterfaceActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/interfaces/TestHostInterfaceActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/interfaces/TestHostInterfaceActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/interfaces/TestHostInterfaceActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/packagemanager/TestPackageManagerActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/packagemanager/TestPackageManagerActivity.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/packagemanager/TestPackageManagerActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/packagemanager/TestPackageManagerActivity.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java similarity index 99% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java index c437b4901..304c30f62 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBContentProviderActivity.java @@ -30,7 +30,7 @@ import android.widget.TextView; import android.widget.Toast; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; public class TestDBContentProviderActivity extends Activity { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBHelper.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBHelper.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBHelper.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestDBHelper.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java similarity index 95% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java index e7da01136..d0d3c928b 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestFileProviderActivity.java @@ -31,7 +31,8 @@ import android.view.View; import android.widget.ImageView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.BuildConfig; +import com.tencent.shadow.test.plugin.general_cases.R; import java.io.File; @@ -66,7 +67,7 @@ public void onClick(View v) { Uri contentUri; if (targetSdkVersion() >= Build.VERSION_CODES.N) { contentUri = FileProvider.getUriForFile(TestFileProviderActivity.this, - "com.tencent.shadow.test.plugin.general_cases.fileprovider", mFile); + BuildConfig.APPLICATION_ID + ".general_cases.fileprovider", mFile); // contentUri = Uri.parse("content://com.tencent.shadow.contentprovider.authority/com.tencent.shadow.test.plugin.general_cases.lib.gallery.fileprovider" + // "/name/data/data/com.tencent.shadow.test.hostapp/files/images/1548417832706.jpg"); } else { diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProvider.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProvider.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProvider.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProvider.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java similarity index 89% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java index 1f6a44ad9..93f42f2c6 100755 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/provider/TestProviderInfo.java @@ -22,16 +22,21 @@ import android.net.Uri; import android.provider.BaseColumns; +import com.tencent.shadow.test.plugin.general_cases.BuildConfig; + public class TestProviderInfo { - protected static final String CONTENT_AUTHORITY = "com.tencent.shadow.provider.test"; + protected static final String CONTENT_AUTHORITY = BuildConfig.APPLICATION_ID + ".provider.test"; + ; protected static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY); protected static final String PATH_TEST = "test"; + public static final class TestEntry implements BaseColumns { public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_TEST).build(); + protected static Uri buildUri(long id) { return ContentUris.withAppendedId(CONTENT_URI, id); } diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/BroadCastHelper.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/BroadCastHelper.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/BroadCastHelper.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/BroadCastHelper.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/MyReceiver.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/MyReceiver.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/MyReceiver.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/MyReceiver.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java index 9d9ae634e..877cb0eba 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/receiver/TestReceiverActivity.java @@ -18,7 +18,6 @@ package com.tencent.shadow.test.plugin.general_cases.lib.usecases.receiver; -import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -27,10 +26,9 @@ import android.os.Handler; import android.support.annotation.Nullable; import android.view.View; -import android.widget.Button; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.ToastUtil; import com.tencent.shadow.test.plugin.general_cases.lib.usecases.WithIdlingResourceActivity; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestService.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestService.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestService.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestService.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java similarity index 98% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java index 623743a26..01521823c 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/service/TestStartServiceActivity.java @@ -34,7 +34,7 @@ import android.view.View; import android.widget.TextView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import com.tencent.shadow.test.plugin.general_cases.lib.gallery.util.ToastUtil; import com.tencent.shadow.test.plugin.general_cases.lib.usecases.WithIdlingResourceActivity; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java similarity index 97% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java index 5a342aeff..b1d7ad905 100644 --- a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java +++ b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/com/tencent/shadow/test/plugin/general_cases/lib/usecases/view/TestViewConstructorCache.java @@ -23,7 +23,7 @@ import android.support.annotation.Nullable; import com.tencent.shadow.test.lib.custom_view.TestViewConstructorCacheView; -import com.tencent.shadow.test.plugin.general_cases.lib.R; +import com.tencent.shadow.test.plugin.general_cases.R; import dalvik.system.PathClassLoader; diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/java/org/xmlpull/v1/XmlPullParser.java b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/org/xmlpull/v1/XmlPullParser.java similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/java/org/xmlpull/v1/XmlPullParser.java rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/java/org/xmlpull/v1/XmlPullParser.java diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_list.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_list.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_list.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_list.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_test_file_provider.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_test_file_provider.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_test_file_provider.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_test_file_provider.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_test_re_create_by_system.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_test_re_create_by_system.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/activity_test_re_create_by_system.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/activity_test_re_create_by_system.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_activity_lifecycle.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_activity_lifecycle.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_activity_lifecycle.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_activity_lifecycle.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_common.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_common.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_common.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_common.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_fragment_activity.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_fragment_activity.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_fragment_activity.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_fragment_activity.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_fragment_test.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_fragment_test.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_fragment_test.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_fragment_test.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_list_item.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_list_item.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_list_item.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_list_item.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_orientation.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_orientation.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_orientation.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_orientation.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_packagemanager.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_packagemanager.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_packagemanager.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_packagemanager.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_provider_db.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_provider_db.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_provider_db.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_provider_db.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_receiver.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_receiver.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_receiver.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_receiver.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_recreate.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_recreate.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_recreate.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_recreate.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_result.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_result.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_result.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_result.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_service.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_service.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_service.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_service.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_softmode.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_softmode.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_softmode.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_softmode.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_test_view_cons_cache.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_test_view_cons_cache.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_test_view_cons_cache.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_test_view_cons_cache.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_base_fragment_activity.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_base_fragment_activity.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_base_fragment_activity.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_base_fragment_activity.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_normal_fragment_activity.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_normal_fragment_activity.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_normal_fragment_activity.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_normal_fragment_activity.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_sub_fragment_activity.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_sub_fragment_activity.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/layout/layout_xml_add_sub_fragment_activity.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/layout/layout_xml_add_sub_fragment_activity.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/values/strings.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/values/strings.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/values/strings.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/values/strings.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/values/themes.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/values/themes.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/values/themes.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/values/themes.xml diff --git a/projects/test/plugin/general-cases/general-cases-lib/src/main/res/xml/filepaths.xml b/projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/xml/filepaths.xml similarity index 100% rename from projects/test/plugin/general-cases/general-cases-lib/src/main/res/xml/filepaths.xml rename to projects/test/plugin/general-cases/test-plugin-general-cases/src/main/res/xml/filepaths.xml diff --git a/projects/test/plugin/particular-cases/multidex/apk-module-common.gradle b/projects/test/plugin/particular-cases/multidex/apk-module-common.gradle deleted file mode 100644 index 12fdede5c..000000000 --- a/projects/test/plugin/particular-cases/multidex/apk-module-common.gradle +++ /dev/null @@ -1,39 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - applicationId project.TEST_HOST_APP_APPLICATION_ID - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - - multiDexEnabled true - multiDexKeepProguard file('../multidex-config.pro') - } - - dexOptions { - additionalParameters += '--minimal-main-dex'//为了测试Multidex能力 - } - - buildTypes { - debug { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguard-rules.pro' - } - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguard-rules.pro' - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation project(':test-multidex-lib') -} diff --git a/projects/test/plugin/particular-cases/multidex/multidex-config.pro b/projects/test/plugin/particular-cases/multidex/multidex-config.pro deleted file mode 100644 index 667b91937..000000000 --- a/projects/test/plugin/particular-cases/multidex/multidex-config.pro +++ /dev/null @@ -1,2 +0,0 @@ --keep class android.support.multidex.** --keep class androidx.multidex.** \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/proguard-rules.pro b/projects/test/plugin/particular-cases/multidex/proguard-rules.pro deleted file mode 100644 index 667b91937..000000000 --- a/projects/test/plugin/particular-cases/multidex/proguard-rules.pro +++ /dev/null @@ -1,2 +0,0 @@ --keep class android.support.multidex.** --keep class androidx.multidex.** \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/.gitignore b/projects/test/plugin/particular-cases/multidex/test-multidex-lib/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/build.gradle b/projects/test/plugin/particular-cases/multidex/test-multidex-lib/build.gradle deleted file mode 100644 index 23f2359a5..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -apply plugin: 'com.android.library' - -apply plugin: 'kotlin-android' - -apply plugin: 'kotlin-android-extensions' - -android { - compileSdkVersion project.COMPILE_SDK_VERSION - - defaultConfig { - minSdkVersion project.MIN_SDK_VERSION - targetSdkVersion project.TARGET_SDK_VERSION - versionCode project.VERSION_CODE - versionName project.VERSION_NAME - } - - buildTypes { - release { - minifyEnabled false - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/AndroidManifest.xml b/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/AndroidManifest.xml deleted file mode 100644 index 61aa2dad1..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/kotlin/com/tencent/shadow/test/plugin/particular_cases/multidex/lib/PluginMultidexMainActivity.kt b/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/kotlin/com/tencent/shadow/test/plugin/particular_cases/multidex/lib/PluginMultidexMainActivity.kt deleted file mode 100644 index 2071b38e6..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/kotlin/com/tencent/shadow/test/plugin/particular_cases/multidex/lib/PluginMultidexMainActivity.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Tencent Shadow available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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. - * - */ - -package com.tencent.shadow.test.plugin.particular_cases.multidex.lib - -import android.app.Activity -import android.os.Bundle -import android.widget.TextView - -open class PluginMultidexMainActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - val textView = TextView(this) - textView.setText(R.string.info) - setContentView(textView) - } -} \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/res/values/strings.xml b/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/res/values/strings.xml deleted file mode 100644 index d070cbebd..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-multidex-lib/src/main/res/values/strings.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - 此Activity构建时应在第2个Dex中,能启动就是正常的。 - \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/.gitignore b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build.gradle b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build.gradle deleted file mode 100644 index fc1a7b857..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply from: '../apk-module-common.gradle' - -dependencies { - implementation 'com.android.support:multidex:1.0.2' - compileOnly 'com.tencent.shadow.core:runtime' - compileOnly 'com.tencent.shadow.core:activity-container' -} - -buildscript { - repositories { - if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) { - maven { url 'https://mirrors.tencent.com/nexus/repository/maven-public/' } - } else { - google() - jcenter() - } - } - - dependencies { - classpath group: 'com.tencent.shadow.core', name: 'runtime', configuration: 'jar-debug' - classpath group: 'com.tencent.shadow.core', name: 'activity-container', configuration: 'jar-debug' - classpath 'com.tencent.shadow.core:gradle-plugin' - classpath 'org.javassist:javassist:3.28.0-GA' - } -} - -apply plugin: 'com.tencent.shadow.plugin' diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/AndroidManifest.xml b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/AndroidManifest.xml deleted file mode 100644 index 31e81a1f0..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/AndroidManifest.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v1_0_2/PluginMultidexV1_0_2Activity.java b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v1_0_2/PluginMultidexV1_0_2Activity.java deleted file mode 100644 index 5bbcc0b52..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v1_0_2/PluginMultidexV1_0_2Activity.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Tencent Shadow available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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. - * - */ - -package com.tencent.shadow.test.plugin.particular_cases.multidex.v1_0_2; - -import com.tencent.shadow.test.plugin.particular_cases.multidex.lib.PluginMultidexMainActivity; - -public class PluginMultidexV1_0_2Activity extends PluginMultidexMainActivity { -} diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/.gitignore b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/.gitignore deleted file mode 100644 index 796b96d1c..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build.gradle b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build.gradle deleted file mode 100644 index 9cae7d86a..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply from: '../apk-module-common.gradle' - -dependencies { - implementation 'androidx.multidex:multidex:2.0.1' - compileOnly 'com.tencent.shadow.core:runtime' - compileOnly 'com.tencent.shadow.core:activity-container' -} - -buildscript { - repositories { - if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) { - maven { url 'https://mirrors.tencent.com/nexus/repository/maven-public/' } - } else { - google() - jcenter() - } - } - - dependencies { - classpath group: 'com.tencent.shadow.core', name: 'runtime', configuration: 'jar-debug' - classpath group: 'com.tencent.shadow.core', name: 'activity-container', configuration: 'jar-debug' - classpath 'com.tencent.shadow.core:gradle-plugin' - classpath 'org.javassist:javassist:3.28.0-GA' - } -} - -apply plugin: 'com.tencent.shadow.plugin' diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/AndroidManifest.xml b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/AndroidManifest.xml deleted file mode 100644 index 349c2679d..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/AndroidManifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v2_0_1/PluginMultidexV2_0_1Activity.java b/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v2_0_1/PluginMultidexV2_0_1Activity.java deleted file mode 100644 index 06861d46c..000000000 --- a/projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1/src/main/java/com/tencent/shadow/test/plugin/particular_cases/multidex/v2_0_1/PluginMultidexV2_0_1Activity.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Tencent is pleased to support the open source community by making Tencent Shadow available. - * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. - * - * Licensed under the BSD 3-Clause License (the "License"); you may not use - * this file except in compliance with the License. You may obtain a copy of - * the License at - * - * https://opensource.org/licenses/BSD-3-Clause - * - * 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. - * - */ - -package com.tencent.shadow.test.plugin.particular_cases.multidex.v2_0_1; - -import com.tencent.shadow.test.plugin.particular_cases.multidex.lib.PluginMultidexMainActivity; - -public class PluginMultidexV2_0_1Activity extends PluginMultidexMainActivity { -} diff --git a/projects/test/plugin/particular-cases/plugin-service-for-host/build.gradle b/projects/test/plugin/particular-cases/plugin-service-for-host/build.gradle index de38b4bad..16d4b2e32 100644 --- a/projects/test/plugin/particular-cases/plugin-service-for-host/build.gradle +++ b/projects/test/plugin/particular-cases/plugin-service-for-host/build.gradle @@ -1,10 +1,11 @@ apply plugin: 'com.android.application' +apply plugin: 'com.tencent.shadow.plugin' android { compileSdkVersion project.COMPILE_SDK_VERSION defaultConfig { - applicationId project.TEST_HOST_APP_APPLICATION_ID + applicationId 'com.tencent.shadow.test.plugin.particular_cases.plugin_service_for_host' minSdkVersion project.MIN_SDK_VERSION targetSdkVersion project.TARGET_SDK_VERSION versionCode project.VERSION_CODE @@ -21,6 +22,13 @@ android { } } + // 将插件applicationId设置为和宿主相同 + productFlavors { + plugin { + applicationId project.TEST_HOST_APP_APPLICATION_ID + } + } + lintOptions { abortOnError false } @@ -44,4 +52,3 @@ buildscript { } } -apply plugin: 'com.tencent.shadow.plugin' diff --git a/settings.gradle b/settings.gradle index 3c491ddf6..9d6882456 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,9 +23,6 @@ def includeTest() { 'androidx-cases-lib', 'androidx-cases-app', 'test-plugin-androidx-cases', - 'test-multidex-lib', - 'test-plugin-multidex-v1_0_2', - 'test-plugin-multidex-v2_0_1', 'plugin-service-for-host', 'test-none-dynamic-host' project(':test-dynamic-host').projectDir = file('projects/test/dynamic/host/test-dynamic-host') @@ -42,9 +39,6 @@ def includeTest() { project(':test-plugin-androidx-cases').projectDir = file('projects/test/plugin/androidx-cases/test-plugin-androidx-cases') project(':test-plugin-general-cases').projectDir = file('projects/test/plugin/general-cases/test-plugin-general-cases') project(':general-cases-app').projectDir = file('projects/test/plugin/general-cases/general-cases-app') - project(':test-multidex-lib').projectDir = file('projects/test/plugin/particular-cases/multidex/test-multidex-lib') - project(':test-plugin-multidex-v1_0_2').projectDir = file('projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v1_0_2') - project(':test-plugin-multidex-v2_0_1').projectDir = file('projects/test/plugin/particular-cases/multidex/test-plugin-multidex-v2_0_1') project(':plugin-service-for-host').projectDir = file('projects/test/plugin/particular-cases/plugin-service-for-host') project(':test-none-dynamic-host').projectDir = file('projects/test/none-dynamic/host/test-none-dynamic-host') } @@ -58,9 +52,7 @@ def includeSample() { 'sample-runtime', 'pinnedheaderexpandablelistview', 'slidingmenu', - 'sample-app-lib', - 'sample-normal-app', - 'sample-plugin-app' + 'sample-app' project(':sample-constant').projectDir = file('projects/sample/source/sample-constant') project(':sample-host').projectDir = file('projects/sample/source/sample-host') project(':sample-host-lib').projectDir = file('projects/sample/source/sample-host-lib') @@ -69,9 +61,7 @@ def includeSample() { project(':sample-runtime').projectDir = file('projects/sample/source/sample-plugin/sample-runtime') project(':pinnedheaderexpandablelistview').projectDir = file('projects/sample/source/sample-plugin/third-party/pinnedheaderexpandablelistview') project(':slidingmenu').projectDir = file('projects/sample/source/sample-plugin/third-party/slidingmenu') - project(':sample-app-lib').projectDir = file('projects/sample/source/sample-plugin/sample-app-lib') - project(':sample-normal-app').projectDir = file('projects/sample/source/sample-plugin/sample-normal-app') - project(':sample-plugin-app').projectDir = file('projects/sample/source/sample-plugin/sample-plugin-app') + project(':sample-app').projectDir = file('projects/sample/source/sample-plugin/sample-app') } def includeSampleDynamicApk() {