Fix kotlin-gradle-plugin to correctly process java source files
Do not remove outdirectory from cp in maven: this is needed for gradle-plugin build to see files compiled by gmaven
this may cause problems with running mvn install without clean for kotlin
Remove special magic with groovy-output in gradle-plugin pom.xml
This commit is contained in:
@@ -78,9 +78,6 @@
|
||||
<resource>
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.build.outputDirectory}/../groovyOutput</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
+4
-4
@@ -57,8 +57,8 @@ abstract class AbstractKotlinCompile<T : CommonCompilerArguments>() : AbstractCo
|
||||
return
|
||||
}
|
||||
|
||||
populateTargetSpecificArgs(args)
|
||||
populateCommonArgs(args, sources)
|
||||
populateTargetSpecificArgs(args)
|
||||
callCompiler(args)
|
||||
afterCompileHook(args)
|
||||
}
|
||||
@@ -104,11 +104,11 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
|
||||
val extraProperties = getExtensions().getExtraProperties()
|
||||
args.pluginClasspaths = extraProperties.get("compilerPluginClasspaths") as? Array<String>
|
||||
args.pluginOptions = extraProperties.get("compilerPluginArguments") as? Array<String>
|
||||
// show kotlin compiler where to look for java source files
|
||||
args.freeArgs = (args.freeArgs + getJavaSourceRoots().map { it.getAbsolutePath() }).toSet().toList()
|
||||
|
||||
if (StringUtils.isEmpty(kotlinOptions.classpath)) {
|
||||
val existingClasspathEntries = getClasspath().filter({ it != null && it.exists() })
|
||||
val effectiveClassPath = (getJavaSourceRoots() + existingClasspathEntries).makeString(File.pathSeparator)
|
||||
args.classpath = effectiveClassPath
|
||||
args.classpath = getClasspath().filter({ it != null && it.exists() }).joinToString(File.pathSeparator)
|
||||
}
|
||||
|
||||
args.destination = if (StringUtils.isEmpty(kotlinOptions.destination)) {
|
||||
|
||||
@@ -72,9 +72,6 @@
|
||||
<directory>${project.basedir}/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${project.build.outputDirectory}/../groovyOutput</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
@@ -96,7 +93,6 @@
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||
<sourceDir>${project.build.outputDirectory}/../groovyOutput</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -166,7 +162,6 @@
|
||||
</includes>
|
||||
</fileset>
|
||||
</sources>
|
||||
<outputDirectory>${project.build.outputDirectory}/../groovyOutput</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
-3
@@ -104,9 +104,6 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
||||
}
|
||||
|
||||
ArrayList<String> classpathList = new ArrayList<String>(classpath);
|
||||
if (classpathList.remove(output)) {
|
||||
LOG.debug("Removed target directory from compiler classpath (" + output + ")");
|
||||
}
|
||||
|
||||
if (!classpathList.isEmpty()) {
|
||||
String classPathString = join(classpathList, File.pathSeparator);
|
||||
|
||||
Reference in New Issue
Block a user