Skip to content

Commit 5cf3b85

Browse files
committed
chore: fmt
Signed-off-by: melodicore <datafox@datafox.me>
1 parent e4fd3f6 commit 5cf3b85

12 files changed

Lines changed: 413 additions & 420 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This plugin can be consumed in a Maven project to use [Elide](https://elide.dev)
1717

1818
### Elide Plugin
1919

20-
The easiest way to start using Elide in your project is the `elide-maven-plugin`. Enable it and set `extensions` to
20+
The easiest way to start using Elide in your project is the `elide-maven-plugin`. Enable it and set `extensions` to
2121
`true` and all of your Java and Kotlin sources will be compiled with Elide `javac` and `kotlinc`.
2222

2323
**`pom.xml`**
@@ -39,7 +39,7 @@ The easiest way to start using Elide in your project is the `elide-maven-plugin`
3939
4040
### Kotlin drop-in replacement
4141

42-
If you already have a project that uses the `kotlin-maven-plugin`, you can use the `elide-kotlin-maven-plugin` as a
42+
If you already have a project that uses the `kotlin-maven-plugin`, you can use the `elide-kotlin-maven-plugin` as a
4343
drop-in replacement. It supports all configuration you would expect from the Kotlin Maven plugin.
4444

4545
**`pom.xml`**

elide-plugin/src/main/resources/META-INF/plexus/components.xml

Lines changed: 191 additions & 191 deletions
Large diffs are not rendered by default.

java-compiler/src/main/kotlin/dev/elide/maven/compiler/Constants.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ package dev.elide.maven.compiler
1515
/** Constant ID used by the Elide compiler shim. */
1616
const val ELIDE_COMPILER: String = "elide"
1717

18-
val ELIDE_EXECUTABLE: String =
19-
if (System.getProperty("os.name").contains("windows", true)) "elide.exe" else "elide"
18+
val ELIDE_EXECUTABLE: String = if (System.getProperty("os.name").contains("windows", true)) "elide.exe" else "elide"

java-compiler/src/main/kotlin/dev/elide/maven/compiler/ElideJavacCompiler.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ open class ElideJavacCompiler : JavacCompiler() {
108108
.run {
109109
isAccessible = true
110110
@Suppress("UNCHECKED_CAST")
111-
invoke(null, returnCode, BufferedReader(StringReader(out.output))) as MutableList<CompilerMessage>
111+
invoke(null, returnCode, BufferedReader(StringReader(out.output)))
112+
as MutableList<CompilerMessage>
112113
}
113-
val last = out.output.lines().reversed().let {
114-
for (line in it) {
115-
if (line.isNotBlank()) return@let line
114+
val last =
115+
out.output.lines().reversed().let {
116+
for (line in it) if (line.isNotBlank()) return@let line
117+
""
116118
}
117-
""
118-
}
119119
if (last.isNotBlank()) {
120120
if (last.contains("")) messages.add(CompilerMessage(last, CompilerMessage.Kind.NOTE))
121121
else if (last.contains("")) messages.add(CompilerMessage(last, CompilerMessage.Kind.ERROR))

java-compiler/src/main/kotlin/dev/elide/maven/compiler/ElideLocator.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ import java.nio.file.Paths
2323
* @since 1.0.0
2424
*/
2525
object ElideLocator {
26-
/**
27-
* Checks if a path is a valid binary.
28-
*/
26+
/** Checks if a path is a valid binary. */
2927
private fun isValidElideBinary(path: Path): Boolean {
3028
return path.toFile().exists() && path.toFile().isFile && path.toFile().canExecute()
3129
}

java-compiler/src/test/kotlin/dev/elide/maven/compiler/ElideJavacCompilerTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ class ElideJavacCompilerTest {
3434
@Test
3535
fun `can retrieve elide javac version`() {
3636
val compiler = ElideJavacCompiler()
37-
val version = assertNotNull(compiler.getElideJavacVersion(ELIDE_PATH.absolutePathString()), "Elide javac version could not be retrieved")
37+
val version =
38+
assertNotNull(
39+
compiler.getElideJavacVersion(ELIDE_PATH.absolutePathString()),
40+
"Elide javac version could not be retrieved",
41+
)
3842
val versionInt = assertDoesNotThrow("Retrieved version should be an integer") { version.toInt() }
3943
assertTrue(versionInt >= 25, "Retrieved version should be 25 or higher")
4044
}

kotlin-plugin/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<packaging>maven-plugin</packaging>
1111

1212
<name>Elide Kotlin Maven Plugin</name>
13-
<description>A drop-in replacement for the Kotlin Maven Plugin that uses Elide to compile Kotlin sources.</description>
13+
<description>A drop-in replacement for the Kotlin Maven Plugin that uses Elide to compile Kotlin sources.
14+
</description>
1415
<url>https://elide.dev</url>
1516

1617
<licenses>

kotlin-plugin/src/main/kotlin/dev/elide/maven/plugin/kotlin/ArgumentParser.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
*/
1313
package dev.elide.maven.plugin.kotlin
1414

15-
import java.lang.reflect.Field
16-
import java.util.*
1715
import org.apache.maven.project.MavenProject
1816
import org.jetbrains.kotlin.cli.common.arguments.Argument
1917
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
18+
import java.lang.reflect.Field
19+
import java.util.*
2020

2121
/**
2222
* Parser for Kotlin compiler arguments.

kotlin-plugin/src/main/kotlin/dev/elide/maven/plugin/kotlin/ElideKotlinLifecycleParticipant.kt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,16 @@ open class ElideKotlinLifecycleParticipant : KotlinLifecycleParticipant() {
5757
name: String,
5858
vararg args: Pair<Class<out Any>, out Any?>,
5959
): Boolean =
60-
T::class
61-
.java
62-
.getDeclaredMethod(name, *args.map { it.first }.toTypedArray())
63-
.run {
64-
isAccessible = true
65-
invoke(this@ElideKotlinLifecycleParticipant, *args.map { it.second }.toTypedArray()) as Boolean
66-
}
60+
T::class.java.getDeclaredMethod(name, *args.map { it.first }.toTypedArray()).run {
61+
isAccessible = true
62+
invoke(this@ElideKotlinLifecycleParticipant, *args.map { it.second }.toTypedArray()) as Boolean
63+
}
6764

6865
inline fun <reified T> T.callPrivateFunc(name: String, vararg args: Pair<Class<out Any>, out Any?>) {
69-
T::class
70-
.java
71-
.getDeclaredMethod(name, *args.map { it.first }.toTypedArray())
72-
.apply {
73-
isAccessible = true
74-
invoke(this@ElideKotlinLifecycleParticipant, *args.map { it.second }.toTypedArray())
75-
}
66+
T::class.java.getDeclaredMethod(name, *args.map { it.first }.toTypedArray()).apply {
67+
isAccessible = true
68+
invoke(this@ElideKotlinLifecycleParticipant, *args.map { it.second }.toTypedArray())
69+
}
7670
}
7771

7872
inline fun <reified T> T.callArg() = Pair(T::class.java, this)

0 commit comments

Comments
 (0)