Comments (21)
Please provide as small as possible project sample and steps to reproduce the problem, I'll try to do something with it.
And just to make it clearer:
However, for the test task it is true.
ideally the gradle plugin should do this automatically
Plugin automatically and intentionally sets it to true.
The property should be true in tests. Actually this property was invented mostly for tests in order to make them faster.
at least provide a method like setupSystemProperties.
Since you can work around it by manually defining the property
you don't need such method.
from intellij-platform-gradle-plugin.
Please provide as small as possible project sample and steps to reproduce the problem, I'll try to do something with it.
I will do it, but I need some time. In the meantime here is the actual project where I am facing the issue: https://github.com/alexeykudinkin/intellij-rust .
Since you can work around it by manually defining the property you don't need such method.
Agree :) The point is that I've spent quite some time tracing the failing tests down to classpath.index
file in the build directory. If the workaround is necessary, it is better advertised in the form of a documentation or API call.
from intellij-platform-gradle-plugin.
I've found how IDEA invalidates classpath.index, but still need some example to test.
from intellij-platform-gradle-plugin.
Here you are: https://github.com/matklad/test-plugin
- run
gradle test
- rename
foo.Foo
tofoo.Bar
(both insrc
and intest
) - run
gradle test
again
foo.SimpleTest > testFoo FAILED
java.lang.NoClassDefFoundError at SimpleTest.java:9
Caused by: java.lang.ClassNotFoundException at SimpleTest.java:9
from intellij-platform-gradle-plugin.
Looks like the real speed up can be noticed on IDEA project only. It's easier to disable indexing classpath in tests.
Will be fixed in 0.0.27
from intellij-platform-gradle-plugin.
this flag is needed for starting IDEA from IDEA
from intellij-platform-gradle-plugin.
@nicity flag is always false while running IDEA from IDEA in plugin-projects https://github.com/JetBrains/intellij-community/blob/master/plugins/devkit/src/run/PluginRunConfiguration.java#L143
from intellij-platform-gradle-plugin.
Right, plugin-project is not IDEA project
from intellij-platform-gradle-plugin.
@nicity I thought that the flag is always true for tests but looks like I missed the condition about IDEA project here https://github.com/JetBrains/intellij-community/blob/master/plugins/devkit/src/run/JUnitDevKitPatcher.java#L50
There is no classloader customization for non-idea project, so the flag doesn't affect anything.
from intellij-platform-gradle-plugin.
https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/util/lang/UrlClassLoader.java#L46
https://github.com/JetBrains/intellij-community/blob/master/platform/util/src/com/intellij/util/lang/UrlClassLoader.java#L109
from intellij-platform-gradle-plugin.
@nicity and still we don't run IDEA from IDEA with UrlClassLoader, only tests in IDEA project
from intellij-platform-gradle-plugin.
BootstrapClassLoaderUtil near word usePersistentClasspathIndexForLocalClassDirectories
from intellij-platform-gradle-plugin.
@nicity I see, thanks
from intellij-platform-gradle-plugin.
Huh looks that this problem is still there, probably with the new com.intellij.util.lang.PathClassLoader
which puts classpath.index
into build/classes/
all the time, thus effectively disabling Gradle caching mechanism... I'll open a separate issue though
from intellij-platform-gradle-plugin.
@PawelLipski That happens just during the code instrumentation task, right?
from intellij-platform-gradle-plugin.
I'm not sure, still researching... but probably not only. I've disabled the following tasks:
buildPlugin.enabled = false
buildSearchableOptions.enabled = false
downloadRobotServerPlugin.enabled = false
instrumentCode.enabled = false
instrumentTestCode.enabled = false
instrumentUiTestCode.enabled = false
jarSearchableOptions.enabled = false
patchPluginXml.enabled = false
prepareSandbox.enabled = false
prepareTestingSandbox.enabled = false
prepareUiTestingSandbox.enabled = false
publishPlugin.enabled = false
runIde.enabled = false
runIdeForUiTests.enabled = false
setupInstrumentCode.enabled = false
verifyPlugin.enabled = false
but still seeing classpath.index generated, and Gradle reporting that it doesn't know where classpath.index
came from, and hence disabling caching for the affected output directory :/
from intellij-platform-gradle-plugin.
Have you tried 1.7.0-SNAPSHOT?
from intellij-platform-gradle-plugin.
Also! as a workaround, I tried setting
test {
systemProperty "idea.classpath.index.enabled", "false"
}
and/or passing ./gradlew -Didea.classpath.index.enabled=false
... but to no avail. The only workaround I've found so far is to just
find . -name classpath.index -delete || true
right after running the tests ://
from intellij-platform-gradle-plugin.
Have you tried 1.7.0-SNAPSHOT?
Huh lemme check 🤔
from intellij-platform-gradle-plugin.
The same with 1.7.0-SNAPSHOT
... looks that it's happening in <project>:test
actually!
> Task :test
OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "com.intellij.util.lang.PathClassLoader"). To use archived non-system classes, this property must be not be set
Class loader is apparently set to com.intellij.util.lang.PathClassLoader
in tests of modules where gradle-intellij-plugin is enabled... and this seems to lead to classpath.index showing up in build/classes/
for these modules :/
from intellij-platform-gradle-plugin.
Opened #1039, let's track it there instead
from intellij-platform-gradle-plugin.
Related Issues (20)
- Task buildSearchableOptions does not work properly with IntelliJ 2024.2 HOT 1
- No custom plugins in IDE running by custom `RunIde` task since beta8 HOT 1
- Avoid dependency to undertow 2.3.14.Final HOT 1
- collectBundledPluginsJars returning a relative path outside the platform root HOT 1
- Cannot build project: "Failed to transform" error HOT 7
- dependencies { intellijPlatform { local(...) } } doesn't seem to work HOT 2
- Simplify introduction of optional dependencies across multiple IDEs
- `signPlugin` fails with "No Marketplace ZIP Signer executable found" HOT 9
- 2.0.0-beta9 fail plugin resolution in multimodule setup HOT 1
- ProductReleasesValueSource.FilterParameters.sinceBuild is marked optional, when its required HOT 4
- :testIdeUi FAILED — `NoClassDefFoundError` after upgrading to v2.0.0-RC1 HOT 3
- org.apache.velocity.exception.VelocityException: Could not initialize property keys deprecation map because DeprecatedRuntimeConstants.__$hits$__ field isn't properly named HOT 5
- Missing `eap` field for `productDescriptor` HOT 1
- sometimes getting error in build Could not resolve all files for configuration HOT 2
- Duplicate caches take up disk space HOT 1
- ConfigurationCacheError with 2.0.0-rc1 and Idea 2023.3 HOT 2
- No IntelliJ Platform dependency found when running test HOT 4
- java.lang.NoClassDefFoundError: com/intellij/util/containers/ObjectIntMap HOT 2
- Ultimate service instances are not created in tests HOT 2
- NoClassDefFoundError: junit/framework/TestCase & org/junit/rules/TestRule HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellij-platform-gradle-plugin.