Commit Graph

2015 Commits

Author SHA1 Message Date
Nikita Biriukov
5dd2eb64cf [gradle][groovy] IDEA-343916 add Gradle icon in autocomplete variants for version catalogs with default location
The icon was available only for version catalogs with custom location.

Code review: IJ-CR-153925
(cherry picked from commit b00d2ccd1901705489097ad193dcd97cb0fb9062)

GitOrigin-RevId: 65fbd12dbe95f05763bb8d64c65ab7c1cd67db3c
2025-02-14 14:58:29 +00:00
Nikita Biriukov
7110c90cca [gradle][groovy] IDEA-343916 enable completion for a property with version catalog name
- fixes completion for "libs" `GradleVersionCatalogsCompletionTest#testCompletionForVersionCatalogProperty`
- also enables completion for all other version catalog names of a build

I realized that `GradleExtensionsContributor#processPropertiesFromCatalog` is called not only while resolving but also while completion: when only a part of catalog name was written. In this case, `name` argument is `null` and accessors should be created for all version catalogs of the corresponding build. To achieve that, I added `GradleVersionCatalogHandler#getAccessorsForAllCatalogs`.

I decided to add a separate method for getting all accessors because if I use the existing `getAccessorClass`, it would recreate `ProjectBuildModel` for each version catalog.

Code review: IJ-CR-153925
(cherry picked from commit 1250f5b3bb22b6ed1968683b0b6144418d0ad70f)

GitOrigin-RevId: 3f270387510983fbd51ba630c54a04db7d5a5025
2025-02-14 14:58:29 +00:00
Nikita Biriukov
741d8ddc72 [gradle][groovy] IDEA-343916 fix navigation from the reference with version catalog name
In runtime, navigation did not work for this example:
`my<caret>Libs`.junit.jupiter
Where myLibs is a name of a version catalog defined in settings.gradle. However, navigation would work if the caret is located on `junit`.

The Interesting point is that `GradleVersionCatalogsResolveTest` has the test `testNavigationToTomlFile2` that covers this case. It was passing well because:
- in runtime, references to version catalogs are resolving using the data from the Android module. The corresponding Psi elements - StaticVersionCatalogProperty are created in GradleExtensionsContributor.kt
- in tests, references were resolved using the older approach which still works if android module does not provide version catalogs. It didn't because GroovyDslParser from the android module was not available in tests. Hence, reference was resolved using the GradleExtensionProperty PSI element created in GradleProjectExtensionContributor.kt

Code review: IJ-CR-153925
(cherry picked from commit de4bcd81a61a3bc45119857357f43a8a21a75392)

GitOrigin-RevId: a143eb4a149cea8cc549986023793912bd5c869d
2025-02-14 14:58:29 +00:00
Nikita Biriukov
4eeaeee016 [gradle][groovy] IDEA-343916 resolve references in build.gradle to a TOML with custom location of included builds
The changes in this commit allow resolving references to version catalogs in included builds of a composite build if android module provides these version catalogs.

I found two existing approaches to resolve a reverence with a name of a version catalog (e.g. 'myLibs') to a TOML file:
1) Using the data from VersionCatalogsModel that is prepared at sync in `CommonGradleProjectResolverExtension#populateProjectExtraModels`.
Resolve happens in `GradleProjectExtensionContributor`. It works well for simple projects, not composite ones.
This allows navigation to a version catalog with custom location that could be specified in settings.gradle

2) Using the data from `ProjectBuildModel` that is prepared in android module. Resolve happens in `GradleExtensionsContributor`.
It works only if the code in android module correctly discovers version catalogs and provides them.
In comparison to the first approach, the data is compared not while syncing but when it is requested

Code review: IJ-CR-153925
(cherry picked from commit d2859302e5aba22413d3b1da874bff1cd15c46b2)

GitOrigin-RevId: f2f65eff37cbfed5da79cfa570fa61caafc667a2
2025-02-14 14:58:29 +00:00
Nikita Biriukov
037abd6dd4 [gradle][groovy] IDEA-361255 disable the inspection for groovy files that are not Gradle scripts
There was a warning:
"Only method calls to 'id' and 'alias' are available in 'plugins' block"
in .groovy files with a content like:
```
plugins {
    apply 'df' named 'ffd'
}
```


(cherry picked from commit 4d22b23e04432d3b882b330eacee7beb2740c95d)

IJ-MR-149922

GitOrigin-RevId: 54ff53d34d60c5fc3b20331bd5a3fd29f518c27c
2024-11-22 15:40:23 +00:00
Frederik Haselmeier
6df603988a [kotlin] Limit new Gradle Kotlin templates to only be generated with Gradle 8.2+
^KTIJ-31697 fixed


(cherry picked from commit fe6493d804e6abed224e899d867b1bf2877384c7)

IJ-CR-147989

GitOrigin-RevId: 30ab7a5e2e61f04c2117813a91a5e0d7426e2592
2024-10-29 14:05:42 +00:00
Vera Petrenkova
ef04ccab02 IJPL-164003 [Trust and Open Project] show "system" path and specific paths for a project in the tooltip
(cherry picked from commit fb2028deea0413251ed6c5e49e9b5fc78797e108)

IJ-CR-147809

GitOrigin-RevId: 0926a1f32208732a04d3e14abab510e560720705
2024-10-25 21:33:11 +00:00
Vladimir Krivosheev
996401954f IJ-CR-147193 IJPL-161796 cleanup - part 2 and fix api check
(cherry picked from commit a567b2f79121f8349f4046dc0cf140db3af527ac)

GitOrigin-RevId: 75656a4209713201dc0e49aa2462f527775f00ed
2024-10-22 07:27:04 +00:00
Nikita.Skvortsov
c3424d30d6 [gradle] Do not set maxParallelForks when not needed IDEA-360693
Do not force test to be run in a single thread unless this task is going to be debugged.


(cherry picked from commit e90d2c89d07119d4fc5c394d709ebdcace989805)

IJ-CR-146790

GitOrigin-RevId: 03e1b1b29a33e0e28086ba04053bd30d350b042a
2024-10-18 10:47:23 +00:00
Vladimir Krivosheev
837cdcffe7 IJPL-162718 fix GradleKotlinNewProjectWizardTest
GitOrigin-RevId: f0c2977b9b14906f289754c602063cc28c490a81
2024-10-14 22:49:12 +00:00
Vladimir Krivosheev
17b5c9688b IJPL-162718 wizard: non-blocking project creation
GitOrigin-RevId: 84810b3acdc12c703a255a86355d2d57c8a47913
2024-10-14 22:49:12 +00:00
Vladimir Krivosheev
387be9d569 IJ-CR-146078 extract intellij.platform.ide.ui
GitOrigin-RevId: 1d77381f1bcc811dbf644e47e70972a572c095f2
2024-10-10 23:38:08 +00:00
Mikhail Filippov
b1f3319f6c convert GradleToolWindowTest to Kotlin
GitOrigin-RevId: 2e565495930cfc72a8f8b8918b8c74b17516b3ce
2024-10-02 13:39:22 +00:00
Sergei Vorobyov
0923ad9cc6 [Gradle|Debug] cleanup: removed redundant Gradle JVM options joining function
Code review: IJ-CR-144595

GitOrigin-RevId: 86fb45c4d9d0a022bb027207bb6badfa25901bed
2024-09-30 13:54:40 +00:00
Sergei Vorobyov
cdfeb0f4f4 [Gradle|Debug] cleanup: removed redundant Gradle init script splitting
Code review: IJ-CR-144595

GitOrigin-RevId: 3dc55c3a94da59e7f40341c376d7adb765c214e8
2024-09-30 13:54:40 +00:00
Frederik Haselmeier
267b8ea65b [kotlin] Added AbstractGradleModuleBuilder method to disable settings script generation
KTIJ-31047

GitOrigin-RevId: e74d61a7dd113bf225f0df9ade691aee3781dd91
2024-09-30 11:50:37 +00:00
Frederik Haselmeier
c593d50a45 [kotlin] Added option to generate Kotlin/Gradle projects using buildSrc and convention plugins
KTIJ-31047

GitOrigin-RevId: 7eb3fca36a1dcbcca51760533c22e44da017910d
2024-09-30 11:50:37 +00:00
Sergei Vorobyov
e3da0bb5d9 [Java|Gradle|Sync] cleanup: renamed JarTaskManifestConfiguration to JavaGradleManifestModel
GitOrigin-RevId: c898c9ac1a1d7dd9e20efecb9e7908f201b6d43e
2024-09-27 18:39:57 +00:00
Sergei Vorobyov
b1d4df714d [Java|Gradle|Sync|IsolatedProject] fix: build JarTaskManifestConfiguration without using GradleTaskIndex
Issues IDEA-35499

GitOrigin-RevId: f01a1beae0e67b1c1667b5ae7d922f8b51ac6ed7
2024-09-27 18:39:57 +00:00
Vladimir Krivosheev
e881a06df7 IJPL-162718 convert ProjectBuilder to kotlin
GitOrigin-RevId: c7b1ecffbaf0641b415f8697d74a692800d0bbee
2024-09-27 13:50:50 +00:00
Sergei Vorobyov
ccbae49228 IDEA-356996 fix: don't execute inherited application run configuration in the delegated to Gradle execution mode
All run configurations that can be run in the Gradle delegated mode should implement GradleExecutionEnvironmentProvider. It is already implemented for Micronaut, Ktor and Spring Boot.

GitOrigin-RevId: d4262bd31745f5f908e158d22d7c4e7b0618942f
2024-09-24 17:15:34 +00:00
Alexander.Glukhov
f10dc3c4ff [gradle][test][IDEA-347975] added Gradle configuration cache validity test between Run and Debug
GitOrigin-RevId: 9409305df54bef3b5f6509feed348b1600e1ad37
2024-09-24 12:38:26 +00:00
Alexander.Glukhov
39d31f3e18 [gradle][test][IDEA-359126] Use TargetVersions to limit expected versions of Gradle instead of disabling the test
GitOrigin-RevId: 6cd7dcbcc78539eb1f61393e96bc5b2a27b17f1d
2024-09-23 12:38:35 +00:00
Sergei Vorobyov
58244594be [NPW|Assets] fix: don't resolve PSI files on EDT for opening a build script in the editor
Issues: IDEA-349863, IDEA-341180

GitOrigin-RevId: 18d93c66eca918e4bfc4e34231a61850df43138e
2024-09-17 18:46:15 +00:00
Nikita Biriukov
9ce2071a66 [gradle][android] IDEA-347852 considers version catalogs in included builds of a composite build.
Each included build (linked project) could have its own version catalogs, different to the catalogs of a root composite build. This change makes possible accessing version catalogs of an included build.

Also, it enables navigation from a build script (either Groovy or Kts) in an included build to a corresponding version catalog.
For example, from `/app/build.gradle` to `/app/gradle/libs.versions.toml`, where `app` is a build included in the settings file of the composite build using `includeBuild("app")`

GitOrigin-RevId: ed5d68cb91e7fe74c0af1755e3cbfa7b3b2d1abf
2024-09-16 17:34:49 +00:00
Tagir Valeev
05de6a6bdb Less raw types
GitOrigin-RevId: 2a6e712b4017cf1ead7870543e562acb654fbeaf
2024-09-16 11:23:15 +00:00
Yuriy Artamonov
54eaccabd8 [actions] IJPL-162291 Introduce MarkRootsManager as API for modifying roots from actions
GitOrigin-RevId: 02a2951fd54f52e637638e4a1a865916b009d7f3
2024-09-15 19:04:25 +00:00
Alexander.Glukhov
6c4b31c174 [gradle][test][IDEA-359161] disabled the test for the deprecated Gradle feature
GitOrigin-RevId: b3189ec783e7deb7a153d9e77f985376d94d09a7
2024-09-13 13:50:21 +00:00
Alexander.Glukhov
7773091d81 [gradle][test][IDEA-359126] fix deprecation warnings related to absent associated project dir
Gradle will warn if a project is added to the build where the associated projectDir does not exist or is not writable. Starting with version 9.0, Gradle will not run builds if a project directory is missing or read-only.

GitOrigin-RevId: cc34d50f0e02a7a30e041196fbc8e108a315450f
2024-09-13 13:50:21 +00:00
Sergei Vorobyov
0029187d26 [NPW|Assets] cleanup: removed unnecessary setupProject function overriding in assets NPW step
GitOrigin-RevId: e0a7ccba795b350f04abb2a8b92d41647211c800
2024-09-12 18:46:03 +00:00
Sergei Vorobyov
141b466cee [NPW|Assets] cleanup: extracted Java and Kotlin sample template name producers
GitOrigin-RevId: 1c5562f13b072e7f4a06453cee640b29d2599010
2024-09-12 18:46:03 +00:00
Sergei Vorobyov
34339a5d9d [NPW|Gradle] cleanup: fixed warning: Remove redundant qualifier name
GitOrigin-RevId: 9726d256627c6b0c36f1e8524fd1044540d39004
2024-09-12 18:46:03 +00:00
Sergei Vorobyov
cf7e185337 [NPW|Gradle] cleanup: split linkGradleProject function by the three setupBuilder, setupBuildScript and setupProject
GitOrigin-RevId: b37d1691736adbc90a6c4547252a718e48b123c9
2024-09-12 18:46:03 +00:00
Sergei Vorobyov
5e307b534b [NPW|Assets] cleanup: migrated assets steps for the Java project on the AssetsJava util
GitOrigin-RevId: 40a0d69cf7a288df080f7fecaa6967d56d22b44b
2024-09-12 12:23:20 +00:00
Alexander.Glukhov
b868984220 [gradle][debugger][IDEA-347975] implemented a configuration-cache safe init-script for Gradle debug
GitOrigin-RevId: 602dd9a2cb0f96183bf9b82e30239789ccb6018f
2024-09-11 11:21:30 +00:00
Alexander.Glukhov
684ea91f1a [gradle][debugger][IDEA-347975] added a way to create a cache-friendly debugger extension that can be configured via ENV
GitOrigin-RevId: 3ad64f6dd9b9dcd7df34d3797c69223021c8ff65
2024-09-11 11:21:30 +00:00
Alexander.Glukhov
e851d99b4e [gradle][IDEA-347975] added a way to pass environment variables from GradleProjectResolverExtension into execution
GitOrigin-RevId: f859b809a08e9ace79985f05045dee492441653d
2024-09-11 11:21:30 +00:00
Alexander.Glukhov
9fd43d8890 [gradle][cleanup][IDEA-352898] minor cleanup in GradleWrapperUtil
GitOrigin-RevId: 663a40f674a18fb7c3c2d599db88c43a9bc3ec52
2024-09-09 12:19:37 +00:00
Roman Shevchenko
a5666abead [project] pruning FileChooserDescriptor overrides (IJPL-150176 prerequisite)
`BrowseFolderRunnable` and `*WithBrowseButton` family: getting rid of separate "title" and "description" parameters in favor of the chooser descriptor object, to avoid cloning the latter down the road.

GitOrigin-RevId: 33ec5968a1db953c60848974135055c288accf85
2024-09-06 11:41:43 +00:00
Sergei Vorobyov
9f3a303592 IDEA-163185 [Gradle|Sync] fix: resolve content roots in the same way in the Gradle sync contributor and project resolver
GitOrigin-RevId: b56c07b83b3cbbc5fc18950047ef813fb9ea9280
2024-09-02 18:09:20 +00:00
Alexander.Glukhov
ec4fd6b7b1 [gradle][IJ-CR-132834] do not add duplicated repositories into project data nodes
GitOrigin-RevId: d823f5560e54c137f3f04aebfc13f073c14495fd
2024-08-27 15:02:33 +00:00
Alexander.Glukhov
9c755066db [gradle][IJ-CR-132834] renamed DefaultRepositoriesModel to DefaultRepositoryModels
GitOrigin-RevId: bd72860ae6ab738a5f6d45a060903fecfd221e7f
2024-08-27 15:02:33 +00:00
Nikita.Skvortsov
eb7a9fe34d [gradle] fix flaky test IDEA-357790
The previous test (ExternalAnnotationsDataServiceTest) sometimes disposes of the whole project. This should not happen.

GitOrigin-RevId: 35125e51ffdfd59c147878b9dc512c184303fac2
2024-08-27 14:32:43 +00:00
Vladimir Krivosheev
e3af69868a introduce BuildTargetHashSupplier (simplify build target fingerprint calculation)
GitOrigin-RevId: f810aed3a678cb36212d68c7539f6893bbe68cf2
2024-08-22 19:11:14 +00:00
Alexander.Glukhov
5a028189b9 [gradle][IDEA-357700] fix assertations of a few tests according to changes in Gradle 8.10
GitOrigin-RevId: 3930acbfa018c41222f5daead55efd71cf1c4d1a
2024-08-16 15:09:04 +00:00
Nikita Biriukov
c633b6cad2 [gradle][kotlin] KTIJ-30393 cleanup: drop "InPluginsBlock" suffix when extracting a version catalog name from PsiClass
GitOrigin-RevId: ece821cda0e51ca01ffd1c82698b6fadac15feb9
2024-08-14 14:00:17 +00:00
Lev Serebryakov
5f90cbabfe IJPL-149317 Disable Write Intent Lock for runnables executed on EDT
Add explicit locks in Gradle community plugin.

GitOrigin-RevId: 48878f33ae568b014706d27c18a951ff7701cd61
2024-08-13 17:24:47 +00:00
Gregory.Shrago
c98b16d7a2 migrate non-typesafe getData: community
GitOrigin-RevId: 9925045d5302a768b5f57d9f965c96c631d14114
2024-08-07 02:37:34 +00:00
Yuriy Artamonov
40ee9543ab [icons] Eliminate CrossModuleIcons.json
All icons reside in the corresponding modules now

GitOrigin-RevId: c5fe0b11a37256d1cae4d2067f17c6802a7721b8
2024-08-03 10:12:40 +00:00
Sergei Vorobyov
dd819552ad FUS-2534 [Gradle|FUS] fix: doesn't register twice the same new project wizard stat collector group
GitOrigin-RevId: 59e6dc5ffeb80d077afe47567d58a9d454c0a273
2024-08-02 13:07:11 +00:00