From 062af2e60fcc045d73c3c79eb5647106c0162e8f Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 20 Oct 2016 13:26:34 +0300 Subject: [PATCH] add ant classloader (cherry picked from commit bce0477113a2c2d248ab1230f90b50ff94dc7e51) --- .../org/jetbrains/intellij/build/impl/BuildUtils.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/groovy/org/jetbrains/intellij/build/impl/BuildUtils.groovy b/build/groovy/org/jetbrains/intellij/build/impl/BuildUtils.groovy index 197a3abe9eba..c046138d0864 100644 --- a/build/groovy/org/jetbrains/intellij/build/impl/BuildUtils.groovy +++ b/build/groovy/org/jetbrains/intellij/build/impl/BuildUtils.groovy @@ -18,6 +18,7 @@ package org.jetbrains.intellij.build.impl import com.intellij.openapi.util.io.FileUtil import com.intellij.openapi.util.text.StringUtil import groovy.transform.CompileStatic +import org.apache.tools.ant.AntClassLoader import org.apache.tools.ant.BuildException import org.apache.tools.ant.Main import org.apache.tools.ant.Project @@ -42,11 +43,14 @@ class BuildUtils { if (classLoader instanceof GroovyClassLoader) { classLoader.addClasspath(path) } + else if (classLoader instanceof AntClassLoader) { + classLoader.addPathElement(path) + } else if (classLoader instanceof RootLoader) { classLoader.addURL(new File(path).toURI().toURL()) } else { - throw new BuildException("Cannot add to classpath: non-groovy classloader $classLoader") + throw new BuildException("Cannot add to classpath: non-groovy or ant classloader $classLoader") } ant.project.log("'$path' added to classpath", Project.MSG_INFO) }