diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index bc35fc4..521b255 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -173,7 +173,9 @@ jobs: uses: actions/upload-artifact@v7 with: name: android-test-results - path: SDK/Android/*/build/reports/tests + path: | + SDK/Android/*/build/reports/tests + SDK/Plugins/*/Android/build/reports/tests retention-days: 7 docs: diff --git a/.gitignore b/.gitignore index 35f41f7..821f933 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,6 @@ WebBridge/dist/ SDK/Android/**/.gradle/ SDK/Android/**/.kotlin/ SDK/Android/**/build/ +SDK/Plugins/**/.kotlin/ +SDK/Plugins/**/build/ SDK/Android/local.properties diff --git a/AGENTS.md b/AGENTS.md index 6b6e5b3..8152a50 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,7 +30,8 @@ NectoMac/Sources/NectoCLIService The control socket contract shared by Necto.a NectoMac/Sources/NectoMacService Mac providers, routing, device connections and control server SDK/iOS/Sources/NectoSDK The SDK and listener embedded in a connected app SDK/iOS/Tests/ SDK tests and the standalone consumer fixture -SDK/Android/ Kotlin SDK, plugin modules and sample app, built by Gradle +SDK/Android/ Kotlin bridge and sample app, built by Gradle +SDK/Plugins// One plugin: Panel/ is the built panel, iOS/ the Swift sources, Android/ the Gradle module Necto/ macOS shell, built by Necto.xcodeproj ExampleApp/ iOS sample app, built by Necto.xcodeproj WebPackages/BuiltInPlugins/ src/ is source, Plugins/ is the committed build output diff --git a/NectoAppTests/NectoThemeTests.swift b/NectoAppTests/NectoThemeTests.swift index a0f3f32..bae3a2f 100644 --- a/NectoAppTests/NectoThemeTests.swift +++ b/NectoAppTests/NectoThemeTests.swift @@ -14,14 +14,11 @@ struct NectoThemeTests { @Test("Shared and shipped styles match native colors in both appearances", arguments: [false, true]) func renderedColors(isDark: Bool) async throws { let root = URL(filePath: #filePath).deletingLastPathComponent().deletingLastPathComponent() - let sources = root.appending(path: "SDK/iOS/Sources") - let modules = try FileManager.default.contentsOfDirectory(at: sources, includingPropertiesForKeys: nil) - let panels = try modules.flatMap { module -> [URL] in - let directory = module.appending(path: "Panels") - guard FileManager.default.fileExists(atPath: directory.path) else { return [] } - return try FileManager.default.contentsOfDirectory(at: directory, includingPropertiesForKeys: nil) - .filter { $0.hasDirectoryPath }.map { $0.appending(path: "assets/index.css") } - } + let plugins = root.appending(path: "SDK/Plugins") + let panels = try FileManager.default.contentsOfDirectory(at: plugins, includingPropertiesForKeys: nil) + .map { $0.appending(path: "Panel") } + .filter { FileManager.default.fileExists(atPath: $0.path) } + .map { $0.appending(path: "assets/index.css") } let styles = [root.appending(path: "WebPackages/Bridge/theme.css")] + panels + [ root.appending(path: "WebPackages/BuiltInPlugins/Plugins/plugin-sample/assets/index.css"), root.appending(path: "WebPackages/BuiltInPlugins/Plugins/shell-demo/assets/index.css"), diff --git a/Package.swift b/Package.swift index 244f12e..33765be 100644 --- a/Package.swift +++ b/Package.swift @@ -33,50 +33,62 @@ let package = Package( .target( name: "NectoNetworkPlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoNetworkPlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/Network", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), .target( name: "NectoEventsPlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoEventsPlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/Events", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), .target( name: "NectoFilesPlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoFilesPlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/Files", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), .target( name: "NectoPreferencesPlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoPreferencesPlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/Preferences", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), .target( name: "NectoPerformancePlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoPerformancePlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/Performance", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), .target( name: "NectoUIControlPlugin", dependencies: ["NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoUIControlPlugin", - resources: [.copy("Panels")] + path: "SDK/Plugins/UIControl", + exclude: ["Android"], + sources: ["iOS"], + resources: [.copy("Panel")] ), // CPU, memory and frame-rate capture for apps that explicitly opt in. .target( name: "NectoProcessMetricPlugin", dependencies: ["NectoPerformancePlugin", "NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoProcessMetricPlugin" + path: "SDK/Plugins/ProcessMetric/iOS" ), // Capture stays separate from the reporting API and starts only on registration. .target( name: "NectoURLSessionCapturePlugin", dependencies: ["NectoNetworkPlugin", "NectoModel", "NectoSDK"], - path: "SDK/iOS/Sources/NectoURLSessionCapturePlugin" + path: "SDK/Plugins/URLSessionCapture/iOS" ), .testTarget( name: "NectoModelTests", diff --git a/SDK/Android/README.md b/SDK/Android/README.md index 4675a3f..2f60bbd 100644 --- a/SDK/Android/README.md +++ b/SDK/Android/README.md @@ -222,11 +222,11 @@ One session is served at a time. still scrolls the list it starts in. - **Panels** are packaged as Java resources: `necto/panels/`, with a `files.txt` index. - - The build generates them from the built iOS panels in - `SDK/iOS/Sources//Panels`. + - The build generates them from the built panel beside each module, + `SDK/Plugins//Panel`, the same directory the Swift package copies. - It overrides only the Control and Preferences manifests, which describe Android behaviour. They live in each owning plugin's `src/main/panel-manifests`, and the build fails - when their contracts drift from the iOS ones. + when their contracts drift from the panel's own. - **Requests from Necto** are bounded by the 64 KiB inbound frame, which reaches `files.write` and `preferences.set` with a large string. A larger request closes the session, the request fails with `PROVIDER_FAILED`, and Necto reconnects within a diff --git a/SDK/Android/buildSrc/src/main/kotlin/NectoPanelResources.kt b/SDK/Android/buildSrc/src/main/kotlin/NectoPanelResources.kt index 8aa5f04..8fa34c7 100644 --- a/SDK/Android/buildSrc/src/main/kotlin/NectoPanelResources.kt +++ b/SDK/Android/buildSrc/src/main/kotlin/NectoPanelResources.kt @@ -3,13 +3,10 @@ import groovy.json.JsonSlurper import org.gradle.api.DefaultTask import org.gradle.api.GradleException -import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty -import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputDirectory -import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.Optional import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.PathSensitive @@ -18,22 +15,23 @@ import org.gradle.api.tasks.TaskAction import java.io.File /** - * Packages built web panels as Java resources under [root]/, each with a files.txt + * Packages a built web panel as Java resources under [root]/[id], with a files.txt * index, because resource folders cannot be listed at run time (an APK is not a * directory). * - * Panels are read from the repository's built output, so Android carries the same panel - * code as iOS. A manifest in [manifests] named .json replaces the panel's own, for - * wording that differs on Android; it must declare the same operations, so a contract - * cannot drift from the panel it rides with. + * The panel is read from the repository's built output, the same directory the Swift + * package copies, so Android carries the same panel code as iOS. A manifest in + * [manifests] named .json replaces the panel's own, for wording that differs on + * Android; it must declare the same operations, so a contract cannot drift from the + * panel it rides with. */ abstract class NectoPanelResources : DefaultTask() { - @get:InputFiles + @get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) - abstract val panels: ConfigurableFileCollection + abstract val panel: DirectoryProperty @get:Input - abstract val ids: ListProperty + abstract val id: Property @get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) @@ -48,27 +46,24 @@ abstract class NectoPanelResources : DefaultTask() { @TaskAction fun generate() { - val destinationRoot = output.get().asFile.resolve(root.get()) + val id = id.get() + val panel = panel.get().asFile + if (!panel.resolve("manifest.json").isFile) throw GradleException("No built panel at $panel") output.get().asFile.deleteRecursively() - for (id in ids.get()) { - val panel = panels.files.singleOrNull { it.name == id } - ?: throw GradleException("Expected one built panel for $id") - if (!panel.resolve("manifest.json").isFile) throw GradleException("No built panel at $panel") - val destination = destinationRoot.resolve(id) - val paths = panel.walkTopDown() - .filter { it.isFile && !it.name.startsWith(".") } - .map { it.relativeTo(panel).invariantSeparatorsPath } - .sorted() - .toList() - paths.forEach { path -> panel.resolve(path).copyTo(destination.resolve(path)) } - manifests.orNull?.asFile?.resolve("$id.json")?.takeIf { it.isFile }?.let { override -> - if (contract(override) != contract(panel.resolve("manifest.json"))) { - throw GradleException("$override must declare the same operations as $panel/manifest.json") - } - override.copyTo(destination.resolve("manifest.json"), overwrite = true) + val destination = output.get().asFile.resolve(root.get()).resolve(id) + val paths = panel.walkTopDown() + .filter { it.isFile && !it.name.startsWith(".") } + .map { it.relativeTo(panel).invariantSeparatorsPath } + .sorted() + .toList() + paths.forEach { path -> panel.resolve(path).copyTo(destination.resolve(path)) } + manifests.orNull?.asFile?.resolve("$id.json")?.takeIf { it.isFile }?.let { override -> + if (contract(override) != contract(panel.resolve("manifest.json"))) { + throw GradleException("$override must declare the same operations as $panel/manifest.json") } - destination.resolve("files.txt").writeText(paths.joinToString("\n", postfix = "\n")) + override.copyTo(destination.resolve("manifest.json"), overwrite = true) } + destination.resolve("files.txt").writeText(paths.joinToString("\n", postfix = "\n")) } /** Which operations a manifest declares and how they bind; wording and schemas may differ. */ diff --git a/SDK/Android/sample/build.gradle.kts b/SDK/Android/sample/build.gradle.kts index 4c01359..c4393d6 100644 --- a/SDK/Android/sample/build.gradle.kts +++ b/SDK/Android/sample/build.gradle.kts @@ -37,8 +37,8 @@ kotlin { // Built from WebPackages/BuiltInPlugins: the same plugin-sample panel ExampleApp carries. val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.layout.projectDirectory.dir("../../WebPackages/BuiltInPlugins/Plugins/plugin-sample")) - ids.set(listOf("plugin-sample")) + panel.set(rootProject.layout.projectDirectory.dir("../../WebPackages/BuiltInPlugins/Plugins/plugin-sample")) + id.set("plugin-sample") root.set("panels") output.set(layout.buildDirectory.dir("generated/panelResources")) } diff --git a/SDK/Android/settings.gradle.kts b/SDK/Android/settings.gradle.kts index 39c307e..f011905 100644 --- a/SDK/Android/settings.gradle.kts +++ b/SDK/Android/settings.gradle.kts @@ -35,3 +35,17 @@ include(":necto-core", ":necto-plugin-support", ":necto-events-plugin", ":necto- if (providers.gradleProperty("necto.skipAndroid").orNull != "true") { include(":necto-android", ":necto-files-plugin", ":necto-ui-control-plugin", ":necto-process-metric-plugin", ":necto-datastore-preferences-plugin", ":sample") } + +// A plugin lives beside its panel and its iOS counterpart, in SDK/Plugins//Android. +mapOf( + "necto-events-plugin" to "Events", + "necto-network-plugin" to "Network", + "necto-okhttp-capture-plugin" to "OkHttpCapture", + "necto-files-plugin" to "Files", + "necto-performance-plugin" to "Performance", + "necto-process-metric-plugin" to "ProcessMetric", + "necto-ui-control-plugin" to "UIControl", + "necto-datastore-preferences-plugin" to "Preferences", +).forEach { (name, plugin) -> + findProject(":$name")?.projectDir = file("../Plugins/$plugin/Android") +} diff --git a/SDK/Android/necto-events-plugin/build.gradle.kts b/SDK/Plugins/Events/Android/build.gradle.kts similarity index 84% rename from SDK/Android/necto-events-plugin/build.gradle.kts rename to SDK/Plugins/Events/Android/build.gradle.kts index b478a21..49ae0ee 100644 --- a/SDK/Android/necto-events-plugin/build.gradle.kts +++ b/SDK/Plugins/Events/Android/build.gradle.kts @@ -30,10 +30,8 @@ tasks.test { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/event-log/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("event-log")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("event-log") root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) } diff --git a/SDK/Android/necto-events-plugin/src/main/kotlin/im/toss/necto/plugins/NectoEventsPlugin.kt b/SDK/Plugins/Events/Android/src/main/kotlin/im/toss/necto/plugins/NectoEventsPlugin.kt similarity index 100% rename from SDK/Android/necto-events-plugin/src/main/kotlin/im/toss/necto/plugins/NectoEventsPlugin.kt rename to SDK/Plugins/Events/Android/src/main/kotlin/im/toss/necto/plugins/NectoEventsPlugin.kt diff --git a/SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/assets/index.css b/SDK/Plugins/Events/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/assets/index.css rename to SDK/Plugins/Events/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/assets/index.js b/SDK/Plugins/Events/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/assets/index.js rename to SDK/Plugins/Events/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/index.html b/SDK/Plugins/Events/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/index.html rename to SDK/Plugins/Events/Panel/index.html diff --git a/SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/manifest.json b/SDK/Plugins/Events/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log/manifest.json rename to SDK/Plugins/Events/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoEventsPlugin/NectoEventsPlugin.swift b/SDK/Plugins/Events/iOS/NectoEventsPlugin.swift similarity index 99% rename from SDK/iOS/Sources/NectoEventsPlugin/NectoEventsPlugin.swift rename to SDK/Plugins/Events/iOS/NectoEventsPlugin.swift index 468f40c..705e7ef 100644 --- a/SDK/iOS/Sources/NectoEventsPlugin/NectoEventsPlugin.swift +++ b/SDK/Plugins/Events/iOS/NectoEventsPlugin.swift @@ -70,7 +70,7 @@ public final class NectoEventsPlugin: NectoPlugin, NectoEventReporting, @uncheck public let id = "event-log" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/event-log") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } private let lock = NSLock() diff --git a/SDK/Android/necto-files-plugin/build.gradle.kts b/SDK/Plugins/Files/Android/build.gradle.kts similarity index 89% rename from SDK/Android/necto-files-plugin/build.gradle.kts rename to SDK/Plugins/Files/Android/build.gradle.kts index ded27c9..458821f 100644 --- a/SDK/Android/necto-files-plugin/build.gradle.kts +++ b/SDK/Plugins/Files/Android/build.gradle.kts @@ -43,10 +43,8 @@ dependencies { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/files/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("files")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("files") root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) } diff --git a/SDK/Android/necto-datastore-preferences-plugin/src/main/AndroidManifest.xml b/SDK/Plugins/Files/Android/src/main/AndroidManifest.xml similarity index 100% rename from SDK/Android/necto-datastore-preferences-plugin/src/main/AndroidManifest.xml rename to SDK/Plugins/Files/Android/src/main/AndroidManifest.xml diff --git a/SDK/Android/necto-files-plugin/src/main/kotlin/im/toss/necto/plugins/NectoFilesPlugin.kt b/SDK/Plugins/Files/Android/src/main/kotlin/im/toss/necto/plugins/NectoFilesPlugin.kt similarity index 100% rename from SDK/Android/necto-files-plugin/src/main/kotlin/im/toss/necto/plugins/NectoFilesPlugin.kt rename to SDK/Plugins/Files/Android/src/main/kotlin/im/toss/necto/plugins/NectoFilesPlugin.kt diff --git a/SDK/Android/necto-files-plugin/src/test/kotlin/im/toss/necto/FilesPluginTests.kt b/SDK/Plugins/Files/Android/src/test/kotlin/im/toss/necto/FilesPluginTests.kt similarity index 100% rename from SDK/Android/necto-files-plugin/src/test/kotlin/im/toss/necto/FilesPluginTests.kt rename to SDK/Plugins/Files/Android/src/test/kotlin/im/toss/necto/FilesPluginTests.kt diff --git a/SDK/iOS/Sources/NectoFilesPlugin/Panels/files/assets/index.css b/SDK/Plugins/Files/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoFilesPlugin/Panels/files/assets/index.css rename to SDK/Plugins/Files/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoFilesPlugin/Panels/files/assets/index.js b/SDK/Plugins/Files/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoFilesPlugin/Panels/files/assets/index.js rename to SDK/Plugins/Files/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoFilesPlugin/Panels/files/index.html b/SDK/Plugins/Files/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoFilesPlugin/Panels/files/index.html rename to SDK/Plugins/Files/Panel/index.html diff --git a/SDK/iOS/Sources/NectoFilesPlugin/Panels/files/manifest.json b/SDK/Plugins/Files/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoFilesPlugin/Panels/files/manifest.json rename to SDK/Plugins/Files/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoFilesPlugin/NectoFilesPlugin.swift b/SDK/Plugins/Files/iOS/NectoFilesPlugin.swift similarity index 99% rename from SDK/iOS/Sources/NectoFilesPlugin/NectoFilesPlugin.swift rename to SDK/Plugins/Files/iOS/NectoFilesPlugin.swift index f614a87..1f140be 100644 --- a/SDK/iOS/Sources/NectoFilesPlugin/NectoFilesPlugin.swift +++ b/SDK/Plugins/Files/iOS/NectoFilesPlugin.swift @@ -57,7 +57,7 @@ public final class NectoFilesPlugin: NectoPlugin, @unchecked Sendable { public let id = "files" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/files") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } private let roots: [Root] diff --git a/SDK/Android/necto-network-plugin/build.gradle.kts b/SDK/Plugins/Network/Android/build.gradle.kts similarity index 83% rename from SDK/Android/necto-network-plugin/build.gradle.kts rename to SDK/Plugins/Network/Android/build.gradle.kts index 2e0ec48..0e89cda 100644 --- a/SDK/Android/necto-network-plugin/build.gradle.kts +++ b/SDK/Plugins/Network/Android/build.gradle.kts @@ -30,10 +30,8 @@ tasks.test { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/network-logger/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("network-logger")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("network-logger") root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) } diff --git a/SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkPlugin.kt b/SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkPlugin.kt similarity index 100% rename from SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkPlugin.kt rename to SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkPlugin.kt diff --git a/SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecord.kt b/SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecord.kt similarity index 100% rename from SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecord.kt rename to SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecord.kt diff --git a/SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecordCoding.kt b/SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecordCoding.kt similarity index 100% rename from SDK/Android/necto-network-plugin/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecordCoding.kt rename to SDK/Plugins/Network/Android/src/main/kotlin/im/toss/necto/plugins/NectoNetworkRecordCoding.kt diff --git a/SDK/Android/necto-network-plugin/src/test/kotlin/im/toss/necto/NetworkPluginTests.kt b/SDK/Plugins/Network/Android/src/test/kotlin/im/toss/necto/NetworkPluginTests.kt similarity index 100% rename from SDK/Android/necto-network-plugin/src/test/kotlin/im/toss/necto/NetworkPluginTests.kt rename to SDK/Plugins/Network/Android/src/test/kotlin/im/toss/necto/NetworkPluginTests.kt diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/assets/index.css b/SDK/Plugins/Network/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/assets/index.css rename to SDK/Plugins/Network/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/assets/index.js b/SDK/Plugins/Network/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/assets/index.js rename to SDK/Plugins/Network/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/index.html b/SDK/Plugins/Network/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/index.html rename to SDK/Plugins/Network/Panel/index.html diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/manifest.json b/SDK/Plugins/Network/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger/manifest.json rename to SDK/Plugins/Network/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkPlugin.swift b/SDK/Plugins/Network/iOS/NectoNetworkPlugin.swift similarity index 98% rename from SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkPlugin.swift rename to SDK/Plugins/Network/iOS/NectoNetworkPlugin.swift index c7a8482..29218a0 100644 --- a/SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkPlugin.swift +++ b/SDK/Plugins/Network/iOS/NectoNetworkPlugin.swift @@ -34,7 +34,7 @@ public final class NectoNetworkPlugin: NectoPlugin, NectoNetworkReporting, @unch public let id = "network-logger" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/network-logger") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } private let lock = NSLock() diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkRecord.swift b/SDK/Plugins/Network/iOS/NectoNetworkRecord.swift similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkRecord.swift rename to SDK/Plugins/Network/iOS/NectoNetworkRecord.swift diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkRecordCoding.swift b/SDK/Plugins/Network/iOS/NectoNetworkRecordCoding.swift similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkRecordCoding.swift rename to SDK/Plugins/Network/iOS/NectoNetworkRecordCoding.swift diff --git a/SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkReporting.swift b/SDK/Plugins/Network/iOS/NectoNetworkReporting.swift similarity index 100% rename from SDK/iOS/Sources/NectoNetworkPlugin/NectoNetworkReporting.swift rename to SDK/Plugins/Network/iOS/NectoNetworkReporting.swift diff --git a/SDK/Android/necto-okhttp-capture-plugin/build.gradle.kts b/SDK/Plugins/OkHttpCapture/Android/build.gradle.kts similarity index 100% rename from SDK/Android/necto-okhttp-capture-plugin/build.gradle.kts rename to SDK/Plugins/OkHttpCapture/Android/build.gradle.kts diff --git a/SDK/Android/necto-okhttp-capture-plugin/src/main/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptor.kt b/SDK/Plugins/OkHttpCapture/Android/src/main/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptor.kt similarity index 100% rename from SDK/Android/necto-okhttp-capture-plugin/src/main/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptor.kt rename to SDK/Plugins/OkHttpCapture/Android/src/main/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptor.kt diff --git a/SDK/Android/necto-okhttp-capture-plugin/src/test/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptorTest.kt b/SDK/Plugins/OkHttpCapture/Android/src/test/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptorTest.kt similarity index 100% rename from SDK/Android/necto-okhttp-capture-plugin/src/test/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptorTest.kt rename to SDK/Plugins/OkHttpCapture/Android/src/test/kotlin/im/toss/necto/okhttp/NectoOkHttpInterceptorTest.kt diff --git a/SDK/Android/necto-performance-plugin/build.gradle.kts b/SDK/Plugins/Performance/Android/build.gradle.kts similarity index 83% rename from SDK/Android/necto-performance-plugin/build.gradle.kts rename to SDK/Plugins/Performance/Android/build.gradle.kts index 0f26a3a..83a0b87 100644 --- a/SDK/Android/necto-performance-plugin/build.gradle.kts +++ b/SDK/Plugins/Performance/Android/build.gradle.kts @@ -31,10 +31,8 @@ tasks.test { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/performance-monitor/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("performance-monitor")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("performance-monitor") root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) } diff --git a/SDK/Android/necto-performance-plugin/src/main/kotlin/im/toss/necto/plugins/NectoPerformancePlugin.kt b/SDK/Plugins/Performance/Android/src/main/kotlin/im/toss/necto/plugins/NectoPerformancePlugin.kt similarity index 100% rename from SDK/Android/necto-performance-plugin/src/main/kotlin/im/toss/necto/plugins/NectoPerformancePlugin.kt rename to SDK/Plugins/Performance/Android/src/main/kotlin/im/toss/necto/plugins/NectoPerformancePlugin.kt diff --git a/SDK/Android/necto-performance-plugin/src/test/kotlin/im/toss/necto/PerformancePluginTests.kt b/SDK/Plugins/Performance/Android/src/test/kotlin/im/toss/necto/PerformancePluginTests.kt similarity index 100% rename from SDK/Android/necto-performance-plugin/src/test/kotlin/im/toss/necto/PerformancePluginTests.kt rename to SDK/Plugins/Performance/Android/src/test/kotlin/im/toss/necto/PerformancePluginTests.kt diff --git a/SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/assets/index.css b/SDK/Plugins/Performance/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/assets/index.css rename to SDK/Plugins/Performance/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/assets/index.js b/SDK/Plugins/Performance/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/assets/index.js rename to SDK/Plugins/Performance/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/index.html b/SDK/Plugins/Performance/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/index.html rename to SDK/Plugins/Performance/Panel/index.html diff --git a/SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/manifest.json b/SDK/Plugins/Performance/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor/manifest.json rename to SDK/Plugins/Performance/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoPerformancePlugin/NectoPerformancePlugin.swift b/SDK/Plugins/Performance/iOS/NectoPerformancePlugin.swift similarity index 99% rename from SDK/iOS/Sources/NectoPerformancePlugin/NectoPerformancePlugin.swift rename to SDK/Plugins/Performance/iOS/NectoPerformancePlugin.swift index 09de5f5..3689075 100644 --- a/SDK/iOS/Sources/NectoPerformancePlugin/NectoPerformancePlugin.swift +++ b/SDK/Plugins/Performance/iOS/NectoPerformancePlugin.swift @@ -117,7 +117,7 @@ public final class NectoPerformancePlugin: NectoPlugin, NectoPerformanceReportin public let id = "performance-monitor" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/performance-monitor") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } private let metrics: [NectoMetric] private let sampler: (any NectoPerformanceSampling)? diff --git a/SDK/Android/necto-datastore-preferences-plugin/build.gradle.kts b/SDK/Plugins/Preferences/Android/build.gradle.kts similarity index 89% rename from SDK/Android/necto-datastore-preferences-plugin/build.gradle.kts rename to SDK/Plugins/Preferences/Android/build.gradle.kts index 0034c61..3eacbe9 100644 --- a/SDK/Android/necto-datastore-preferences-plugin/build.gradle.kts +++ b/SDK/Plugins/Preferences/Android/build.gradle.kts @@ -43,10 +43,8 @@ dependencies { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/preferences/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("preferences")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("preferences") manifests.set(layout.projectDirectory.dir("src/main/panel-manifests")) root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) diff --git a/SDK/Android/necto-files-plugin/src/main/AndroidManifest.xml b/SDK/Plugins/Preferences/Android/src/main/AndroidManifest.xml similarity index 100% rename from SDK/Android/necto-files-plugin/src/main/AndroidManifest.xml rename to SDK/Plugins/Preferences/Android/src/main/AndroidManifest.xml diff --git a/SDK/Android/necto-datastore-preferences-plugin/src/main/kotlin/im/toss/necto/android/NectoDataStorePreferencesPlugin.kt b/SDK/Plugins/Preferences/Android/src/main/kotlin/im/toss/necto/android/NectoDataStorePreferencesPlugin.kt similarity index 100% rename from SDK/Android/necto-datastore-preferences-plugin/src/main/kotlin/im/toss/necto/android/NectoDataStorePreferencesPlugin.kt rename to SDK/Plugins/Preferences/Android/src/main/kotlin/im/toss/necto/android/NectoDataStorePreferencesPlugin.kt diff --git a/SDK/Android/necto-datastore-preferences-plugin/src/main/panel-manifests/preferences.json b/SDK/Plugins/Preferences/Android/src/main/panel-manifests/preferences.json similarity index 100% rename from SDK/Android/necto-datastore-preferences-plugin/src/main/panel-manifests/preferences.json rename to SDK/Plugins/Preferences/Android/src/main/panel-manifests/preferences.json diff --git a/SDK/Android/necto-datastore-preferences-plugin/src/test/kotlin/im/toss/necto/android/NectoDataStorePreferencesPluginTest.kt b/SDK/Plugins/Preferences/Android/src/test/kotlin/im/toss/necto/android/NectoDataStorePreferencesPluginTest.kt similarity index 100% rename from SDK/Android/necto-datastore-preferences-plugin/src/test/kotlin/im/toss/necto/android/NectoDataStorePreferencesPluginTest.kt rename to SDK/Plugins/Preferences/Android/src/test/kotlin/im/toss/necto/android/NectoDataStorePreferencesPluginTest.kt diff --git a/SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/assets/index.css b/SDK/Plugins/Preferences/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/assets/index.css rename to SDK/Plugins/Preferences/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/assets/index.js b/SDK/Plugins/Preferences/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/assets/index.js rename to SDK/Plugins/Preferences/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/index.html b/SDK/Plugins/Preferences/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/index.html rename to SDK/Plugins/Preferences/Panel/index.html diff --git a/SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/manifest.json b/SDK/Plugins/Preferences/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences/manifest.json rename to SDK/Plugins/Preferences/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoPreferencesPlugin/NectoPreferencesPlugin.swift b/SDK/Plugins/Preferences/iOS/NectoPreferencesPlugin.swift similarity index 99% rename from SDK/iOS/Sources/NectoPreferencesPlugin/NectoPreferencesPlugin.swift rename to SDK/Plugins/Preferences/iOS/NectoPreferencesPlugin.swift index 296b481..ccdb8f9 100644 --- a/SDK/iOS/Sources/NectoPreferencesPlugin/NectoPreferencesPlugin.swift +++ b/SDK/Plugins/Preferences/iOS/NectoPreferencesPlugin.swift @@ -24,7 +24,7 @@ public final class NectoPreferencesPlugin: NectoPlugin, @unchecked Sendable { public let id = "preferences" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/preferences") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } /// Named stores this plugin will open, beyond `standard`. An app that keeps its diff --git a/SDK/Android/necto-process-metric-plugin/build.gradle.kts b/SDK/Plugins/ProcessMetric/Android/build.gradle.kts similarity index 100% rename from SDK/Android/necto-process-metric-plugin/build.gradle.kts rename to SDK/Plugins/ProcessMetric/Android/build.gradle.kts diff --git a/SDK/Android/necto-process-metric-plugin/src/main/AndroidManifest.xml b/SDK/Plugins/ProcessMetric/Android/src/main/AndroidManifest.xml similarity index 100% rename from SDK/Android/necto-process-metric-plugin/src/main/AndroidManifest.xml rename to SDK/Plugins/ProcessMetric/Android/src/main/AndroidManifest.xml diff --git a/SDK/Android/necto-process-metric-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidProcessSampler.kt b/SDK/Plugins/ProcessMetric/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidProcessSampler.kt similarity index 100% rename from SDK/Android/necto-process-metric-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidProcessSampler.kt rename to SDK/Plugins/ProcessMetric/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidProcessSampler.kt diff --git a/SDK/Android/necto-process-metric-plugin/src/main/kotlin/im/toss/necto/android/NectoProcessMetricPlugin.kt b/SDK/Plugins/ProcessMetric/Android/src/main/kotlin/im/toss/necto/android/NectoProcessMetricPlugin.kt similarity index 100% rename from SDK/Android/necto-process-metric-plugin/src/main/kotlin/im/toss/necto/android/NectoProcessMetricPlugin.kt rename to SDK/Plugins/ProcessMetric/Android/src/main/kotlin/im/toss/necto/android/NectoProcessMetricPlugin.kt diff --git a/SDK/Android/necto-process-metric-plugin/src/test/kotlin/im/toss/necto/android/NectoAndroidProcessSamplerTest.kt b/SDK/Plugins/ProcessMetric/Android/src/test/kotlin/im/toss/necto/android/NectoAndroidProcessSamplerTest.kt similarity index 100% rename from SDK/Android/necto-process-metric-plugin/src/test/kotlin/im/toss/necto/android/NectoAndroidProcessSamplerTest.kt rename to SDK/Plugins/ProcessMetric/Android/src/test/kotlin/im/toss/necto/android/NectoAndroidProcessSamplerTest.kt diff --git a/SDK/iOS/Sources/NectoProcessMetricPlugin/NectoProcessMetrics.swift b/SDK/Plugins/ProcessMetric/iOS/NectoProcessMetrics.swift similarity index 100% rename from SDK/iOS/Sources/NectoProcessMetricPlugin/NectoProcessMetrics.swift rename to SDK/Plugins/ProcessMetric/iOS/NectoProcessMetrics.swift diff --git a/SDK/Android/necto-ui-control-plugin/build.gradle.kts b/SDK/Plugins/UIControl/Android/build.gradle.kts similarity index 92% rename from SDK/Android/necto-ui-control-plugin/build.gradle.kts rename to SDK/Plugins/UIControl/Android/build.gradle.kts index e915446..22d632c 100644 --- a/SDK/Android/necto-ui-control-plugin/build.gradle.kts +++ b/SDK/Plugins/UIControl/Android/build.gradle.kts @@ -55,10 +55,8 @@ dependencies { } val generatePanelResources by tasks.registering(NectoPanelResources::class) { - panels.from(rootProject.fileTree("../iOS/Sources") { - include("*/Panels/control/manifest.json") - }.files.map { it.parentFile }) - ids.set(listOf("control")) + panel.set(layout.projectDirectory.dir("../Panel")) + id.set("control") manifests.set(layout.projectDirectory.dir("src/main/panel-manifests")) root.set("necto/panels") output.set(layout.buildDirectory.dir("generated/panelResources")) diff --git a/SDK/Android/necto-ui-control-plugin/src/main/AndroidManifest.xml b/SDK/Plugins/UIControl/Android/src/main/AndroidManifest.xml similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/AndroidManifest.xml rename to SDK/Plugins/UIControl/Android/src/main/AndroidManifest.xml diff --git a/SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoActivityTracker.kt b/SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoActivityTracker.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoActivityTracker.kt rename to SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoActivityTracker.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidControlPlugin.kt b/SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidControlPlugin.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidControlPlugin.kt rename to SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidControlPlugin.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidControlRuntime.kt b/SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidControlRuntime.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoAndroidControlRuntime.kt rename to SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoAndroidControlRuntime.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoComposeSemantics.kt b/SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoComposeSemantics.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/android/NectoComposeSemantics.kt rename to SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/android/NectoComposeSemantics.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/plugins/NectoUIControlPlugin.kt b/SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/plugins/NectoUIControlPlugin.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/kotlin/im/toss/necto/plugins/NectoUIControlPlugin.kt rename to SDK/Plugins/UIControl/Android/src/main/kotlin/im/toss/necto/plugins/NectoUIControlPlugin.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/main/panel-manifests/control.json b/SDK/Plugins/UIControl/Android/src/main/panel-manifests/control.json similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/main/panel-manifests/control.json rename to SDK/Plugins/UIControl/Android/src/main/panel-manifests/control.json diff --git a/SDK/Android/necto-ui-control-plugin/src/test/kotlin/im/toss/necto/ControlPluginTests.kt b/SDK/Plugins/UIControl/Android/src/test/kotlin/im/toss/necto/ControlPluginTests.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/test/kotlin/im/toss/necto/ControlPluginTests.kt rename to SDK/Plugins/UIControl/Android/src/test/kotlin/im/toss/necto/ControlPluginTests.kt diff --git a/SDK/Android/necto-ui-control-plugin/src/test/kotlin/im/toss/necto/android/NectoAndroidControlRuntimeTest.kt b/SDK/Plugins/UIControl/Android/src/test/kotlin/im/toss/necto/android/NectoAndroidControlRuntimeTest.kt similarity index 100% rename from SDK/Android/necto-ui-control-plugin/src/test/kotlin/im/toss/necto/android/NectoAndroidControlRuntimeTest.kt rename to SDK/Plugins/UIControl/Android/src/test/kotlin/im/toss/necto/android/NectoAndroidControlRuntimeTest.kt diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/assets/index.css b/SDK/Plugins/UIControl/Panel/assets/index.css similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/assets/index.css rename to SDK/Plugins/UIControl/Panel/assets/index.css diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/assets/index.js b/SDK/Plugins/UIControl/Panel/assets/index.js similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/assets/index.js rename to SDK/Plugins/UIControl/Panel/assets/index.js diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/index.html b/SDK/Plugins/UIControl/Panel/index.html similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/index.html rename to SDK/Plugins/UIControl/Panel/index.html diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/manifest.json b/SDK/Plugins/UIControl/Panel/manifest.json similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/Panels/control/manifest.json rename to SDK/Plugins/UIControl/Panel/manifest.json diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoAccessibilityItem.swift b/SDK/Plugins/UIControl/iOS/NectoAccessibilityItem.swift similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoAccessibilityItem.swift rename to SDK/Plugins/UIControl/iOS/NectoAccessibilityItem.swift diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoAccessibilityReader.swift b/SDK/Plugins/UIControl/iOS/NectoAccessibilityReader.swift similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoAccessibilityReader.swift rename to SDK/Plugins/UIControl/iOS/NectoAccessibilityReader.swift diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoControlGeometry.swift b/SDK/Plugins/UIControl/iOS/NectoControlGeometry.swift similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoControlGeometry.swift rename to SDK/Plugins/UIControl/iOS/NectoControlGeometry.swift diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoControlRuntime.swift b/SDK/Plugins/UIControl/iOS/NectoControlRuntime.swift similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoControlRuntime.swift rename to SDK/Plugins/UIControl/iOS/NectoControlRuntime.swift diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoTouchInjector.swift b/SDK/Plugins/UIControl/iOS/NectoTouchInjector.swift similarity index 100% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoTouchInjector.swift rename to SDK/Plugins/UIControl/iOS/NectoTouchInjector.swift diff --git a/SDK/iOS/Sources/NectoUIControlPlugin/NectoUIControlPlugin.swift b/SDK/Plugins/UIControl/iOS/NectoUIControlPlugin.swift similarity index 99% rename from SDK/iOS/Sources/NectoUIControlPlugin/NectoUIControlPlugin.swift rename to SDK/Plugins/UIControl/iOS/NectoUIControlPlugin.swift index 53b6516..4929218 100644 --- a/SDK/iOS/Sources/NectoUIControlPlugin/NectoUIControlPlugin.swift +++ b/SDK/Plugins/UIControl/iOS/NectoUIControlPlugin.swift @@ -58,7 +58,7 @@ public struct NectoControlTarget: Sendable { /// UIKit support is included; other UI implementations can supply the same contract. public final class NectoUIControlPlugin: NectoPlugin, @unchecked Sendable { public let id = "control" - public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module, subdirectory: "Panels/control") } + public var panel: NectoPluginPanel? { NectoPluginPanel(bundle: .module) } private let actionTargets: @Sendable () async -> [NectoControlTarget] private let readAccessibility: @Sendable () async -> [NectoAccessibilityItem] diff --git a/SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoSessionRecorder.swift b/SDK/Plugins/URLSessionCapture/iOS/NectoSessionRecorder.swift similarity index 100% rename from SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoSessionRecorder.swift rename to SDK/Plugins/URLSessionCapture/iOS/NectoSessionRecorder.swift diff --git a/SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoURLSessionCapture.swift b/SDK/Plugins/URLSessionCapture/iOS/NectoURLSessionCapture.swift similarity index 100% rename from SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoURLSessionCapture.swift rename to SDK/Plugins/URLSessionCapture/iOS/NectoURLSessionCapture.swift diff --git a/SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoURLSessionHooks.swift b/SDK/Plugins/URLSessionCapture/iOS/NectoURLSessionHooks.swift similarity index 100% rename from SDK/iOS/Sources/NectoURLSessionCapturePlugin/NectoURLSessionHooks.swift rename to SDK/Plugins/URLSessionCapture/iOS/NectoURLSessionHooks.swift diff --git a/WebPackages/BuiltInPlugins/src/control/vite.config.ts b/WebPackages/BuiltInPlugins/src/control/vite.config.ts index cee11b6..8767c6c 100644 --- a/WebPackages/BuiltInPlugins/src/control/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/control/vite.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoUIControlPlugin/Panels/control", + outDir: "../../../../SDK/Plugins/UIControl/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/WebPackages/BuiltInPlugins/src/event-log/vite.config.ts b/WebPackages/BuiltInPlugins/src/event-log/vite.config.ts index c4ef2bb..b16fcd1 100644 --- a/WebPackages/BuiltInPlugins/src/event-log/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/event-log/vite.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoEventsPlugin/Panels/event-log", + outDir: "../../../../SDK/Plugins/Events/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/WebPackages/BuiltInPlugins/src/files/vite.config.ts b/WebPackages/BuiltInPlugins/src/files/vite.config.ts index f190327..6dcdd3d 100644 --- a/WebPackages/BuiltInPlugins/src/files/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/files/vite.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoFilesPlugin/Panels/files", + outDir: "../../../../SDK/Plugins/Files/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/WebPackages/BuiltInPlugins/src/network-logger/vite.config.ts b/WebPackages/BuiltInPlugins/src/network-logger/vite.config.ts index 005b634..3e5f437 100644 --- a/WebPackages/BuiltInPlugins/src/network-logger/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/network-logger/vite.config.ts @@ -9,7 +9,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoNetworkPlugin/Panels/network-logger", + outDir: "../../../../SDK/Plugins/Network/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/WebPackages/BuiltInPlugins/src/performance-monitor/vite.config.ts b/WebPackages/BuiltInPlugins/src/performance-monitor/vite.config.ts index 8e7d229..1ca6d97 100644 --- a/WebPackages/BuiltInPlugins/src/performance-monitor/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/performance-monitor/vite.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoPerformancePlugin/Panels/performance-monitor", + outDir: "../../../../SDK/Plugins/Performance/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/WebPackages/BuiltInPlugins/src/preferences/vite.config.ts b/WebPackages/BuiltInPlugins/src/preferences/vite.config.ts index 654d829..f0729f1 100644 --- a/WebPackages/BuiltInPlugins/src/preferences/vite.config.ts +++ b/WebPackages/BuiltInPlugins/src/preferences/vite.config.ts @@ -10,7 +10,7 @@ import { defineConfig } from "vite"; export default defineConfig({ base: "./", build: { - outDir: "../../../../SDK/iOS/Sources/NectoPreferencesPlugin/Panels/preferences", + outDir: "../../../../SDK/Plugins/Preferences/Panel", emptyOutDir: true, rollupOptions: { output: { diff --git a/docs/architecture.md b/docs/architecture.md index 671d4b0..dc68f41 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -125,7 +125,9 @@ See [the trust policy](plugin-manifest.md#identity-and-trust). Libraries are managed as Swift packages, and app targets live in `Necto.xcodeproj`. -The iOS SDK sources and tests live in `SDK/iOS/Sources` and `SDK/iOS/Tests`. +The bridge lives in `SDK/iOS` and `SDK/Android`. Each plugin lives in +`SDK/Plugins/`, with its built panel in `Panel`, its Swift sources in `iOS` and its +Gradle module in `Android`, so both platforms package the same panel. `Package.swift` stays at the repository root so existing Swift package consumers keep the same repository URL. The Mac package continues to reuse `NectoModel` and `NectoTransport` from that package. @@ -137,6 +139,6 @@ tests. It depends on the root product for shared types and transport; the SDK ha dependency on the Mac package or ArgumentParser. Run `script/test swift` to test both packages and the selective-product consumer fixture. -Panels are built by Yarn workspaces into the Swift packages that carry them — -`SDK/iOS/Sources//Panels/` for the defaults, the example app's bundle +Panels are built by Yarn workspaces into the plugins that carry them — +`SDK/Plugins//Panel` for the defaults, the example app's bundle for the sample — and committed so that building the app alone needs no Node. diff --git a/docs/ko/architecture.md b/docs/ko/architecture.md index 91ec208..e79aaee 100644 --- a/docs/ko/architecture.md +++ b/docs/ko/architecture.md @@ -120,7 +120,9 @@ hello의 프로토콜 버전이 다르면 협상 없이 연결을 거부해요. 라이브러리는 Swift 패키지로, 앱 타깃은 `Necto.xcodeproj`로 관리해요. -iOS SDK 소스와 테스트는 `SDK/iOS/Sources`와 `SDK/iOS/Tests`에 있어요. +브리지는 `SDK/iOS`와 `SDK/Android`에 있어요. 플러그인은 `SDK/Plugins/`에 +있고, 빌드된 패널은 `Panel`, Swift 소스는 `iOS`, Gradle 모듈은 `Android`에 둬요. +두 플랫폼이 같은 패널을 패키징해요. `Package.swift`는 저장소 루트에 유지하므로 기존 Swift 패키지 사용자는 같은 저장소 URL을 사용할 수 있어요. Mac 패키지도 이 패키지의 `NectoModel`과 `NectoTransport`를 계속 재사용해요. @@ -133,6 +135,6 @@ iOS SDK 소스와 테스트는 `SDK/iOS/Sources`와 `SDK/iOS/Tests`에 있어요 Mac 패키지나 ArgumentParser에 의존하지 않아요. `script/test swift`는 두 패키지와 개별 product를 사용하는 외부 패키지 예제를 테스트해요. -패널은 Yarn workspaces로 빌드해 Swift 패키지에 포함해요. 기본 플러그인은 -`SDK/iOS/Sources//Panels/`에, 샘플은 예제 앱 번들에 들어가요. +패널은 Yarn workspaces로 빌드해 플러그인에 포함해요. 기본 플러그인은 +`SDK/Plugins//Panel`에, 샘플은 예제 앱 번들에 들어가요. 빌드 결과를 커밋하므로 앱만 빌드할 때는 Node가 필요 없어요. diff --git a/docs/verification.md b/docs/verification.md index 164a456..656b5a9 100644 --- a/docs/verification.md +++ b/docs/verification.md @@ -166,7 +166,7 @@ until Ctrl-C. While it runs, from another terminal: | --- | --- | | `script/test-android-sample` | Every shipped panel's operations through `necto-cli`, a stream cancelled and resubscribed, invalid input, then a force stop that removes the target and a relaunch that brings it back | | `script/test-android-security` | Malformed peers on the private socket: a silent handshake, frames outside the limits, deep nesting, a stalled frame, too many requests. Each is dropped and the next connection works | -| `script/test-android-artifacts` | No SDK AAR declares a permission, each plugin module carries only its own panel, the packaged panels equal the iOS ones, and only the debug sample is debuggable. Needs a full Gradle build, not a running app | +| `script/test-android-artifacts` | No SDK AAR declares a permission, each plugin module carries only its own panel, the packaged panels equal the built ones, and only the debug sample is debuggable. Needs a full Gradle build, not a running app | | `script/test-android-consumer` | Five independent minified apps built from the published Maven artifacts resolve only the modules they select and package only those panels. `--jitpack ` checks JitPack's artifacts instead of a local publication. Needs no running app | ## Verifying a plugin diff --git a/script/check-panel-assets.mjs b/script/check-panel-assets.mjs index a342a64..b2626f2 100644 --- a/script/check-panel-assets.mjs +++ b/script/check-panel-assets.mjs @@ -7,13 +7,12 @@ import { dirname, resolve } from "node:path"; const root = resolve(import.meta.dirname, ".."); const panelRoots = []; -for (const entry of await readdir(resolve(root, "SDK/iOS/Sources"), { withFileTypes: true })) { +for (const entry of await readdir(resolve(root, "SDK/Plugins"), { withFileTypes: true })) { if (!entry.isDirectory()) continue; - const panelRoot = resolve(root, "SDK/iOS/Sources", entry.name, "Panels"); - let panels; - try { panels = await readdir(panelRoot, { withFileTypes: true }); } + const panelRoot = resolve(root, "SDK/Plugins", entry.name, "Panel"); + try { await access(panelRoot); } catch (error) { if (error.code === "ENOENT") continue; throw error; } - panelRoots.push(...panels.filter(entry => entry.isDirectory()).map(entry => resolve(panelRoot, entry.name))); + panelRoots.push(panelRoot); } panelRoots.push(resolve(root, "WebPackages/BuiltInPlugins/Plugins/plugin-sample")); panelRoots.push(resolve(root, "WebPackages/BuiltInPlugins/Plugins/shell-demo")); diff --git a/script/test-android-artifacts b/script/test-android-artifacts index 9b17b40..1799ba3 100755 --- a/script/test-android-artifacts +++ b/script/test-android-artifacts @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """Verify what the Android build ships: the SDK asks for no permissions, carries the -iOS panels unchanged, and the sample is debuggable in debug builds only.""" +built panels unchanged, and the sample is debuggable in debug builds only.""" import argparse import json import io @@ -26,18 +26,35 @@ plugins = { "necto-performance-plugin": "performance-monitor", "necto-datastore-preferences-plugin": "preferences", } +# A plugin module lives in SDK/Plugins//Android, beside the panel it packages. +folders = { + "necto-events-plugin": "Events", + "necto-network-plugin": "Network", + "necto-okhttp-capture-plugin": "OkHttpCapture", + "necto-files-plugin": "Files", + "necto-performance-plugin": "Performance", + "necto-process-metric-plugin": "ProcessMetric", + "necto-ui-control-plugin": "UIControl", + "necto-datastore-preferences-plugin": "Preferences", +} + + +def directory(module): + return root / "SDK/Plugins" / folders[module] / "Android" if module in folders else android / module + + android_modules = {"necto-android", "necto-files-plugin", "necto-ui-control-plugin", "necto-process-metric-plugin", "necto-datastore-preferences-plugin"} modules = ["necto-core", "necto-plugin-support", "necto-android", "necto-okhttp-capture-plugin", "necto-process-metric-plugin", *plugins] compared = 0 for module in modules: if module in android_modules: - artifact = android / f"{module}/build/outputs/aar/{module}-release.aar" + artifact = directory(module) / f"build/outputs/aar/{module}-release.aar" with zipfile.ZipFile(artifact) as aar: assert "uses-permission" not in aar.read("AndroidManifest.xml").decode(), module contents = aar.read("classes.jar") archive = zipfile.ZipFile(io.BytesIO(contents)) else: - artifact = next(path for path in (android / module / "build/libs").glob(f"{module}-[0-9]*.jar") + artifact = next(path for path in (directory(module) / "build/libs").glob(f"{module}-[0-9]*.jar") if not path.name.endswith(("-sources.jar", "-test-fixtures.jar"))) archive = zipfile.ZipFile(artifact) with archive: @@ -47,8 +64,8 @@ for module in modules: if module == "necto-core": assert not any(name.startswith("im/toss/necto/plugins/") for name in archive.namelist()) if expected_id: - panel = next((root / "SDK/iOS/Sources").glob(f"*/Panels/{expected_id}/manifest.json")).parent - override = android / module / f"src/main/panel-manifests/{expected_id}.json" + panel = directory(module).parent / "Panel" + override = directory(module) / f"src/main/panel-manifests/{expected_id}.json" for file in sorted(path for path in panel.rglob("*") if path.is_file()): relative = file.relative_to(panel).as_posix() expected = override.read_bytes() if relative == "manifest.json" and override.exists() else file.read_bytes()