# Integrating Gradle in a non-java-specific IDE

**URL:** <https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344>\
**Category:** Help/Discuss\
**Tags:** android, plugins\
**Created:** [June 13, 2018, 1:23pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344 "2018-06-13T13:23:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas-marschke](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/andreas-marschke/32/6807_2.png) [@andreas-marschke](https://discuss.gradle.org/u/andreas-marschke)\
**Post date:** [June 13, 2018, 1:23pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344/1 "2018-06-13T13:23:45Z")

</div>

Hi all!

I am a happy Gradle and Emacs user and would like to add some better integration for gradle to Emacs.

Stuff that is usually a bit harder to do is getting the classpath so completion can be done easily.

Since I am using Gradle on a shared project with other people that do not use Emacs I can’t simply add support code to the gradle project files to support outputting stuff so emacs can read and know about the specific configuration.

I can add stuff like:

```
task classpath {
  configurations.each { configuration ->
    println configuration.compile.resolve().each { println it }
  }
}

```

To log all classpath dependencies, but what I am really looking for is a means to just get that from the cli using either the gradle executable or the wrapper and just ask it for the classpaths for tasks just as I can ask it about the projects and tasks per project.

An option would be to implement something like a cli eval method/task that would allow me to ask for classpaths once the build.gradle file and it’s dependencies has been resolved.

Any tips or ideas here for this? Would it be more beneficial to simply implement a server in Gradle that would ask the Gradle deamon for information?

Kind regards and thanks in advance,

Andreas Marschke.

---

<div class="post-metadata">

**Author:** ![Lance](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance/32/787_2.png) [@Lance](https://discuss.gradle.org/u/Lance)\
**Post date:** [June 13, 2018, 1:35pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344/2 "2018-06-13T13:35:28Z")

</div>

Perhaps you could have an external settings file which you add via command line option

Eg: settings-emacs.gradle

```gradle
gradle.projectsLoaded { Gradle gradle ->
   gradle.rootProject.with {
      task foo {
         doLast { println "$configurations.runtime.files"} 
      } 
   } 
} 

```

You could then do  
`gradle --settings c:/path/settings-emacs.gradle foo`

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [June 13, 2018, 2:24pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344/3 "2018-06-13T14:24:09Z")

</div>

You shouldn’t be using a settings file, but an init script for that. @Lance that’s probably what you meant, because the above won’t work.

---

<div class="post-metadata">

**Author:** ![Lance](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance/32/787_2.png) [@Lance](https://discuss.gradle.org/u/Lance)\
**Post date:** [June 13, 2018, 2:57pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344/4 "2018-06-13T14:57:43Z")

</div>

Ah yeah… whoops  
Correct, I meant an init script with the emacs specific tasks, not a settings

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [June 13, 2018, 3:33pm UTC](https://discuss.gradle.org/t/integrating-gradle-in-a-non-java-specific-ide/27344/5 "2018-06-13T15:33:37Z")

</div>

You can place [init scripts](https://docs.gradle.org/current/userguide/init_scripts.html) in your user home and thus make them transparently executed on every build.
