J2K PathUtil: convert and prettify
This commit is contained in:
@@ -25,7 +25,7 @@ class AllOpenGradleProjectImportHandler : AbstractGradleImportHandler() {
|
||||
override val pluginName = "allopen"
|
||||
override val annotationOptionName = AllOpenCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val dataStorageTaskName = "allOpenDataStorageTask"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().allOpenPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.allOpenPluginJarPath
|
||||
|
||||
override fun getAnnotationsForPreset(presetName: String): List<String> {
|
||||
for ((name, annotations) in AllOpenCommandLineProcessor.SUPPORTED_PRESETS.entries) {
|
||||
@@ -36,4 +36,4 @@ class AllOpenGradleProjectImportHandler : AbstractGradleImportHandler() {
|
||||
|
||||
return super.getAnnotationsForPreset(presetName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class AllOpenMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
override val pluginName = "allopen"
|
||||
override val annotationOptionName = AllOpenCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val mavenPluginArtifactName = "kotlin-maven-allopen"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().allOpenPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.allOpenPluginJarPath
|
||||
|
||||
override fun getAnnotations(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>? {
|
||||
if ("all-open" !in enabledCompilerPlugins && "spring" !in enabledCompilerPlugins) {
|
||||
@@ -51,4 +51,4 @@ class AllOpenMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
|
||||
return annotations
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -151,7 +151,7 @@ abstract class AbstractKotlinKapt3IntegrationTest : CodegenTestCase() {
|
||||
options: Map<String, String>,
|
||||
stubsOutputDir: File,
|
||||
incrementalDataOutputDir: File
|
||||
) : AbstractKapt3Extension(PathUtil.getJdkClassesRootsFromCurrentJre() + PathUtil.getKotlinPathsForIdeaPlugin().stdlibPath,
|
||||
) : AbstractKapt3Extension(PathUtil.getJdkClassesRootsFromCurrentJre() + PathUtil.kotlinPathsForIdeaPlugin.stdlibPath,
|
||||
emptyList(), javaSourceRoots, outputDir, outputDir,
|
||||
stubsOutputDir, incrementalDataOutputDir, options, emptyMap(), "", STUBS_AND_APT, System.currentTimeMillis(),
|
||||
KaptLogger(true), correctErrorTypes = true, compilerConfiguration = CompilerConfiguration.EMPTY
|
||||
@@ -188,4 +188,4 @@ abstract class AbstractKotlinKapt3IntegrationTest : CodegenTestCase() {
|
||||
super.saveIncrementalData(kaptContext, messageCollector, converter)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,10 +124,10 @@ abstract class AbstractKotlinKaptContextTest : AbstractKotlinKapt3Test() {
|
||||
val sourceOutputDir = Files.createTempDirectory("kaptRunner").toFile()
|
||||
try {
|
||||
kaptContext.doAnnotationProcessing(emptyList(), listOf(JavaKaptContextTest.simpleProcessor()),
|
||||
compileClasspath = PathUtil.getJdkClassesRootsFromCurrentJre() + PathUtil.getKotlinPathsForIdeaPlugin().stdlibPath,
|
||||
annotationProcessingClasspath = emptyList(), annotationProcessors = "",
|
||||
sourcesOutputDir = sourceOutputDir, classesOutputDir = sourceOutputDir,
|
||||
additionalSources = compilationUnits, withJdk = true)
|
||||
compileClasspath = PathUtil.getJdkClassesRootsFromCurrentJre() + PathUtil.kotlinPathsForIdeaPlugin.stdlibPath,
|
||||
annotationProcessingClasspath = emptyList(), annotationProcessors = "",
|
||||
sourcesOutputDir = sourceOutputDir, classesOutputDir = sourceOutputDir,
|
||||
additionalSources = compilationUnits, withJdk = true)
|
||||
|
||||
val javaFiles = sourceOutputDir.walkTopDown().filter { it.isFile && it.extension == "java" }
|
||||
val actualRaw = javaFiles.sortedBy { it.name }.joinToString(FILE_SEPARATOR) { it.name + ":\n\n" + it.readText() }
|
||||
@@ -137,4 +137,4 @@ abstract class AbstractKotlinKaptContextTest : AbstractKotlinKapt3Test() {
|
||||
sourceOutputDir.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.noarg.ide
|
||||
|
||||
import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor
|
||||
import org.jetbrains.kotlin.annotation.plugin.ide.AbstractGradleImportHandler
|
||||
import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
|
||||
class NoArgGradleProjectImportHandler : AbstractGradleImportHandler() {
|
||||
@@ -25,7 +25,7 @@ class NoArgGradleProjectImportHandler : AbstractGradleImportHandler() {
|
||||
override val pluginName = "noarg"
|
||||
override val annotationOptionName = NoArgCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val dataStorageTaskName = "noArgDataStorageTask"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().noArgPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.noArgPluginJarPath
|
||||
|
||||
override fun getAnnotationsForPreset(presetName: String): List<String> {
|
||||
for ((name, annotations) in NoArgCommandLineProcessor.SUPPORTED_PRESETS.entries) {
|
||||
@@ -36,4 +36,4 @@ class NoArgGradleProjectImportHandler : AbstractGradleImportHandler() {
|
||||
|
||||
return super.getAnnotationsForPreset(presetName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.noarg.ide
|
||||
|
||||
import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor
|
||||
import org.jetbrains.kotlin.annotation.plugin.ide.AbstractMavenImportHandler
|
||||
import org.jetbrains.kotlin.noarg.NoArgCommandLineProcessor
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
|
||||
class NoArgMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
@@ -29,7 +29,7 @@ class NoArgMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
override val pluginName = "noarg"
|
||||
override val annotationOptionName = NoArgCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val mavenPluginArtifactName = "kotlin-maven-noarg"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().noArgPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.noArgPluginJarPath
|
||||
|
||||
override fun getAnnotations(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>? {
|
||||
if ("no-arg" !in enabledCompilerPlugins && "jpa" !in enabledCompilerPlugins) {
|
||||
@@ -50,4 +50,4 @@ class NoArgMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
|
||||
return annotations
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ class SamWithReceiverGradleProjectImportHandler : AbstractGradleImportHandler()
|
||||
override val pluginName = "sam-with-receiver"
|
||||
override val annotationOptionName = SamWithReceiverCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val dataStorageTaskName = "samWithReceiverDataStorageTask"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().allOpenPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.allOpenPluginJarPath
|
||||
|
||||
override fun getAnnotationsForPreset(presetName: String): List<String> {
|
||||
for ((name, annotations) in SamWithReceiverCommandLineProcessor.SUPPORTED_PRESETS.entries) {
|
||||
@@ -36,4 +36,4 @@ class SamWithReceiverGradleProjectImportHandler : AbstractGradleImportHandler()
|
||||
|
||||
return super.getAnnotationsForPreset(presetName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ class SamWithReceiverMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
override val pluginName = "samWithReceiver"
|
||||
override val annotationOptionName = SamWithReceiverCommandLineProcessor.ANNOTATION_OPTION.name
|
||||
override val mavenPluginArtifactName = "kotlin-maven-sam-with-receiver"
|
||||
override val pluginJarFileFromIdea = PathUtil.getKotlinPathsForIdeaPlugin().allOpenPluginJarPath
|
||||
override val pluginJarFileFromIdea = PathUtil.kotlinPathsForIdeaPlugin.allOpenPluginJarPath
|
||||
|
||||
override fun getAnnotations(enabledCompilerPlugins: List<String>, compilerPluginOptions: List<String>): List<String>? {
|
||||
if ("sam-with-receiver" !in enabledCompilerPlugins) {
|
||||
@@ -51,4 +51,4 @@ class SamWithReceiverMavenProjectImportHandler : AbstractMavenImportHandler() {
|
||||
|
||||
return annotations
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class SourceSectionsTest : TestCaseWithTmpdir() {
|
||||
}
|
||||
|
||||
private val kotlinPaths: KotlinPaths by lazy {
|
||||
val paths = PathUtil.getKotlinPathsForDistDirectory()
|
||||
val paths = PathUtil.kotlinPathsForDistDirectory
|
||||
TestCase.assertTrue("Lib directory doesn't exist. Run 'ant dist'", paths.libPath.absoluteFile.isDirectory)
|
||||
paths
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user