Skip to content

Commit 8e931f5

Browse files
authored
Merge pull request #93 from fioan89/add-support-for-idea-2022-3
Add support for idea 2022.3
2 parents d9c6a96 + 52d0702 commit 8e931f5

6 files changed

Lines changed: 48 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ jobs:
4747
- name: Gradle Wrapper Validation
4848
uses: gradle/wrapper-validation-action@v1.0.5
4949

50-
# Setup Java 11 environment for the next steps
50+
# Setup Java 17 environment for the next steps
5151
- name: Setup Java
5252
uses: actions/setup-java@v3
5353
with:
5454
distribution: zulu
55-
java-version: 11
55+
java-version: 17
5656

5757
# Set environment variables
5858
- name: Export Properties

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
with:
2424
ref: ${{ github.event.release.tag_name }}
2525

26-
# Setup Java 11 environment for the next steps
26+
# Setup Java 17 environment for the next steps
2727
- name: Setup Java
2828
uses: actions/setup-java@v3
2929
with:
3030
distribution: zulu
31-
java-version: 11
31+
java-version: 17
3232

3333
# Set environment variables
3434
- name: Export Properties

CHANGELOG.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- support for latest OpenSSH private key format
10+
- support for latest IntelliJ 2022.3
11+
712
## [2.0.1]
8-
### Fixed
9-
- upload issues when using SFTP from local Windows to remote Linux
10-
- behavior for SSH keys component, now they properly enable or disable if users want to authenticate with SSH keys
11-
- plugin icon shown in marketplace
1213

13-
### Changed
14-
- project's base location label from "Root path" to "Workspace base path". This is a breaking change, users
14+
### Fixed
15+
16+
- upload issues when using SFTP from local Windows to remote Linux
17+
- behavior for SSH keys component, now they properly enable or disable if users want to authenticate with SSH keys
18+
- plugin icon shown in marketplace
19+
20+
### Changed
21+
22+
- project's base location label from "Root path" to "Workspace base path". This is a breaking change, users
1523
will have to reconfigure the connections again.
1624

1725
## [2.0.0]

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repositories {
2525
}
2626

2727
dependencies {
28-
implementation("com.jcraft:jsch:0.1.55")
28+
implementation("com.github.mwiede:jsch:0.2.4")
2929
implementation("commons-net:commons-net:3.9.0")
3030

3131
testImplementation("org.mockito:mockito-core:4.9.0")
@@ -73,6 +73,10 @@ tasks {
7373
gradleVersion = properties("gradleVersion")
7474
}
7575

76+
buildSearchableOptions {
77+
isEnabled = false
78+
}
79+
7680
patchPluginXml {
7781
version.set(properties("pluginVersion"))
7882
sinceBuild.set(properties("pluginSinceBuild"))

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
pluginGroup=org.wavescale.sourcesync
22
pluginName=sourcesync
33
# SemVer format -> https://semver.org
4-
pluginVersion=2.0.1
4+
pluginVersion=2.0.2
55
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
66
# for insight into build numbers and IntelliJ Platform versions.
7-
pluginSinceBuild=211
8-
pluginUntilBuild=222.*
7+
pluginSinceBuild=223
8+
pluginUntilBuild=
99
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1010
platformType=IC
11-
platformVersion=2022.1
11+
platformVersion=2022.3
1212
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1313
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1414
platformPlugins=
1515
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
16-
javaVersion=11
16+
javaVersion=17
1717
# Gradle Releases -> https://github.com/gradle/gradle/releases
1818
gradleVersion=7.4
1919
# Opt-out flag for bundling Kotlin standard library.

src/main/kotlin/org/wavescale/sourcesync/synchronizer/SFTPFileSynchronizer.kt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ import java.nio.file.Paths
4040
* metadata like name, absoulte path, etc...
4141
* @param indicator used to report progress on upload process.
4242
*/
43-
class SFTPFileSynchronizer(connectionInfo: SFTPConfiguration, project: Project, indicator: ProgressIndicator) : FileSynchronizer(connectionInfo, project, indicator) {
43+
class SFTPFileSynchronizer(connectionInfo: SFTPConfiguration, project: Project, indicator: ProgressIndicator) :
44+
FileSynchronizer(connectionInfo, project, indicator) {
4445
private val jsch: JSch = JSch()
4546
private lateinit var session: Session
4647

@@ -65,15 +66,20 @@ class SFTPFileSynchronizer(connectionInfo: SFTPConfiguration, project: Project,
6566
@Throws(JSchException::class)
6667
private fun initSession() {
6768
val configuration = connectionInfo as SFTPConfiguration
68-
session = jsch.getSession(connectionInfo.userName, connectionInfo.host,
69-
connectionInfo.port)
69+
session = jsch.getSession(
70+
connectionInfo.userName, connectionInfo.host,
71+
connectionInfo.port
72+
)
7073
session.setConfig("StrictHostKeyChecking", "no")
7174
if (configuration.isPasswordlessSSHSelected) {
7275
session.setConfig("PreferredAuthentications", "publickey")
7376
try {
7477
Utils.createFile(SSH_KNOWN_HOSTS)
7578
} catch (e: IOException) {
76-
EventDataLogger.logError("Could not identify nor create the ssh known hosts file at " + SSH_KNOWN_HOSTS + ". The returned error is:" + e.message, project)
79+
EventDataLogger.logError(
80+
"Could not identify nor create the ssh known hosts file at " + SSH_KNOWN_HOSTS + ". The returned error is:" + e.message,
81+
project
82+
)
7783
}
7884
jsch.setKnownHosts(SSH_KNOWN_HOSTS)
7985
// add private key and passphrase if exists
@@ -88,10 +94,8 @@ class SFTPFileSynchronizer(connectionInfo: SFTPConfiguration, project: Project,
8894
}
8995

9096
override fun disconnect() {
91-
if (session != null) {
92-
session.disconnect()
93-
isConnected = false
94-
}
97+
session.disconnect()
98+
isConnected = false
9599
}
96100

97101
override fun syncFile(sourcePath: String, uploadLocation: Path) {
@@ -106,14 +110,20 @@ class SFTPFileSynchronizer(connectionInfo: SFTPConfiguration, project: Project,
106110
}
107111

108112
if (!channelSftp.absoluteDirExists(connectionInfo.workspaceBasePath)) {
109-
EventDataLogger.logError("Remote project base path ${connectionInfo.workspaceBasePath} does not exist or is not a directory. Please make sure the value is a valid absolute directory path", project)
113+
EventDataLogger.logError(
114+
"Remote project base path ${connectionInfo.workspaceBasePath} does not exist or is not a directory. Please make sure the value is a valid absolute directory path",
115+
project
116+
)
110117
return
111118
}
112119

113120
channelSftp.cd(connectionInfo.workspaceBasePath)
114121

115122
if (!channelSftp.localDirExistsOnRemote(uploadLocation.toString())) {
116-
EventDataLogger.logInfo("Upload path $uploadLocation does not exist or is not a directory. Going to create it.", project)
123+
EventDataLogger.logInfo(
124+
"Upload path $uploadLocation does not exist or is not a directory. Going to create it.",
125+
project
126+
)
117127
val exists = channelSftp.mkLocalDirsOnRemote(uploadLocation.toString())
118128
if (!exists) {
119129
EventDataLogger.logError("Upload path $uploadLocation could not be created.", project)

0 commit comments

Comments
 (0)