Intellij cannot recognize the src folder via srcDirs properties

wood's Avatar

wood

24 Jan, 2014 05:02 PM

If I specify the sourceSets.main.java.srcDirs += ["./src] in build.gradle for a java project, Intellij will automatically mark the folder as "Sources" and make the folder's icon in blue. However, intellij wont automatically the folder as "Sources" by srcDirs = ["src"] for a flex project. If I manually mark it as Sources in project settings, it will rollback to the normal folder after I run gradle build.

  1. Support Staff 1 Posted by Yennick Trevels on 24 Jan, 2014 06:55 PM

    Yennick Trevels's Avatar

    Hi,

    Currently GradleFx doesn't support Intellij (and GradleFx does not use sourceSets to define source folders), so that's why Intellij isn't picking it up.
    As for the rollback, not sure why that happens. Is the idea task being run whenever you do a build which could reset this?

    Gr,
    Yennick

  2. Support Staff 2 Posted by Maxime Cowez on 24 Jan, 2014 08:04 PM

    Maxime Cowez's Avatar

    Perhaps Wood means running the Gradle build through IntelliJ. I've never used this feature, but I can imagine that JetGradle (that's the IntelliJ Gradle integration plugin) does this rollback because it can't find a valid sourcePath (because it doesn't know about GradleFx' srcDirs config.

    @Wood If that's the case, perhaps you can work around the issue by adding the Flex sourcce dir to the java source sets. GradleFx will ignore it and hopefully it will prevent IntelliJ from resetting the source folders. I doubt you'll have any luck building with JetGradle and GradleFx though.
    I briefly talked to someone at JetBrains about integrating GradleFx, but I think our user base is a bit too small at the moment to get anything done in that area.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac