Skip to content

Commit

Permalink
Clean up compiler plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
clementetb committed Sep 17, 2024
1 parent 1992ebe commit 5e6c12c
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 584 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/include-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
required: true
type: string

env:
REALM_DISABLE_ANALYTICS: true
REALM_PRINT_ANALYTICS: true
REALM_FAIL_ON_ANALYTICS_ERRORS: true

jobs:

# TODO: The Monkey seems to crash the app all the time, but with failures that are not coming from the app. Figure out why.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ concurrency:
cancel-in-progress: true

env:
REALM_DISABLE_ANALYTICS: true
REALM_PRINT_ANALYTICS: true
CMAKE_C_COMPILER: /usr/local/bin/ccache-clang
CMAKE_CXX_COMPILER: /usr/local/bin/ccache-clang++
# Workflow environment variables are not available in Job if statements: https://github.com/actions/runner/issues/1661
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package io.realm.kotlin.compiler

import io.realm.kotlin.compiler.FqNames.PACKAGE_MONGODB
import io.realm.kotlin.compiler.FqNames.PACKAGE_MONGODB_INTERNAL
import org.jetbrains.kotlin.name.CallableId
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
Expand Down Expand Up @@ -101,8 +99,6 @@ internal object FqNames {
val PACKAGE_REALM_INTEROP = FqName("io.realm.kotlin.internal.interop")
val PACKAGE_REALM_INTERNAL = FqName("io.realm.kotlin.internal")
val PACKAGE_MONGODB = FqName("io.realm.kotlin.mongodb")
val PACKAGE_MONGODB_INTERNAL = FqName("io.realm.kotlin.mongodb.internal")
val APP_CONFIGURATION_BUILDER = FqName("AppConfiguration.Builder")
}

object ClassIds {
Expand Down Expand Up @@ -161,11 +157,4 @@ object ClassIds {
val REALM_UUID = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("RealmUUID"))
val REALM_MUTABLE_INTEGER = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("MutableRealmInt"))
val REALM_ANY = ClassId(FqNames.PACKAGE_TYPES, Name.identifier("RealmAny"))

// Sync types
val APP = ClassId(PACKAGE_MONGODB, Name.identifier("App"))
val APP_IMPL = ClassId(PACKAGE_MONGODB_INTERNAL, Name.identifier("AppImpl"))
val APP_CONFIGURATION = ClassId(PACKAGE_MONGODB, Name.identifier("AppConfiguration"))
val APP_CONFIGURATION_IMPL = ClassId(PACKAGE_MONGODB_INTERNAL, Name.identifier("AppConfigurationImpl"))
val APP_CONFIGURATION_BUILDER = ClassId(PACKAGE_MONGODB, FqNames.APP_CONFIGURATION_BUILDER, false)
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ class Registrar : org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar {
LoadingOrder.LAST,
project
)
configuration.get(bundleIdConfigurationKey)?.let { bundleId ->
getExtensionPoint(IrGenerationExtension.extensionPointName).registerExtension(
SyncLoweringExtension(bundleId),
project
)
}
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class GenerationExtensionTest {
).joinToString(separator = File.separator)

fun assertGeneratedIR() {
val outputFile = File("${outputDir()}/main/02_AFTER.ValidateIrBeforeLowering.ir")
val outputFile = File("${outputDir()}/main/02_AFTER.JvmValidateIrBeforeLowering.ir")
stripInputPath(outputFile, fileMap)
val expected = File("${expectedDir()}/02_AFTER.ValidateIrBeforeLowering.ir").readText()
val actual = outputFile.readText()
Expand Down Expand Up @@ -366,23 +366,6 @@ class GenerationExtensionTest {
// assertEquals("Hello Zepp", nameProperty.call(sampleModel))
}

@Test
fun testBundleIdRewiring() {
val inputs = Files("/sync")
val result = compile(
inputs,
options = listOf(
PluginOption(
pluginId = "io.realm.kotlin",
optionName = "bundleId",
optionValue = "BUNDLE_ID"
),
)
)
assertEquals(KotlinCompilation.ExitCode.OK, result.exitCode)
inputs.assertGeneratedIR()
}

@Suppress("deprecation")
private fun compile(
inputs: Files,
Expand All @@ -397,7 +380,7 @@ class GenerationExtensionTest {
kotlincArguments = listOf(
"-Xjvm-default=all-compatibility",
"-Xdump-directory=${inputs.outputDir()}",
"-Xphases-to-dump-after=ValidateIrBeforeLowering"
"-Xphases-to-dump-after=JvmValidateIrBeforeLowering"
)
commandLineProcessors = listOf(RealmCommandLineProcessor())
pluginOptions = options
Expand Down
Loading

0 comments on commit 5e6c12c

Please sign in to comment.