Skip to content

Commit

Permalink
Add IntelliJ Plugin related files
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ralph committed Oct 7, 2024
1 parent ddacdd2 commit e3c758a
Show file tree
Hide file tree
Showing 78 changed files with 2,790 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-intellij-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish IntelliJ plugin to Jetbrains Marketplace

on:
workflow_dispatch:
inputs:
cond_release:
required: true
description: 'Type "release" to release artifacts to Jetbrains Marketplace.'

jobs:
deploy:
runs-on: ubuntu-latest
environment: deploy
steps:
- name: Fetch Sources
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.INTELLIJ_PLUGIN_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.INTELLIJ_PLUGIN_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.INTELLIJ_PLUGIN_PRIVATE_KEY_PASSWORD }}
run: |
cd intellij-plugin
./gradlew :publishPlugin
78 changes: 78 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,27 @@ name: Run tests on a pull request
on: pull_request

jobs:
detect-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
gradle-plugin: ${{ steps.filter.outputs.gradle-plugin }}
intellij-plugin: ${{ steps.filter.outputs.intellij-plugin }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
gradle-plugin:
- '!intellij-plugin/**'
intellij-plugin:
- 'intellij-plugin/**'
- 'qodana.yml'
build-gradle-plugin:
needs: detect-changes
if: ${{ needs.changes.outputs.gradle-plugin == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
Expand Down Expand Up @@ -38,3 +58,61 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JOB_STATUS: ${{ job.status }}
run: bundle exec danger --remove-previous-comments --fail-on-errors=true

build-intellij-plugin:
needs: detect-changes
if: ${{ needs.changes.outputs.intellij-plugin == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false

- name: Fetch Sources
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v4
with:
path: ~/.pluginVerifier/ides
key: plugin-verifier-${{ hashFiles('intellij-plugin/build/listProductsReleases.txt') }}

- name: Run Tests
run: |
cd intellij-plugin
./gradlew :check verifyPlugin -Dplugin.verifier.home.dir=~/.pluginVerifier/ides
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/tests

- name: Collect Kover Report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: kover-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/kover/report.xml

- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/pluginVerifier
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ presenter.show()
FeatureFlag.FLAG_5 = false
```

## IntelliJ Plugin

We also provide [FeatureFlag Android Support](https://plugins.jetbrains.com/plugin/MARKETPLACE_ID), an IDE Plugin to support this `FEATURE_FLAG` file in IntelliJ IDEs including Android Studio.

See [here](intellij-plugin/README.md) for an overview and installation instructions.

## How to contribute

See [CONTRIBUTING.md](CONTRIBUTING.md).
Expand Down
5 changes: 5 additions & 0 deletions intellij-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gradle
.idea
.intellijPlatform
.qodana
build
25 changes: 25 additions & 0 deletions intellij-plugin/.run/Run Plugin.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="IDE logs" path="$PROJECT_DIR$/build/idea-sandbox/*/log/idea.log" show_all="true" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions intellij-plugin/.run/Run Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Tests" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="check" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions intellij-plugin/.run/Run Verifications.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Verifications" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="verifyPlugin" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
14 changes: 14 additions & 0 deletions intellij-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Keep a Changelog guide -> https://keepachangelog.com -->

# feature-flag-android-intellij-plugin Changelog

## [Unreleased]

## [1.0.0]

### Added

- Initial release of Feature Flag Android IntelliJ plugin

[Unreleased]: https://github.com/line/feature-flag-android/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/line/feature-flag-android/commits/v1.0.0
35 changes: 35 additions & 0 deletions intellij-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# feature-flag-android-intellij-plugin

## Overview

<!-- Plugin description -->
This plugin provides high-level functionality in the IntelliJ IDE for the FeatureFlag definition
files you create when using [feature-flag-android](https://github.com/line/feature-flag-android) a
plugin for developing Android applications using FeatureFlag.

Available features:

- Syntax highlighting in the FeatureFlag file
- Gutter icons in Java/Kotlin code to jump to FeatureFlag definition
- Showing flag's documentation on Java/Kotlin code

<!-- Plugin description end -->

Please refer to the [README](../README.md) in the root folder for a description of the FeatureFlag
itself, the license, and contribution
guide, etc.

### Installation

- Using the IDE built-in plugin system:

<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>Marketplace</kbd> > <kbd>Search for "
FeatureFlag Android Support"</kbd> >
<kbd>Install</kbd>

- Manually:

Download the [latest release](https://github.com/line/feature-flag-android/releases/latest) and
install it manually using
<kbd>Settings/Preferences</kbd> > <kbd>Plugins</kbd> > <kbd>⚙️</kbd> > <kbd>Install plugin from
disk...</kbd>
Loading

0 comments on commit e3c758a

Please sign in to comment.