Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rx bloc plugin incompatibility issues #703

Merged
merged 3 commits into from
Jul 11, 2024
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
6 changes: 5 additions & 1 deletion extensions/intellij/intellij_generator_plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group 'com.rx_bloc'
version '3.0.3'
version '3.0.4'


apply plugin: 'org.jetbrains.intellij'
Expand All @@ -35,6 +35,7 @@ dependencies {
testCompile "org.mockito:mockito-core:2.7.5"

implementation "com.fleshgrinder.kotlin:case-format:0.2.0"
implementation 'org.apache.commons:commons-text:1.9'
}

compileKotlin {
Expand All @@ -54,6 +55,9 @@ patchPluginXml {
changeNotes """
<ul>
<li>
v.3.0.4 - Replaced deprecated classes from external libraries with their updated counterparts to ensure compatibility and improve performance
</li>
<li>
v.3.0.3 - Fix incompatibility issues with Android Studio Giraffe
</li>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.primeholding.rxbloc_generator_plugin.action
import com.fleshgrinder.extensions.kotlin.toLowerCamelCase
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataKeys
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.command.CommandProcessor
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.fileEditor.FileEditorManager
Expand All @@ -24,7 +24,7 @@ class BootstrapSingleTestAction : AnAction() {

override fun update(e: AnActionEvent?) {
super.update(e)
val files = e?.dataContext?.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = e?.dataContext?.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)
var isVisible = false

var file: VirtualFile?
Expand Down Expand Up @@ -64,7 +64,7 @@ class BootstrapSingleTestAction : AnAction() {
override fun actionPerformed(e: AnActionEvent?) {

project = e?.project
val files = e?.dataContext?.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = e?.dataContext?.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)

var file: VirtualFile?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.primeholding.rxbloc_generator_plugin.action

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataKeys
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.project.Project
Expand All @@ -18,7 +18,7 @@ import java.io.File
class BootstrapTestsAction : AnAction() {
override fun update(e: AnActionEvent?) {
super.update(e)
val files = e?.dataContext?.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = e?.dataContext?.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)
var isVisible = false

val numberFiles = (files?.size ?: 0)
Expand Down Expand Up @@ -80,7 +80,7 @@ class BootstrapTestsAction : AnAction() {
e?.project?.basePath?.let { baseDir ->

var isShowDialog = false
val files = e.dataContext.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = e.dataContext.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)


val potentialBlocFolders = mutableListOf<VirtualFile>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GenerateRxBlocFeatureAction : AnAction(), GenerateRxBlocDialog.Listener {
val presentation = e.presentation


val files = e.dataContext.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = e.dataContext.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)
val isVisible = files != null && files.size == 1 && files[0].isDirectory

presentation.isEnabled = isVisible
Expand All @@ -78,7 +78,7 @@ class GenerateRxBlocFeatureAction : AnAction(), GenerateRxBlocDialog.Listener {
) {
val project = CommonDataKeys.PROJECT.getData(dataContext)
//contextually selected folders
val files = event.dataContext.getData(DataKeys.VIRTUAL_FILE_ARRAY)
val files = event.dataContext.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package com.primeholding.rxbloc_generator_plugin.generator

import com.google.common.io.CharStreams
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.InputStreamReader
import java.lang.RuntimeException

Expand Down Expand Up @@ -55,7 +55,7 @@ abstract class RxBlocGeneratorBase(
}

override fun generate(): String {
val substitute = StrSubstitutor(templateValues)
val substitute = StringSubstitutor(templateValues)
return substitute.replace(templateString)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.primeholding.rxbloc_generator_plugin.generator

import com.google.common.io.CharStreams
import com.primeholding.rxbloc_generator_plugin.action.GenerateRxBlocDialog.RoutingIntegration
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.InputStreamReader
import java.lang.RuntimeException

Expand Down Expand Up @@ -49,7 +49,7 @@ abstract class RxDependenciesGeneratorBase(
}

override fun generate(): String {
val substitute = StrSubstitutor(templateValues)
val substitute = StringSubstitutor(templateValues)
var result = substitute.replace(templateString)
if (includeLocalServiceFlag) {
result = result.replace("// ", "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package com.primeholding.rxbloc_generator_plugin.generator

import com.google.common.io.CharStreams
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.InputStreamReader
import java.lang.RuntimeException

Expand Down Expand Up @@ -34,7 +34,7 @@ abstract class RxListBlocGeneratorBase(
}

override fun generate(): String {
val substitutor = StrSubstitutor(templateValues)
val substitutor = StringSubstitutor(templateValues)
return substitutor.replace(templateString)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.primeholding.rxbloc_generator_plugin.generator

import com.google.common.io.CharStreams
import com.primeholding.rxbloc_generator_plugin.action.GenerateRxBlocDialog
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.InputStreamReader
import java.lang.RuntimeException

Expand Down Expand Up @@ -45,7 +45,7 @@ abstract class RxPageGeneratorBase(
}

override fun generate(): String {
val substitutor = StrSubstitutor(templateValues)
val substitutor = StringSubstitutor(templateValues)
return substitutor.replace(templateString)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.google.common.io.CharStreams
import com.intellij.openapi.vfs.VirtualFile
import com.primeholding.rxbloc_generator_plugin.generator.parser.TestableClass
import com.primeholding.rxbloc_generator_plugin.generator.parser.Utils
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.File
import java.io.InputStreamReader
import java.lang.RuntimeException
Expand Down Expand Up @@ -420,7 +420,7 @@ abstract class RxTestGeneratorBase(
}

override fun generate(): String {
val substitutor = StrSubstitutor(templateValues)
val substitutor = StringSubstitutor(templateValues)
return substitutor.replace(templateString)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package com.primeholding.rxbloc_generator_plugin.generator.components
import com.google.common.io.CharStreams
import com.primeholding.rxbloc_generator_plugin.generator.RxBlocGeneratorBase
import com.primeholding.rxbloc_generator_plugin.generator.RxGeneratorBase
import org.apache.commons.lang.text.StrSubstitutor
import org.apache.commons.text.StringSubstitutor
import java.io.InputStreamReader
import java.lang.RuntimeException

Expand Down Expand Up @@ -39,7 +39,7 @@ class RxBlocWithServiceGenerator(
override fun contextDirectoryName(): String = "services"

override fun generate(): String {
val substitute = StrSubstitutor(templateValues)
val substitute = StringSubstitutor(templateValues)
return substitute.replace(templateString)
}
}
Loading