From 08b5ee85fb867f2aeaf2d2fd65718da17ed6906b Mon Sep 17 00:00:00 2001 From: Mitchell Herrijgers Date: Fri, 25 Feb 2022 14:08:42 +0100 Subject: [PATCH] Automatic releasing (#25) --- .github/dependabot.yml | 35 ++++++++++++------- .github/workflows/pluginverifier.yml | 30 ---------------- .github/workflows/publish.yml | 32 +++++++++++++++++ .github/workflows/test.yml | 30 ++++++++++++++++ CHANGELOG.md | 1 + README.md | 32 ++++++++++++----- build.gradle.kts | 27 +++++++++++++- gradle.properties | 2 +- .../aggregate/JavaAggregateIdInspection.kt | 4 +-- src/main/resources/META-INF/plugin.xml | 20 ----------- 10 files changed, 138 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/pluginverifier.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 03023e2d..7a5bc950 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,14 +1,25 @@ version: 2 updates: - - package-ecosystem: gradle - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 - # Specify labels for pull requests - labels: - - "Type: Dependency Upgrade" - - "Priority 1: Must" - # Add reviewers - reviewers: - - "Morlack" + - package-ecosystem: gradle + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + # Specify labels for pull requests + labels: + - "Type: Dependency Upgrade" + - "Priority 1: Must" + # Add reviewers + reviewers: + - "Morlack" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" + labels: + - "Type: Dependency Upgrade" + - "Priority 1: Must" + # Add reviewers + reviewers: + - "Morlack" diff --git a/.github/workflows/pluginverifier.yml b/.github/workflows/pluginverifier.yml deleted file mode 100644 index 0ce9006d..00000000 --- a/.github/workflows/pluginverifier.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Plugin Verifier - -on: - workflow_dispatch: - pull_request: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b - - name: Build plugin - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: build - - name: Verify plugin - uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 - with: - arguments: runPluginVerifier diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..a6ab8905 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish + +on: + workflow_dispatch: + push: + tags: + - "v*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'zulu' + + - name: Verify plugin + uses: gradle/gradle-build-action@v1 + with: + arguments: runPluginVerifier + + - name: Publish plugin + uses: gradle/gradle-build-action@v1 + with: + arguments: publishPlugin + env: # Or as an environment variable + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} + PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} + CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..970c4f45 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: Test + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'zulu' + + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Verify plugin + uses: gradle/gradle-build-action@v1 + with: + arguments: runPluginVerifier +concurrency: + group: ${{github.workflow}}-${{github.head_ref || github.run_id }} + cancel-in-progress: true diff --git a/CHANGELOG.md b/CHANGELOG.md index e99b89d9..f9c3232c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Fixed - Fix popup on deadline manager methods when there are qualified references as arguments. Fixes #16 +- Fix empty inspection description in inspection window. Fixes #21 - The correct icon is now shown for publishers in line marker popup. Fixes #18 ### Changed diff --git a/README.md b/README.md index 7f3696c5..b8c86cb7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ Axon Framework IntelliJ Plugin =================================== + +Supports developers while writing applications using [Axon Framework](https://axoniq.io/product-overview/axon-framework) version 4.x. -Supports developers while writing applications using [Axon Framework](https://axoniq.io/). - -Axon Framework helps build scalable, extensible and maintainable applications by supporting developers apply the Command Query -Responsibility Separation (CQRS) architectural pattern. +Axon Framework helps build scalable, extensible, and maintainable applications by supporting developers to apply Domain-Driven Design (DDD), +Command-Query Responsibility Separation (CQRS), and Event Sourcing (ES). The framework provides a message-driven architecture with dedicated +command, event, and query messages, to support these paradigms. The plugin provides the following features: @@ -13,9 +14,11 @@ The plugin provides the following features: - Marks methods used by Axon Framework as used, such as annotated methods - Easy access to the reference guide (ctrl+shift+a and type axon) -If you have a feature request, or want to report a bug, please report this at -our [Github issue tracker](https://github.com/AxonFramework/IdeaPlugin/issues). For questions on Axon Framework usage, or about the plugin, -please visit our [Discuss](https://discuss.axoniq.io/) +If you have a feature request or want to report a bug, please report this at +our [Github issue tracker](https://github.com/AxonFramework/IdeaPlugin/issues). + +For questions on Axon Framework usage, or about the plugin, please visit our [Discuss](https://discuss.axoniq.io/). + ## Usage @@ -29,7 +32,18 @@ annotations it recognizes. You can click on the icons on the left of the sourcec ## Local development -You can run an IntelliJ instance with the plugin locally with `./gradlew runIde`. This will bootstrap a clean instance -and load the plugin. While the instance is running, you can run `./gradlew buildPlugin` for a hot reload of the plugin. +You can run an IntelliJ instance with the plugin locally with `./gradlew runIde`. This will bootstrap a clean instance and load the plugin. +While the instance is running, you can run `./gradlew buildPlugin` for a hot reload of the plugin. To check compatibility with the most common IntelliJ versions run `./gradlew runPluginVerifier`. + +## Development process + +- Features are developed on branches +- The pull request should contain a changelog entry added to the "Unreleased" section +- When ready for release, `CHANGELOG.md` and `gradle.properties` are updated with the new version +- A tag is created with name `vx.x.x` on that commit and pushed. Github Actions will automatically publish that version + +There are no minor release branches, since we don't need patch versions on older versions of the plugin. Users will always update to the +latest version and will ignore earlier patches, so the `master` branch is leading. + diff --git a/build.gradle.kts b/build.gradle.kts index 096d4994..5919aec5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2022. Axon Framework + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.jetbrains.changelog.markdownToHTML import org.jetbrains.kotlin.gradle.tasks.KotlinCompile fun properties(key: String) = project.findProperty(key).toString() @@ -70,7 +87,15 @@ tasks { // Extract the section from README.md and provide for the plugin's manifest pluginDescription.set( - "" + projectDir.resolve("README.md").readText().lines().run { + val start = "" + val end = "" + + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)) + }.joinToString("\n").run { markdownToHTML(this) } ) // Get the latest available change notes from the changelog file diff --git a/gradle.properties b/gradle.properties index d417fd71..cfc9fd7d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ pluginGroup=io.axoniq.ide.intellij pluginName=Axon Framework -pluginVersion=0.5.0 +pluginVersion=0.5.1 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. diff --git a/src/main/kotlin/org/axonframework/intellij/ide/plugin/inspections/aggregate/JavaAggregateIdInspection.kt b/src/main/kotlin/org/axonframework/intellij/ide/plugin/inspections/aggregate/JavaAggregateIdInspection.kt index 7c53501b..5ec94c68 100644 --- a/src/main/kotlin/org/axonframework/intellij/ide/plugin/inspections/aggregate/JavaAggregateIdInspection.kt +++ b/src/main/kotlin/org/axonframework/intellij/ide/plugin/inspections/aggregate/JavaAggregateIdInspection.kt @@ -37,7 +37,7 @@ class JavaAggregateIdInspection : AbstractBaseJavaLocalInspectionTool() { isOnTheFly: Boolean ): Array? { if (!aClass.isAggregate()) { - return emptyArray() + return null } val isMissingFieldWithAnnotation = aClass.fields.none { field -> field.isAnnotated(AxonAnnotation.ENTITY_ID) } if (isMissingFieldWithAnnotation) { @@ -51,7 +51,7 @@ class JavaAggregateIdInspection : AbstractBaseJavaLocalInspectionTool() { ) ) } - return emptyArray() + return null } override fun getStaticDescription(): String { diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index a6775b98..6a6fb8c0 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -20,26 +20,6 @@ ${project.version} AxonIQ - - Axon Framework version 4.x.

- - Axon Framework helps build scalable, extensible, and maintainable applications by supporting developers to apply Domain-Driven Design (DDD), Command-Query Responsibility Separation (CQRS), - and Event Sourcing (ES). The framework provides a message-driven architecture with dedicated command, event, and query messages, to support these paradigms.

- - The plugin provides the following features: -
    -
  • Line markers to visualize commands, events, queries and deadlines
  • -
  • Several inspections on code structure that is required for Axon Framework
  • -
  • Marks methods used by Axon Framework as used, such as annotated methods
  • -
  • Easy access to the reference guide (ctrl+shift+a and type axon) -
- - If you have a feature request or want to report a bug, please report this at our Github issue tracker.
- For questions on Axon Framework usage, or about the plugin, please visit our Discuss. - ]]> -
- com.intellij.modules.platform com.intellij.modules.java org.jetbrains.kotlin