Skip to content

Commit

Permalink
Merge pull request #13 from stabbylambda/kotlin-1.5
Browse files Browse the repository at this point in the history
Upgrade to Kotlin 1.5
  • Loading branch information
sugarmanz committed May 10, 2021
2 parents a1a5365 + e80096a commit 890f0f1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
3 changes: 3 additions & 0 deletions build.gradle.kts
Expand Up @@ -82,6 +82,9 @@ subprojects {
plugin("jacoco")
plugin("org.jlleitschuh.gradle.ktlint")
}
jacoco {
toolVersion = "0.8.7"
}

if (publishModules.contains(name)) {
apply {
Expand Down
5 changes: 2 additions & 3 deletions compiler-plugin/api/compiler-plugin.api
Expand Up @@ -10,7 +10,6 @@ public class com/intuit/hooks/plugin/HooksMetaPlugin : arrow/meta/Meta {
public fun declarationChecker (Lkotlin/jvm/functions/Function4;)Larrow/meta/phases/config/StorageComponentContainer;
public fun enableIr ()Larrow/meta/phases/ExtensionPhase;
public fun extraImports (Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/analysis/ExtraImports;
public fun installArrowPlugin ()V
public fun intercept (Larrow/meta/phases/CompilerContext;)Ljava/util/List;
public fun irAnonymousInitializer (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irBlock (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
Expand All @@ -35,6 +34,7 @@ public class com/intuit/hooks/plugin/HooksMetaPlugin : arrow/meta/Meta {
public fun irDelegatingConstructorCall (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDoWhileLoop (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDump (Larrow/meta/Meta;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDumpKotlinLike (Larrow/meta/Meta;Lorg/jetbrains/kotlin/ir/util/KotlinLikeDumpOptions;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDynamicExpression (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDynamicMemberExpression (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irDynamicOperatorExpression (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
Expand Down Expand Up @@ -67,7 +67,7 @@ public class com/intuit/hooks/plugin/HooksMetaPlugin : arrow/meta/Meta {
public fun irPropertyReference (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irReturn (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSetField (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSetVariable (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSetValue (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSimpleFunction (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSingletonReference (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
public fun irSpreadElement (Larrow/meta/Meta;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/codegen/ir/IRGeneration;
Expand Down Expand Up @@ -111,7 +111,6 @@ public class com/intuit/hooks/plugin/HooksMetaPlugin : arrow/meta/Meta {
public fun suppressDiagnosticWithTrace (Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/ExtensionPhase;
public fun syntheticResolver (Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/resolve/synthetics/SyntheticResolver;
public fun syntheticScopes (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Larrow/meta/phases/ExtensionPhase;
public fun typeChecker (Larrow/meta/Meta;Lkotlin/jvm/functions/Function1;)Larrow/meta/phases/ExtensionPhase;
public fun updateConfig (Lkotlin/jvm/functions/Function2;)Larrow/meta/phases/config/Config;
}

4 changes: 2 additions & 2 deletions compiler-plugin/build.gradle.kts
Expand Up @@ -11,7 +11,7 @@ dependencies {
pluginDependency("io.arrow-kt", "arrow-annotations", ARROW_VERSION)
pluginDependency("io.arrow-kt", "arrow-syntax", ARROW_VERSION)
pluginDependency("io.arrow-kt", "arrow-core-data", ARROW_VERSION)
pluginDependency("io.arrow-kt", "compiler-plugin", ARROW_META_VERSION)
pluginDependency("io.arrow-kt", "arrow-meta", ARROW_META_VERSION)

compileOnly(kotlin("stdlib"))
compileOnly(kotlin("compiler-embeddable"))
Expand All @@ -28,7 +28,7 @@ dependencies {
testImplementation(project(":hooks"))
testImplementation("io.arrow-kt:arrow-meta-prelude:$ARROW_META_VERSION")
testImplementation("io.arrow-kt:arrow-core:$ARROW_VERSION")
testImplementation("io.arrow-kt:compiler-plugin:$ARROW_META_VERSION")
testImplementation("io.arrow-kt:arrow-meta:$ARROW_META_VERSION")
testImplementation("io.arrow-kt:meta-test:$ARROW_META_VERSION")
}

Expand Down
Expand Up @@ -17,11 +17,11 @@ internal val Meta.hooks: CliPlugin
get() =
"Hooks" {
meta(
classDeclaration(this, KtClass::isHooksDslClass) { c ->
classDeclaration(this, { this.element.isHooksDslClass }) { c ->
findHooks().map<Transform<KtClass>> { codeGen ->
val `package` = c.containingKtFile.packageDirective?.text ?: ""
val `package` = c.element.containingKtFile.packageDirective?.text ?: ""
val (classes, properties) = codeGen.map(::generateHookClass).unzip()
val imports = createImportDirectives(c, codeGen)
val imports = createImportDirectives(c.element, codeGen)

val newSource =
"""|${`package`}
Expand Down
Expand Up @@ -18,7 +18,7 @@ private val KtClass.containsHooksDslImport get() = containingKtFile.importList?.
it.text.contains("com.intuit.hooks.dsl.")
} ?: false

internal fun String.capitalizeFirstLetter(): String = this.mapIndexed { i, c -> if (i == 0) c.toUpperCase() else c }.joinToString(separator = "")
internal fun String.capitalizeFirstLetter(): String = this.mapIndexed { i, c -> if (i == 0) c.uppercaseChar() else c }.joinToString(separator = "")

internal fun CompilerContext.reportHookErrors(invalid: NonEmptyList<HookValidationError>) =
invalid.forEach { messageCollector?.report(it) }
Expand Down
11 changes: 3 additions & 8 deletions gradle.properties
@@ -1,12 +1,7 @@
JVM_TARGET_VERSION=1.8
KOTLIN_VERSION=1.4.21
COROUTINES_VERSION=1.4.0
ARROW_META_VERSION=1.4.10-SNAPSHOT

# These are for our eventual IDE plugin...
#KOTLIN_IDEA_VERSION=203-1.4.21-release-IJ6682.9
#INTELLIJ_IDEA_VERSION=2020.3
#OPENAPI_VERSION=7.0.3
KOTLIN_VERSION=1.5.0
COROUTINES_VERSION=1.5.0-RC
ARROW_META_VERSION=1.5.0-SNAPSHOT

ARROW_VERSION=0.11.0
JUNIT_VERSION=5.7.0
Expand Down

0 comments on commit 890f0f1

Please sign in to comment.