Skip to content

Commit 5a117f7

Browse files
timilirisclaude
andcommitted
v1.3.5 - Bug fixes & Cross-platform improvements
- Fix offline docs download threading error (WriteAction on background thread) - Fix deployToServer Gradle task conflict with shadowJar - Improve cross-platform path handling (use Paths.get/File.separator) - Disable default jar task to prevent artifact conflicts Fixes #7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d1689cb commit 5a117f7

File tree

6 files changed

+45
-24
lines changed

6 files changed

+45
-24
lines changed

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
## [Unreleased]
44

5+
## [1.3.5] - 2026-01-22
6+
7+
### Fixed
8+
9+
- **Offline Docs Download**: Fixed threading error when downloading documentation (WriteAction was called from background thread) ([#7](https://github.com/timiliris/hytaledDocs-intelliJ-plugin/issues/7))
10+
- **deployToServer Gradle Task**: Fixed conflict between default `jar` task and `shadowJar` by disabling the default jar task ([#7](https://github.com/timiliris/hytaledDocs-intelliJ-plugin/issues/7))
11+
- **Cross-Platform Paths**: Improved path handling for better Windows/macOS/Linux compatibility
12+
- Fixed hardcoded slashes in cache directory paths
13+
- Now uses `Paths.get()` and `File.separator` consistently
14+
15+
## [1.3.4] - 2026-01-19
16+
17+
### Added
18+
19+
- **Mac & Linux Support**: Full cross-platform compatibility
20+
- OS-specific paths for Hytale launcher detection
21+
- Architecture detection (amd64/aarch64) for Java downloads
22+
- Platform-specific executable handling
23+
24+
### Contributors
25+
26+
- [@maartenpeels](https://github.com/maartenpeels) - Mac/Linux support
27+
528
## [1.3.1] - 2026-01-18
629

730
### Added
@@ -95,7 +118,9 @@
95118
- Supports IntelliJ IDEA 2024.3+
96119
- Requires Java 25 for Hytale development
97120

98-
[Unreleased]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.1...HEAD
121+
[Unreleased]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.5...HEAD
122+
[1.3.5]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.4...v1.3.5
123+
[1.3.4]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.1...v1.3.4
99124
[1.3.1]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.3.0...v1.3.1
100125
[1.3.0]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.2.0...v1.3.0
101126
[1.2.0]: https://github.com/HytaleDocs/hytale-intellij-plugin/compare/v1.1.0...v1.2.0

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.hytaledocs.hytale
44
pluginName = Hytale Development Tools
55
pluginRepositoryUrl = https://github.com/HytaleDocs/hytale-intellij-plugin
66
# SemVer format -> https://semver.org
7-
pluginVersion = 1.3.4
7+
pluginVersion = 1.3.5
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 253

src/main/kotlin/com/hytaledocs/intellij/services/OfflineDocsService.kt

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import com.google.gson.Gson
44
import com.google.gson.GsonBuilder
55
import com.hytaledocs.intellij.util.HttpClientPool
66
import com.intellij.openapi.application.ApplicationManager
7-
import com.intellij.openapi.application.WriteAction
87
import com.intellij.openapi.components.Service
98
import com.intellij.openapi.diagnostic.Logger
109
import java.io.*
1110
import java.net.URI
1211
import java.net.http.HttpRequest
1312
import java.net.http.HttpResponse
1413
import java.nio.file.Files
14+
import java.nio.file.Paths
1515
import java.time.Duration
1616
import java.time.Instant
1717
import java.util.concurrent.CompletableFuture
@@ -56,7 +56,7 @@ class OfflineDocsService {
5656
*/
5757
fun getCacheDir(): File {
5858
val userHome = System.getProperty("user.home")
59-
return File(userHome, ".hytale-intellij/docs-cache")
59+
return Paths.get(userHome, ".hytale-intellij", "docs-cache").toFile()
6060
}
6161
}
6262

@@ -204,14 +204,12 @@ class OfflineDocsService {
204204
))
205205

206206
// Clear old docs
207-
WriteAction.run<Throwable> {
208-
try {
209-
docsDir.deleteRecursively()
210-
} catch (e: Exception) {
211-
LOG.warn("Failed to delete old docs directory", e)
212-
}
213-
docsDir.mkdirs()
207+
try {
208+
docsDir.deleteRecursively()
209+
} catch (e: Exception) {
210+
LOG.warn("Failed to delete old docs directory", e)
214211
}
212+
docsDir.mkdirs()
215213

216214
val extractedFiles = extractDocsFromZip(zipData, docsDir) { current, total ->
217215
val percent = if (total > 0) (current * 100) / total else 0
@@ -256,9 +254,7 @@ class OfflineDocsService {
256254
)
257255

258256
val indexFile = File(cacheDir, "index.json")
259-
WriteAction.run<Throwable> {
260-
indexFile.writeText(gson.toJson(docsIndex))
261-
}
257+
indexFile.writeText(gson.toJson(docsIndex))
262258

263259
// Refresh VFS to make downloaded docs visible to IntelliJ
264260
LocalFileSystem.getInstance().refreshAndFindFileByPath(cacheDir.absolutePath)
@@ -382,13 +378,7 @@ class OfflineDocsService {
382378
*/
383379
fun clearCache() {
384380
try {
385-
WriteAction.run<Throwable> {
386-
try {
387-
getCacheDir().deleteRecursively()
388-
} catch (e: Exception) {
389-
LOG.warn("Failed to delete cache directory", e)
390-
}
391-
}
381+
getCacheDir().deleteRecursively()
392382
docsIndex = null
393383
docsCache.clear()
394384
LOG.info("Cache cleared")

src/main/kotlin/com/hytaledocs/intellij/services/ServerDataService.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class ServerDataService {
3030
companion object {
3131
private val LOG = Logger.getInstance(ServerDataService::class.java)
3232

33-
private const val LOCAL_DATA_DIR = ".hytale-intellij/server-data"
33+
private const val LOCAL_BASE_DIR = ".hytale-intellij"
34+
private const val LOCAL_DATA_SUBDIR = "server-data"
3435
private const val BUNDLED_DATA_PATH = "/data"
3536

3637
private const val EVENTS_FILE = "events.json"
@@ -60,7 +61,7 @@ class ServerDataService {
6061

6162
private fun getLocalDataDir(): Path {
6263
val userHome = System.getProperty("user.home")
63-
return Path.of(userHome, LOCAL_DATA_DIR)
64+
return Path.of(userHome, LOCAL_BASE_DIR, LOCAL_DATA_SUBDIR)
6465
}
6566

6667
@Synchronized

src/main/kotlin/com/hytaledocs/intellij/wizard/HytaleModuleBuilder.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,11 @@ class HytaleModuleBuilder : ModuleBuilder() {
704704
}
705705
}
706706
707+
// Disable the default jar task to avoid conflicts with shadowJar
708+
tasks.named('jar') {
709+
enabled = false
710+
}
711+
707712
tasks.named('build') {
708713
dependsOn shadowJar
709714
}

src/main/kotlin/com/hytaledocs/intellij/wizard/HytaleWizardStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class HytaleWizardStep(
6363

6464
private fun setupProjectLocation() {
6565
// Set default project location
66-
val defaultPath = System.getProperty("user.home") + "/IdeaProjects"
66+
val defaultPath = System.getProperty("user.home") + File.separator + "IdeaProjects"
6767
projectLocationField.text = defaultPath
6868

6969
projectLocationField.addBrowseFolderListener(

0 commit comments

Comments
 (0)