|
10 | 10 | sys.path.insert(0, str(SCRIPTS)) |
11 | 11 |
|
12 | 12 | from augment_native_corpus_request_contract import kotlin_map # noqa: E402 |
13 | | -from augment_native_provider_loading import platform_set_literal, repository_helpers, tv_helpers # noqa: E402 |
| 13 | +from augment_native_provider_loading import insert_imports, platform_set_literal, repository_helpers, tv_helpers # noqa: E402 |
| 14 | +from native_player_diagnostics_codegen import TV_IMPORTS # noqa: E402 |
14 | 15 | from nuvio_tv_test_bootstrap import enable_tv_tests # noqa: E402 |
15 | 16 |
|
16 | 17 | request_contract = (SCRIPTS / "augment_native_corpus_request_contract.py").read_text(encoding="utf-8") |
|
45 | 46 | assert "emptyMap<String, com.nuvio.tv.domain.model.ScraperInfo>()" in provider_loading |
46 | 47 | assert "emptyMap<String, PluginScraper>()" in provider_loading |
47 | 48 |
|
| 49 | +# Player and repository augmentation are two layers of one generated TV test. |
| 50 | +# Repository loading owns their shared Hilt/Flow imports; the player layer must |
| 51 | +# never emit a second copy (the official 0.8.7 Kotlin compiler rejects duplicates). |
| 52 | +layered_tv_imports = insert_imports( |
| 53 | + "import androidx.test.platform.app.InstrumentationRegistry\n" + TV_IMPORTS, |
| 54 | + "tv", |
| 55 | +) |
| 56 | +for shared_import in ( |
| 57 | + "import dagger.hilt.EntryPoint\n", |
| 58 | + "import dagger.hilt.InstallIn\n", |
| 59 | + "import dagger.hilt.android.EntryPointAccessors\n", |
| 60 | + "import dagger.hilt.components.SingletonComponent\n", |
| 61 | + "import kotlinx.coroutines.flow.first\n", |
| 62 | +): |
| 63 | + assert shared_import not in TV_IMPORTS, shared_import |
| 64 | + assert layered_tv_imports.count(shared_import) == 1, shared_import |
| 65 | + |
48 | 66 | # NuvioTV instrumentation bootstrap is a structural contract, never a client |
49 | 67 | # version contract. The official client advanced from 0.8.4 to 0.8.7 and exposed |
50 | 68 | # why anchoring on versionName was wrong. Future version bumps must remain valid. |
|
98 | 116 |
|
99 | 117 | print( |
100 | 118 | "native reader runtime bootstrap contract passed: " |
101 | | - "tv_explicit_pairs=true generated_empty_generics_typed=true tv_version_agnostic_bootstrap=true " |
102 | | - "mobile_real_app=true desktop_ordinary_jvm_policy=true" |
| 119 | + "tv_explicit_pairs=true generated_empty_generics_typed=true tv_single_owner_hilt_imports=true " |
| 120 | + "tv_version_agnostic_bootstrap=true mobile_real_app=true desktop_ordinary_jvm_policy=true" |
103 | 121 | ) |
0 commit comments