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

Fix compiler resolution for long build numbers #883

Merged
merged 6 commits into from
Jan 31, 2022

Conversation

jeppeman
Copy link
Contributor

@jeppeman jeppeman commented Jan 24, 2022

Fixes #884

In recent versions of Android Studio, the build number contains additional components from major.minor.patch, e.g. 2020-3.1-patch-4 has build number AI-203.7717.56.2031.7935034.

When configuration the plugin with a localPath that points to a recent Android Studio dist, these additional components causes the instrumentCode task to fail due to trying to resolve a non-existent compiler version (203.7717.56.2031.7935034 with the version given above).
With this commit we're stripping out components exceeding patch that are not equal to SNAPSHOT or *.
I.e, 1.2.3.4.5.SNAPSHOT becomes 1.2.3.SNAPSHOT.

In recent versions of Android Studio, the build number contains
additional components from major.minor.patch, e.g. 2020-3.1-patch-4 has
build number AI-203.7717.56.2031.7935034.
When configuration the plugin with a localPath that points to a recent Android Studio dist, these additional components causes the instrumentCode task to fail due to trying to resolve a non-existent compiler version (203.7717.56.2031.7935034).
With this commit we're stripping out components exceeding patch that are
not equal to SNAPSHOT or *. I.e, 1.2.3.4.5.SNAPSHOT becomes
1.2.3.SNAPSHOT.
@YannCebron YannCebron requested a review from hsz January 25, 2022 18:09
@hsz hsz added this to the next milestone Jan 31, 2022
dependabot bot and others added 5 commits January 31, 2022 21:38
Bumps com.gradle.plugin-publish from 0.19.0 to 0.20.0.

---
updated-dependencies:
- dependency-name: com.gradle.plugin-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps gradle-idea-ext from 1.1.1 to 1.1.2.

---
updated-dependencies:
- dependency-name: gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@hsz hsz merged commit bd3f12e into JetBrains:master Jan 31, 2022
@hsz
Copy link
Member

hsz commented Jan 31, 2022

Looks good. Thank you, Jesper!

Salomon88 pushed a commit to Salomon88/gradle-intellij-plugin that referenced this pull request Feb 18, 2022
* Fix compiler resolution for long build numbers

In recent versions of Android Studio, the build number contains
additional components from major.minor.patch, e.g. 2020-3.1-patch-4 has
build number AI-203.7717.56.2031.7935034.
When configuration the plugin with a localPath that points to a recent Android Studio dist, these additional components causes the instrumentCode task to fail due to trying to resolve a non-existent compiler version (203.7717.56.2031.7935034).
With this commit we're stripping out components exceeding patch that are
not equal to SNAPSHOT or *. I.e, 1.2.3.4.5.SNAPSHOT becomes
1.2.3.SNAPSHOT.

* Bump com.gradle.plugin-publish from 0.19.0 to 0.20.0

Bumps com.gradle.plugin-publish from 0.19.0 to 0.20.0.

---
updated-dependencies:
- dependency-name: com.gradle.plugin-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump gradle-idea-ext from 1.1.1 to 1.1.2

Bumps gradle-idea-ext from 1.1.1 to 1.1.2.

---
updated-dependencies:
- dependency-name: gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixed JBR resolving for MacOSX M1

* CHANGES update

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
Undin added a commit to JetBrains/educational-plugin that referenced this pull request May 12, 2022
Previously, it was used to provide proper compiler version for code instrumentation in modules compiled with Android Studio. But after JetBrains/intellij-platform-gradle-plugin#883 and JetBrains/intellij-platform-gradle-plugin#906 `gradle-intellij-plugin` can detect proper compiler version itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

instrumentCode fails with recent versions of Android Studio
2 participants