Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build number fallback when product-info.json is missing #880

Merged
merged 4 commits into from
Jan 31, 2022

Conversation

jeppeman
Copy link
Contributor

@jeppeman jeppeman commented Jan 18, 2022

Fixes #881

When configuring prepareSandbox we add some attributes to the jar
manifest, one of which being "Build-SDK" - when using localPath, the value of the attribute
is constructed from the contents of product-info.json (a metadata file located in the target IDE directory).
However, when the target IDE is Android Studio, this file does not exist (in recent versions at least), and the value thereby resolves to null; this causes the following error:

Could not determine the dependencies of task ':prepareSandbox'.

Failed to query the value of task ':prepareSandbox' property 'pluginJar'.
The value of a manifest attribute must not be null (Key=Build-SDK).

This commit makes it so that we fall back on the build number (also read
from the IDE directory) if product-info.json is missing.

When configuring prepareSandbox we add some attributes to the jar
manifest, one of which being "Build-SDK" - the value of the attribute
is constructed from the contents of product-info.json (A metadata file located in the IDE directory).
However, when the target IDE is Android Studio, this file does not exist, and the value thereby becomes null;
this causes the following error:

Could not determine the dependencies of task ':prepareSandbox'.
> Failed to query the value of task ':prepareSandbox' property 'pluginJar'.
   > The value of a manifest attribute must not be null (Key=Build-SDK).

This commit makes it so that we fall back on the build number (also read
from the IDE directory) if product-info.json is missing.
@YannCebron YannCebron requested a review from hsz January 18, 2022 12:55
@hsz hsz merged commit 3650092 into JetBrains:master Jan 31, 2022
@hsz
Copy link
Member

hsz commented Jan 31, 2022

Thanks once again!

@hsz hsz added this to the next milestone Jan 31, 2022
@hsz hsz linked an issue Feb 10, 2022 that may be closed by this pull request
Salomon88 pushed a commit to Salomon88/gradle-intellij-plugin that referenced this pull request Feb 18, 2022
* Build number fallback when product-info.json is missing

When configuring prepareSandbox we add some attributes to the jar
manifest, one of which being "Build-SDK" - the value of the attribute
is constructed from the contents of product-info.json (A metadata file located in the IDE directory).
However, when the target IDE is Android Studio, this file does not exist, and the value thereby becomes null;
this causes the following error:

Could not determine the dependencies of task ':prepareSandbox'.
> Failed to query the value of task ':prepareSandbox' property 'pluginJar'.
   > The value of a manifest attribute must not be null (Key=Build-SDK).

This commit makes it so that we fall back on the build number (also read
from the IDE directory) if product-info.json is missing.

* CHANGES update

Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants