Skip to content

Commit

Permalink
fixed JbrResolvers pattern resolving logic (#257)
Browse files Browse the repository at this point in the history
* fixed JbrResolvers pattern resolving logic

* added proper comment for missing aarch64 support

* change val name back to official
  • Loading branch information
LukaszKontowski authored Aug 29, 2022
1 parent ab994b5 commit 6e09beb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ import org.virtuslab.ideprobe.dependencies.Dependency.Missing
import org.virtuslab.ideprobe.Extensions.PathExtension

object JbrResolvers {
val official =
JbrPatternResolver(
"https://cache-redirector.jetbrains.com/intellij-jbr/jbr_dcevm-[major]-[platform]-x64-b[minor].tar.gz"
)
/*
The `jbr_dcevm` pattern applies only to versions of IntelliJ older than 2022.2 release, whereas
`jbr` pattern applies to newer versions where DCEVM is bundled by default.
Another important note: currently we are using only JBR packages with `x64` architecture support. During tests
it turned out that using `aarch64` packages on processors with `aarch64` architecture (Mac M1 Pro chip) results
in "Cannot load JVM bundle:" error. For some reason only `x64` packages work well (both for `x64` and `aarch64`
processor architectures). Hence `x64` should stay hardcoded in the `officialJbrVersionPatterns` elements.
*/
private val officialJbrVersionPatterns = Seq(
"https://cache-redirector.jetbrains.com/intellij-jbr/jbr_dcevm-[major]-[platform]-x64-b[minor].tar.gz",
"https://cache-redirector.jetbrains.com/intellij-jbr/jbr-[major]-[platform]-x64-b[minor].tar.gz"
)

val official: Seq[JbrPatternResolver] = officialJbrVersionPatterns.map(JbrPatternResolver)

def fromConfig(config: DependenciesConfig.Jbr): Seq[DependencyResolver[Path]] = {
val official = Seq(JbrResolvers.official)
val fromConfig = config.repositories
.flatMap(pattern =>
if (Set("official", "default").contains(pattern.toLowerCase)) official
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ object IntelliJProvider {
dependencies = new DependencyProvider(
new IntelliJDependencyProvider(Seq(IntelliJZipResolver.community), ResourceProvider.Default),
new PluginDependencyProvider(Seq(PluginResolver.Official), ResourceProvider.Default),
new JbrDependencyProvider(Seq(JbrResolvers.official), ResourceProvider.Default)
new JbrDependencyProvider(JbrResolvers.official, ResourceProvider.Default)
),
plugins = Seq.empty,
version = IntelliJVersion.Latest,
Expand Down

0 comments on commit 6e09beb

Please sign in to comment.