Skip to content

Commit

Permalink
Updated to IntelliJ version 2021.2 (#291)
Browse files Browse the repository at this point in the history
2021.2 is now the default version installed.
  • Loading branch information
freemanjp authored Jul 28, 2021
1 parent efb8712 commit f1dc362
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ are shown below):
```yaml
# IntelliJ IDEA version number
intellij_version: '2021.1.3'
intellij_version: '2021.2'

# Mirror where to dowload IntelliJ IDEA redistributable package from
# Using HTTP because of https://github.com/ansible/ansible/issues/11579
Expand Down Expand Up @@ -130,6 +130,7 @@ The following versions of IntelliJ IDEA are supported without any additional
configuration (for other versions follow the Advanced Configuration
instructions):
* `2021.2`
* `2021.1.3`
* `2021.1.2`
* `2021.1.1`
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# IntelliJ IDEA version number
intellij_version: '2021.1.3'
intellij_version: '2021.2'

# Mirror where to dowload IntelliJ IDEA redistributable package from
# Using HTTP because of https://github.com/ansible/ansible/issues/11579
Expand Down
28 changes: 23 additions & 5 deletions library/intellij_install_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import re
import pwd
import os
import json
import hashlib
import grp

Expand Down Expand Up @@ -264,14 +265,11 @@ def get_build_number_from_xml(module, intellij_home, xml):
return build_number


def get_build_number(module, intellij_home):
def get_build_number_from_jar(module, intellij_home):
resources_jar = os.path.join(intellij_home, 'lib', 'resources.jar')

if not os.path.isfile(resources_jar):
module.fail_json(
msg=('Unable to determine IntelliJ version from path: %s '
'("lib/resources.jar" not found)') %
intellij_home)
return None

with zipfile.ZipFile(resources_jar, 'r') as resource_zip:
try:
Expand All @@ -289,6 +287,26 @@ def get_build_number(module, intellij_home):
intellij_home)


def get_build_number_from_json(module, intellij_home):
product_info_path = os.path.join(intellij_home, 'product-info.json')

if not os.path.isfile(product_info_path):
module.fail_json(
msg=('Unable to determine IntelliJ version from path: %s '
'("product-info.json" not found)') %
intellij_home)

with open(product_info_path) as product_info_file:
product_info = json.load(product_info_file)
return product_info['buildNumber']


def get_build_number(module, intellij_home):
return get_build_number_from_jar(
module, intellij_home) or get_build_number_from_json(
module, intellij_home)


def get_plugin_info(module, plugin_manager_url, intellij_home, plugin_id):

build_number = get_build_number(module, intellij_home)
Expand Down
3 changes: 3 additions & 0 deletions vars/versions/2021.2-community.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# SHA256 sum for the redistributable package
intellij_redis_sha256sum: 7c27799861fb1ba0d43a3565a1ec2be789e1871191be709f0e79f1e17d3571fe
3 changes: 3 additions & 0 deletions vars/versions/2021.2-ultimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# SHA256 sum for the redistributable package
intellij_redis_sha256sum: 95aef61da8bb2b457473e8345722a2266e46e3d1f8f80d4c450f6d0c0ee58d17

0 comments on commit f1dc362

Please sign in to comment.