Skip to content

Commit

Permalink
Import wip IntelliJ plugin module (#4615)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoD authored Jan 12, 2023
1 parent eec61e7 commit d173f5e
Show file tree
Hide file tree
Showing 104 changed files with 3,744 additions and 34 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: macos-11
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: '11'
- uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- run: |
ulimit -c unlimited
# Workaround an issue where kotlinNpmInstall outputs
Expand All @@ -31,7 +31,7 @@ jobs:
./gradlew -p benchmark assembleRelease assembleReleaseAndroidTest
# Step can be removed if/when gcloud is added to the macos image - See https://github.com/actions/virtual-environments/issues/4639
- name: Setup gcloud
uses: google-github-actions/setup-gcloud@877d4953d2c70a0ba7ef3290ae968eb24af233bb #v0.6.0
uses: google-github-actions/setup-gcloud@d51b5346f85640ec2aa2fa057354d2b82c2fcbce #v1.0.1
- name: microbenchmarks
uses: martinbonnin/run-benchmarks@ef9043b9a646a109f7381a4bf20f82ead5cbd382 #main
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/defer-with-router-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- name: Checkout project
uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0

- name: Install and run subgraph
working-directory: tests/defer/router/subgraphs/computers
Expand All @@ -27,13 +27,13 @@ jobs:
./router --supergraph tests/defer/router/simple-supergraph.graphqls &
- name: Setup Java
uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11

- name: Setup Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3

- name: Run Apollo Kotlin @defer tests
env:
Expand Down
118 changes: 106 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
tests-gradle:
runs-on: macos-11
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11
- uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- name: Build with Gradle
run: |
ulimit -c unlimited
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 #v3
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-gradle.zip
Expand All @@ -41,12 +41,12 @@ jobs:
tests-no-gradle:
runs-on: macos-11
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11
- uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- name: Build with Gradle
run: |
ulimit -c unlimited
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 #v3
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-no-gradle.zip
Expand All @@ -67,12 +67,12 @@ jobs:
tests-integration:
runs-on: macos-11
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11
- uses: gradle/gradle-build-action@aab26ac684526c7cb10f96e3c3734bbc51749736 #v2
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- name: Build with Gradle
run: |
ulimit -c unlimited
Expand All @@ -84,8 +84,102 @@ jobs:
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 #v3
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: tests-integration.zip
path: diagnostics.zip

intellij-plugin:
name: Build IntelliJ Plugin
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0

# Setup Java 11 environment for the next steps
- name: Setup Java
uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew :intellij-plugin:properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew :intellij-plugin:getChangelog --unreleased --no-header --console=plain -q)"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=changelog::$CHANGELOG"
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
./gradlew :intellij-plugin:listProductsReleases # prepare list of IDEs for Plugin Verifier
# Run tests
- name: Run Tests
run: ./gradlew :intellij-plugin:check

# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: tests-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/tests

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 #v3.2.3
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('intellij-plugin/build/listProductsReleases.txt') }}

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
run: ./gradlew :intellij-plugin:runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}

# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/intellij-plugin/build/reports/pluginVerifier

# Prepare plugin archive content for creating artifact
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
cd ${{ github.workspace }}/intellij-plugin/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "::set-output name=filename::${FILENAME:0:-4}"
# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./intellij-plugin/build/distributions/content/*/*
10 changes: 5 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: macos-11
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: '11'
- uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- name: Build with Gradle
run: |
ulimit -c unlimited
Expand All @@ -37,13 +37,13 @@ jobs:
- name: Collect Diagnostics
if: always()
run: ./scripts/collect-diagnostics.main.kts
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 #v3
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: always()
with:
name: push.zip
path: push.zip
- name: Deploy Kdoc to github pages
uses: JamesIves/github-pages-deploy-action@830e6a4f7c81743c52f3fed0ac67428feff9620a #v4.2.5
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6 #v4.4.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/dokkaHtml # The folder the action should deploy.
28 changes: 23 additions & 5 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ on:
- '*'

jobs:
publish:
publish-libraries:
name: Publish libraries
runs-on: macos-11
if: github.repository == 'apollographql/apollo-kotlin'
steps:
- uses: actions/checkout@d0651293c4a5a52e711f25b41b05b2212f385d28 #v3
- uses: actions/setup-java@2c7a4878f5d120bd643426d54ae1209b29cc01a3 #v3
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11
- uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee #v2.1.4
- name: Build with Gradle
- uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef #v2.3.3
- name: Publish to Maven Central
run: |
./gradlew --no-build-cache ciPublishRelease -Pgradle.publish.key="${{ secrets.GRADLE_PUBLISH_KEY }}" -Pgradle.publish.secret="${{ secrets.GRADLE_PUBLISH_SECRET }}"
env:
Expand All @@ -25,3 +26,20 @@ jobs:
COM_APOLLOGRAPHQL_PROFILE_ID: ${{ secrets.COM_APOLLOGRAPHQL_PROFILE_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}

publish-intellij-plugin:
name: Publish IntelliJ plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0
- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b #v3.9.0
with:
distribution: 'temurin'
java-version: 11
- name: Publish to JetBrains marketplace
run: ./gradlew --no-build-cache :intellij-plugin:publishPlugin
env:
PUBLISH_TOKEN: ${{ secrets.IJ_PLUGIN_PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.IJ_PLUGIN_CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.IJ_PLUGIN_PRIVATE_KEY_PASSWORD }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ package-lock.json
.sqldelight

# Local Netlify folder
.netlify
.netlify

# IntelliJ plugin
intellij-plugin/mockJDK
29 changes: 29 additions & 0 deletions .idea/runConfigurations/Run_IntelliJ_plugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Please note that we will not accept pull requests for style changes.
Apollo Kotlin observes [semantic versioning](https://semver.org/). Between major releases, breaking changes are not
allowed and any public API change will fail the build.

If that happens, you will need to run `./gradlew apiDump` and check for any incompatible changes before commiting these
If that happens, you will need to run `./gradlew apiDump` and check for any incompatible changes before committing these
files.

## Deprecation
Expand Down Expand Up @@ -251,6 +251,8 @@ following events:
- All apiCheck
- `tests-integration`
- All integration tests (except Java 9+ ones)
- `intellij-plugin`
- IntelliJ plugin build and tests

### On pushes to `main` branch

Expand All @@ -271,5 +273,7 @@ following events:

**Job:**

- `publish`
- Publish to Maven Central
- `publish-libraries`
- Publish libraries to Maven Central
- `publish-intellij-plugin`
- Publish IntelliJ plugin to Jetbrains Marketplace
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ configure<kotlinx.validation.ApiValidationExtension> {
"apollo-normalized-cache-api-incubating",
"apollo-normalized-cache-incubating",
"apollo-normalized-cache-sqlite-incubating",
"intellij-plugin",
)
)
nonPublicMarkers.addAll(
Expand All @@ -158,4 +159,4 @@ tasks.register("rmbuild") {
}
}.count()
}
}
}
9 changes: 9 additions & 0 deletions gradle/repositories.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ listOf(pluginManagement.repositories, dependencyResolutionManagement.repositorie
includeModule("com.github.ben-manes", "gradle-versions-plugin")
// Because we use 1.6.10 during sync and this version is not on mavenCentral
includeVersion("org.jetbrains.kotlin.plugin.serialization", "org.jetbrains.kotlin.plugin.serialization.gradle.plugin", "1.6.10")

// For org.jetbrains.intellij
includeModule("org.jetbrains.intellij", "org.jetbrains.intellij.gradle.plugin")
includeModule("org.jetbrains.intellij.plugins", "gradle-intellij-plugin")
includeModule("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext", "gradle-idea-ext")

// For org.jetbrains.changelog
includeModule("org.jetbrains.changelog", "org.jetbrains.changelog.gradle.plugin")
includeModule("org.jetbrains.intellij.plugins", "gradle-changelog-plugin")
}
}

Expand Down
Loading

0 comments on commit d173f5e

Please sign in to comment.