Skip to content

Commit

Permalink
Merge branch 'private-release/v1.1.0-223' into private-release/v1.1.0…
Browse files Browse the repository at this point in the history
…-231
  • Loading branch information
KUGDev committed Jun 28, 2023
2 parents 71b8d20 + 8736e30 commit 66de2f7
Show file tree
Hide file tree
Showing 37 changed files with 2,017 additions and 1,248 deletions.
5 changes: 3 additions & 2 deletions Jenkinsfile.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ properties([gitLabConnection('code.iby.scdc.io-connection')])

// @NonCPS
// def changeVersion(String xmlFile) {

// def xml = new XmlSlurper().parseText(xmlFile)
// println xml.'idea-version'.'@since-build'
// xml.'idea-version'.'@since-build' = '203.7148.72'
Expand Down Expand Up @@ -116,15 +117,15 @@ pipeline {
success {
script {
if (!jiraTicket.contains('release') && !'development'.equals(jiraTicket) && !'zowe-development'.equals(jiraTicket) && !"null".equals(jiraTicket)) {
jiraAddComment idOrKey: "$jiraTicket", comment: "Hello! It's jenkins. Your push in branch was successfully built. You can download your build from the following link http://10.221.23.186/ijmp-plugin/$jiraTicket/idea/$resultFileName.", site: "$jiraSite"
jiraAddComment idOrKey: "$jiraTicket", comment: "Hello! It's jenkins. Your push in branch was successfully built. You can download your build from the following link http://10.222.240.3/ijmp-plugin/$jiraTicket/idea/$resultFileName.", site: "$jiraSite"
}

}
}
failure {
script {
if (!jiraTicket.contains('release') && !'development'.equals(jiraTicket) && !'zowe-development'.equals(jiraTicket) && !"null".equals(jiraTicket)) {
jiraAddComment idOrKey: "$jiraTicket", comment: "Hello! It's jenkins. Your push in branch failed to build for Intellij IDEA. You can get console output by the following link http://10.221.23.186:8080/job/BuildPluginPipeline/", site: "$jiraSite"
jiraAddComment idOrKey: "$jiraTicket", comment: "Hello! It's jenkins. Your push in branch failed to build for Intellij IDEA. You can get console output by the following link http://10.222.240.3:8080/job/BuildPluginPipeline/", site: "$jiraSite"
}
}
}
Expand Down
10 changes: 2 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlinx.kover.api.KoverTaskExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.intellij") version "1.13.0"
id("org.jetbrains.intellij") version "1.14.2"
kotlin("jvm") version "1.7.10"
java
id("org.jetbrains.kotlinx.kover") version "0.6.1"
Expand All @@ -33,13 +33,7 @@ repositories {
url = uri("https://zowe.jfrog.io/zowe/libs-release")
}
maven {
url = uri("http://10.221.23.186:8082/repository/internal/")
isAllowInsecureProtocol = true
credentials {
username = "admin"
password = "password123"
}
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
url = uri("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
flatDir {
dir("libs")
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xss1M
7 changes: 6 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
26 changes: 24 additions & 2 deletions src/main/kotlin/eu/ibagroup/formainframe/config/ws/MaskState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,29 @@ open class MaskState(
) : TableRow

/**
* Mask state extension that stores working set reference to check the mask uniqueness basing on the working set existing masks
* Mask state extension that stores working set reference to check the mask uniqueness basing
* on the working set existing masks.
* An instance of this class could also be called with the [MaskState] instance provided,
* that will create a new instance of the mask state with working set
* @param mask the mask name
* @param type the mask type (z/OS or USS)
* @param isTypeSelectedAutomatically parameter to represent whether the type selected basing on the mask name input
* @param isTypeSelectedManually parameter to represent whether the type selected by the user through the combo box
* @param ws the working set to check the mask uniqueness
*/
class MaskStateWithWS(var ws: FilesWorkingSet) : MaskState()
class MaskStateWithWS(
mask: String = "",
type: MaskType = MaskType.ZOS,
isTypeSelectedAutomatically: Boolean = false,
isTypeSelectedManually: Boolean = false,
var ws: FilesWorkingSet
) : MaskState(mask, type, isTypeSelectedAutomatically, isTypeSelectedManually) {
constructor(maskState: MaskState, ws: FilesWorkingSet) :
this(
mask = maskState.mask,
type = maskState.type,
isTypeSelectedAutomatically = maskState.isTypeSelectedAutomatically,
isTypeSelectedManually = maskState.isTypeSelectedManually,
ws
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@
*/
package eu.ibagroup.formainframe.dataops.operations.mover

import com.intellij.openapi.fileEditor.impl.LoadTextUtil
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry
import eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.dataops.attributes.RemoteUssAttributes
import eu.ibagroup.formainframe.dataops.content.synchronizer.DocumentedSyncProvider
import eu.ibagroup.formainframe.dataops.content.synchronizer.LF_LINE_SEPARATOR
import eu.ibagroup.formainframe.dataops.operations.OperationRunner
import eu.ibagroup.formainframe.dataops.operations.OperationRunnerFactory
import eu.ibagroup.formainframe.utils.changeFileEncodingTo
import eu.ibagroup.formainframe.utils.log
import eu.ibagroup.formainframe.utils.runReadActionInEdtAndWait
import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait
import eu.ibagroup.formainframe.vfs.MFVirtualFile
import org.zowe.kotlinsdk.XIBMDataType
import java.io.File
import java.nio.file.Paths

/**
Expand Down Expand Up @@ -79,26 +85,46 @@ class RemoteToLocalFileMover(val dataOpsManager: DataOpsManager) : AbstractFileM
?: return IllegalArgumentException("Cannot find synchronizer for file ${sourceFile.name}")
val syncProvider = DocumentedSyncProvider(sourceFile)

if (!sourceFile.fileType.isBinary) {
sourceFileAttributes.contentMode = XIBMDataType(XIBMDataType.Type.TEXT)
} else {
if (sourceFile.fileType.isBinary || sourceFileAttributes is RemoteUssAttributes) {
sourceFileAttributes.contentMode = XIBMDataType(XIBMDataType.Type.BINARY)
} else {
sourceFileAttributes.contentMode = XIBMDataType(XIBMDataType.Type.TEXT)
}
contentSynchronizer.synchronizeWithRemote(syncProvider, progressIndicator)
val sourceContent = contentSynchronizer.successfulContentStorage(syncProvider)

runWriteActionInEdtAndWait {
if (operation.forceOverwriting) {
destFile.children.filter { it.name === (newFileName?: sourceFile.name) && !it.isDirectory }.forEach { it.delete(this) }
destFile.children.filter { it.name === (newFileName) && !it.isDirectory }.forEach { it.delete(this) }
}
}
val createdFileJava = Paths.get(destFile.path, newFileName?: sourceFile.name).toFile().apply { createNewFile() }
createdFileJava.writeBytes(sourceFile.contentsToByteArray())
val createdFileJava = Paths.get(destFile.path, newFileName).toFile().apply { createNewFile() }
createdFileJava.writeBytes(sourceContent)
if (!sourceFile.fileType.isBinary) {
setCreatedFileParams(createdFileJava, sourceFile)
}
runReadActionInEdtAndWait {
destFile.refresh(false, false)
}
return null
}

/**
* Sets parameters (charset, line separator) for created file to be the same as the parameters of source file.
* @param createdFileJava created java file
* @param sourceFile source virtual file
*/
private fun setCreatedFileParams(createdFileJava: File, sourceFile: VirtualFile) {
val createdVirtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(createdFileJava)
createdVirtualFile?.let {
changeFileEncodingTo(it, sourceFile.charset)
val lineSeparator = sourceFile.detectedLineSeparator ?: LF_LINE_SEPARATOR
runWriteActionInEdtAndWait {
LoadTextUtil.changeLineSeparators(null, it, lineSeparator, it)
}
}
}

/**
* Starts operation execution. Throws throwable if something went wrong.
* @throws Throwable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import eu.ibagroup.formainframe.config.ws.DSMask
import eu.ibagroup.formainframe.config.ws.MaskStateWithWS
import eu.ibagroup.formainframe.config.ws.UssPath
import eu.ibagroup.formainframe.explorer.FilesWorkingSet
import eu.ibagroup.formainframe.explorer.ui.AddMaskDialog
import eu.ibagroup.formainframe.explorer.ui.AddOrEditMaskDialog
import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
import eu.ibagroup.formainframe.explorer.ui.getExplorerView
Expand All @@ -31,8 +31,8 @@ class AddMaskAction : AnAction() {
val view = e.getExplorerView<FileExplorerView>() ?: return

val ws = getUnits(view).firstOrNull() ?: return
val initialState = MaskStateWithWS(ws)
val dialog = AddMaskDialog(e.project, initialState)
val initialState = MaskStateWithWS(ws = ws)
val dialog = AddOrEditMaskDialog(e.project, "Create Mask", initialState)
if (dialog.showAndGet()) {
val state = dialog.state
when (state.type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes
import eu.ibagroup.formainframe.dataops.operations.DatasetAllocationOperation
import eu.ibagroup.formainframe.dataops.operations.DatasetAllocationParams
import eu.ibagroup.formainframe.explorer.FilesWorkingSet
import eu.ibagroup.formainframe.explorer.ui.*
import eu.ibagroup.formainframe.explorer.ui.AllocationDialog
import eu.ibagroup.formainframe.explorer.ui.DSMaskNode
import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
import eu.ibagroup.formainframe.explorer.ui.FileFetchNode
import eu.ibagroup.formainframe.explorer.ui.FileLikeDatasetNode
import eu.ibagroup.formainframe.explorer.ui.FilesWorkingSetNode
import eu.ibagroup.formainframe.explorer.ui.LibraryNode
import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.utils.castOrNull
import eu.ibagroup.formainframe.utils.clone
import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey
Expand All @@ -53,15 +62,23 @@ class AllocateDatasetAction : AnAction() {
}

/**
* Determines if dataset allocation is possible for chosen object
* Determines if dataset allocation is possible for chosen object.
* Shows the action if:
* 1. It is a [FileExplorerView]
* 2. The first selected node is [FilesWorkingSetNode], [DSMaskNode], [LibraryNode] or [FileLikeDatasetNode]
*/
override fun update(e: AnActionEvent) {
val view = e.getExplorerView<FileExplorerView>() ?: let {
e.presentation.isEnabledAndVisible = false
return
}
val selected = view.mySelectedNodesData
e.presentation.isEnabledAndVisible = selected.getOrNull(0)?.node is MFNode
val selectedNodesData = view.mySelectedNodesData
val node = selectedNodesData.getOrNull(0)?.node
if (node !is FilesWorkingSetNode && node !is DSMaskNode && node !is LibraryNode && node !is FileLikeDatasetNode) {
e.presentation.isEnabledAndVisible = false
return
}
e.presentation.isEnabledAndVisible = true
e.presentation.icon = IconUtil.addText(AllIcons.FileTypes.Any_type, "DS")
}

Expand Down Expand Up @@ -265,8 +282,8 @@ class AllocateLikeAction : AnAction() {
}
val selected = view.mySelectedNodesData
e.presentation.isEnabledAndVisible = selected.size == 1
&& selected[0].attributes is RemoteDatasetAttributes
&& !(selected[0].attributes as RemoteDatasetAttributes).isMigrated
&& selected[0].attributes is RemoteDatasetAttributes
&& !(selected[0].attributes as RemoteDatasetAttributes).isMigrated
e.presentation.icon = IconUtil.addText(AllIcons.FileTypes.Any_type, "DS")
}

Expand Down
Loading

0 comments on commit 66de2f7

Please sign in to comment.