Rename -module argument to -Xbuild-file

To prevent confusion with Java 9 module-related arguments

 #KT-18754 Fixed
This commit is contained in:
Alexander Udalov
2017-06-23 20:59:01 +03:00
parent 6200d07808
commit 55468735df
15 changed files with 71 additions and 69 deletions
@@ -88,7 +88,7 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
args: K2JVMCompilerArguments,
environment: GradleCompilerEnvironment
): ExitCode {
val moduleFile = makeModuleFile(
val buildFile = makeModuleFile(
args.moduleName,
isTest = false,
outputDir = args.destinationAsFile,
@@ -96,22 +96,22 @@ internal class GradleCompilerRunner(private val project: Project) : KotlinCompil
javaSourceRoots = javaSourceRoots,
classpath = args.classpathAsList,
friendDirs = args.friendPaths?.map(::File) ?: emptyList())
args.module = moduleFile.absolutePath
args.buildFile = buildFile.absolutePath
if (environment !is GradleIncrementalCompilerEnvironment) {
args.destination = null
}
var deleteModuleFile = true
var deleteBuildFile = true
try {
val res = runCompiler(K2JVM_COMPILER, args, environment)
deleteModuleFile = (res == ExitCode.OK || System.getProperty("kotlin.compiler.leave.module.file.on.error") == null)
deleteBuildFile = (res == ExitCode.OK || System.getProperty("kotlin.compiler.leave.module.file.on.error") == null)
return res
}
finally {
if (deleteModuleFile) {
moduleFile.delete()
if (deleteBuildFile) {
buildFile.delete()
}
}
}