Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 7 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'

- name: Prepare Build Environment
uses: ./.github/workflows/prepare-build-environment

- uses: actions/cache@v4
with:
path: |
Expand All @@ -24,33 +24,19 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-Build-${{ hashFiles('gradlew.bat', 'src/dotnet/*/*.csproj', 'src/dotnet/*.props', 'gradle-wrapper.properties') }}

- run: ./gradlew :protocol:rdgen --no-daemon
- run: ./gradlew :buildPlugin -PBuildConfiguration=Release --no-daemon

- uses: mad9000/actions-find-and-replace-string@5
id: fix_branch_name
with:
source: ${{ github.ref_name }}
find: '/'
replace: '-'

- uses: actions/upload-artifact@v4
if: github.ref_name == 'master' || github.ref_name == 'dev'
with:
name: odata-cli-ui.${{ steps.fix_branch_name.outputs.value }}-${{ github.run_number }}
path: output
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: |
build/gradle-jvm
packages
~/.nuget/packages
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-Test-${{ hashFiles('gradlew.bat', 'src/dotnet/*/*.csproj', 'src/dotnet/*.props', 'gradle-wrapper.properties') }}
- run: ./gradlew :protocol:rdgen --no-daemon
- run: ./gradlew :testDotNet --no-daemon
10 changes: 6 additions & 4 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,25 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'

- name: Prepare Build Environment
uses: ./.github/workflows/prepare-build-environment

- run: ./gradlew :protocol:rdgen
- run: ./gradlew :buildPlugin -PBuildConfiguration=Release
- run: ./gradlew :signPlugin -PBuildConfiguration=Release
env:
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}

- uses: mad9000/actions-find-and-replace-string@5
id: fix_branch_name
with:
source: ${{ github.ref_name }}
find: 'release/'
replace: ''

- uses: actions/upload-artifact@v4
with:
name: odata-cli-ui.${{ steps.fix_branch_name.outputs.value }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/prepare-build-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "prepare-build-environment"
description: "Prepare build environment"
runs:
using: "composite"
steps:
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.1]
- Added scroll to dialog
- Improved validation

## [1.2.0]
- Added missing odata-cli options
- Fixed tabs validation
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

| Plugin version | odata-cli version |
|----------------|-------------------|
| 1.2.1 | 0.3.1, 0.3.0 |
| 1.2.0 | 0.3.1, 0.3.0 |
| 1.1.0 | 0.3.1, 0.3.0 |
| 1.0.1 | 0.2.1 |
Expand Down
3 changes: 1 addition & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ val DotnetSolution: String by project
val BuildConfiguration: String by project
val ProductVersion: String by project
val DotnetPluginId: String by project
val RiderPluginId: String by project
val PublishToken: String by project

allprojects {
Expand Down Expand Up @@ -73,7 +72,7 @@ tasks.compileJava {
}

tasks.compileKotlin {
compilerOptions { jvmTarget= JvmTarget.JVM_21 }
compilerOptions { jvmTarget = JvmTarget.JVM_21 }
}

intellijPlatform {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DotnetPluginId=ReSharperPlugin.ODataCliUi
DotnetSolution=ReSharperPlugin.ODataCliUi.sln
RiderPluginId=ru.ellizio.odatacliui
PluginVersion=1.2.0-2025.2
PluginVersion=1.2.1-2025.2

BuildConfiguration=Debug

Expand Down
11 changes: 8 additions & 3 deletions src/rider/main/kotlin/ru/ellizio/odatacliui/dialogs/CliDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import ru.ellizio.odatacliui.Constants
import ru.ellizio.odatacliui.UiBundle
import ru.ellizio.odatacliui.extensions.emptyText
import ru.ellizio.odatacliui.extensions.humanize
import ru.ellizio.odatacliui.extensions.scrollablePanel
import ru.ellizio.odatacliui.models.CliDialogModel
import ru.ellizio.odatacliui.models.validators.CliDialogValidators
import ru.ellizio.odatacliui.ui.ScrollableDialogPanel
import javax.swing.JComponent

class CliDialog(private val model: CliDialogModel) : BaseDialog(false) {
Expand All @@ -18,6 +20,7 @@ class CliDialog(private val model: CliDialogModel) : BaseDialog(false) {

init {
title = Constants.PLUGIN_NAME
isResizable = false
setOKActionEnabled(true)
init()
}
Expand Down Expand Up @@ -80,13 +83,15 @@ class CliDialog(private val model: CliDialogModel) : BaseDialog(false) {
}
}

private fun buildGenerationArgumentsTab(): DialogPanel = panel {
private fun buildGenerationArgumentsTab(): ScrollableDialogPanel = scrollablePanel {
row("--file-name") {
textField()
.align(AlignX.FILL)
.emptyText(UiBundle.text("cli.filename.empty-text"))
.comment(UiBundle.text("cli.filename.comment"))
.bindText(model.fileName)
.validationOnInput(CliDialogValidators.fileNameValidator())
.validationOnApply(CliDialogValidators.fileNameValidator())
}
row("--namespace-prefix") {
textField()
Expand Down Expand Up @@ -154,8 +159,8 @@ class CliDialog(private val model: CliDialogModel) : BaseDialog(false) {
.bindSelected(model.upperCamelCase)
}
}.apply {
registerPanelValidators(this)
generationTabPanel = this
registerPanelValidators(this.panel)
generationTabPanel = this.panel
}

private fun buildRequestArgumentsTab(): DialogPanel = panel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@ package ru.ellizio.odatacliui.extensions

import com.intellij.ui.components.JBTextField
import com.intellij.ui.dsl.builder.Cell
import com.intellij.ui.dsl.builder.Panel
import com.intellij.ui.dsl.builder.panel
import ru.ellizio.odatacliui.ui.ScrollableDialogPanel

fun Cell<JBTextField>.emptyText(text: String): Cell<JBTextField> {
component.emptyText.text = text
return this
}

fun scrollablePanel(init: Panel.() -> Unit): ScrollableDialogPanel {
val content = panel(init)
return ScrollableDialogPanel(content).apply {
border = null
isOverlappingScrollBar = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CliDialogModel(project: Project, private val actionMetadata: ActionMetadat
fun buildODataCliCommand(): GeneralCommandLine = CommandLineBuilder(DotnetToolsUtils.getToolDefaultPath("odata-cli"), "generate")
.withParameter("--metadata-uri", metadataUri.get())
.withParameter("--service-name", serviceName.get(), atLeast031)
.withParameter("--file-name", fileName.get())
.withParameter("--file-name", fileName.get().removeSuffix(".cs"))
.withParameter("--custom-headers", customHeaders.get())
.withParameter("--proxy", proxy.get())
.withParameter("--namespace-prefix", namespacePrefix.get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ object CliDialogValidators {
null
}

fun fileNameValidator(): ValidationInfoBuilder.(JTextField) -> ValidationInfo? = {
if (it.text.isNotEmpty() && it.text.isBlank())
error("File name must not be entirely whitespace")
else
null
}

fun namespacePrefixValidator(): ValidationInfoBuilder.(JTextField) -> ValidationInfo? = {
if (it.text.isNotEmpty() && !namespacePrefixRegex.matches(it.text))
error("Namespace prefix must be in a valid format")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class CliToolWindowManager(private val project: Project) {
fun instantiateConsole(): ConsoleView {
val consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).console
val content = toolWindow.contentManager.factory.createContent(consoleView.component, UiBundle.text("cli.tab.generate"), true)
content.setDisposer(consoleView);
toolWindow.contentManager.addContent(content)
toolWindow.activate {
toolWindow.contentManager.setSelectedContent(content)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ru.ellizio.odatacliui.ui

import com.intellij.openapi.ui.DialogPanel
import com.intellij.ui.components.JBScrollPane

class ScrollableDialogPanel(private val view: DialogPanel) : JBScrollPane(view, VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER) {
val panel: DialogPanel
get() = view
}
Loading