How hsz/intellij-platform-plugin-oauth2-flow works
Project type and purpose
• This is an IntelliJ Platform Plugin (Kotlin/Gradle) template scaffolding an OAuth2 flow integration.
• It consists of IDE extension points, service classes, UI tool-window factories, resources (plugin.xml), and CI/CD workflows for build, test, and release.
File structure
Top-level:
• .github/workflows/ → CI jobs: build, run UI tests, release
• build.gradle.kts + gradle/ → build configuration, dependency versions
• src/main/kotlin/com/github/hsz/intellijplatformpluginoauth2flow/
– MyBundle.kt (i18n)
– services/MyProjectService.kt (Project-level service)
– startup/MyProjectActivity.kt (Project startup hook)
– toolWindow/MyToolWindowFactory.kt (Tool window factory/ UI)
• src/main/resources/META-INF/plugin.xml → plugin metadata, extension-point declarations
• src/test/ → unit/integration tests + testData
README for additional insights
• Confirms this is a template based on JetBrains’ IntelliJ Platform Plugin Template.
a. Main components
1. IntelliJ IDE Host (Platform)
2. Plugin Module
– plugin.xml (metadata + extension declarations)
– MyProjectActivity (startup extension)
– MyProjectService (service extension)
– MyToolWindowFactory (tool-window UI extension)
– MyBundle (message bundle for i18n)
3. Gradle Build System & CI/CD
– Gradle (build, package, publish)
– GitHub Actions (build, UI tests, release)
b. Relationships & data flow
1. Startup: IntelliJ loads plugin.xml → instantiates MyProjectActivity on project open
2. Service lookup: MyProjectActivity or UI fetches MyProjectService via ServiceManager
3. UI: MyToolWindowFactory registers a tool window; user actions invoke services/activities
4. Build pipeline: developer commit → GitHub Actions → Gradle build → run UI tests → publish artifact
c. Architectural patterns & principles
– Extension-Point Pattern: plugin.xml declares hooks into the host platform
– Factory Pattern: ToolWindowFactory creates UI components on demand
– Service Locator Pattern: ProjectService retrieved via IntelliJ’s ServiceManager
– Separation of Concerns: startup logic vs. service logic vs. UI logic
d. Key technologies & frameworks
– Kotlin & IntelliJ Platform SDK
– Gradle Kotlin DSL & Version Catalog
– GitHub Actions for CI/CD
– Qodana for static code analysis