aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/share/nvim/site/autoload/neomake/makers/ft/java/classpath.gradle
blob: f548c0d0ec7314d14e7995f8b0dac4adc09b285f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
task classpath << {

  String finalFileContents = ""
  HashSet<String> classpathFiles = new HashSet<String>()
  for (proj in allprojects) {

    def exploded = proj.getBuildDir().absolutePath + File.separator + "intermediates" + File.separator + "exploded-aar"
    def listFiles = new File(exploded)
    if (listFiles.exists()) {
      listFiles.eachFileRecurse(){ file ->
        if (file.name.endsWith(".jar")){
          classpathFiles += file
        }
      }
    }

    def rjava = proj.getBuildDir().absolutePath + File.separator + "intermediates" + File.separator + "classes" + File.separator + "debug"
    def rFiles = new File(rjava)
    if (rFiles.exists()) {
      classpathFiles += rFiles
    }

    for (conf in proj.configurations) {
        for (dependency in conf) {
            if (dependency.name.endsWith("aar")){
            } else {
              classpathFiles += dependency
            }
        }
    }
    if (proj.hasProperty("android")){
      classpathFiles += proj.android.bootClasspath
    }

    if (proj.hasProperty("sourceSets")) {

      for (srcSet in proj.sourceSets) {
          for (dir in srcSet.java.srcDirs) {
              classpathFiles += dir.absolutePath
          }
      }
    }
  }
  def paths = classpathFiles.join(File.pathSeparator)
  println "CLASSPATH:" + paths
}