Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs :
strategy :
fail-fast : false
matrix :
kotlin-version : [ 1.8.22, 1.9.20 ]
kotlin-version : [ 1.9.20 ]

steps :
- uses : actions/checkout@v3
Expand All @@ -36,7 +36,7 @@ jobs :
strategy :
fail-fast : false
matrix :
kotlin-version : [ 1.8.22, 1.9.20 ]
kotlin-version : [ 1.9.20 ]

steps :
- uses : actions/checkout@v3
Expand Down Expand Up @@ -175,13 +175,6 @@ jobs :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

# TODO: Remove when we drop Kotlin 1.8 support
- name : Publish Snapshots 1.8
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.10-1-8-SNAPSHOT
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

test-gradle-plugin :
runs-on : ubuntu-latest

Expand All @@ -193,7 +186,7 @@ jobs :
# solution.
fail-fast : false
matrix :
kotlin-version : [ 1.8.22, 1.9.20 ]
kotlin-version : [ 1.9.20 ]
agp-version : [ 7.1.1, 7.2.0, 7.3.1 ]

steps :
Expand Down Expand Up @@ -225,7 +218,7 @@ jobs :
# solution.
fail-fast : false
matrix :
kotlin-version : [ 1.8.22, 1.9.20 ]
kotlin-version : [ 1.9.20 ]

steps :
- uses : actions/checkout@v3
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ jobs :
ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ''

# TODO: Remove when we drop Kotlin 1.8 support
- name : Publish Release 1.8
run : ./gradlew clean publish --no-build-cache --no-daemon --stacktrace --no-parallel -Doverride_kotlin=1.8.22 -PVERSION_NAME=2.4.10-1-8
env :
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ''

- name : Extract release notes
id : release_notes
uses : ffurrer2/extract-release-notes@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ abstract class SettingsPlugin @Inject constructor(
.forEach { (key, value) ->
val alias = key.substring("override_".length)
catalogBuilder.overrideVersion(alias = alias, versionString = value.toString())

if (alias == "kotlin" && value.toString().startsWith("1.8")) {
// TODO hardcoded to match what's in libs.versions.toml, but kinda ugly
catalogBuilder.overrideVersion(alias = "ksp", versionString = "$value-1.0.11")
// KCT versions after 0.3.2 are not compatible with Kotlin 1.8
catalogBuilder.overrideVersion(alias = "kct", versionString = "0.3.2")
}
}

catalogBuilder.version("config-warningsAsErrors", System.getenv("CI") ?: "false")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,8 @@ private fun FileSpec.Builder.suppressWarnings() {
.addMember("\"DEPRECATION\"")
// Suppress errors for experimental features in generated code.
.apply {
if (KotlinVersion.CURRENT > KotlinVersion(1, 6, 10)) {
addMember("\"OPT_IN_USAGE\"")
addMember("\"OPT_IN_USAGE_ERROR\"")
} else {
addMember("\"EXPERIMENTAL_API_USAGE_ERROR\"")
addMember("\"EXPERIMENTAL_API_USAGE\"")
}
addMember("\"OPT_IN_USAGE\"")
addMember("\"OPT_IN_USAGE_ERROR\"")
}
.build(),
)
Expand Down
8 changes: 8 additions & 0 deletions compiler/api/compiler.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ public final class com/squareup/anvil/compiler/AnvilCommandLineProcessor : org/j
public fun processOption (Lorg/jetbrains/kotlin/compiler/plugin/AbstractCliOption;Ljava/lang/String;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
}

public synthetic class com/squareup/anvil/compiler/AnvilCommandLineProcessor$EntriesMappings {
public static final synthetic field entries$0 Lkotlin/enums/EnumEntries;
}

public final class com/squareup/anvil/compiler/AnvilComponentRegistrar : org/jetbrains/kotlin/compiler/plugin/ComponentRegistrar {
public fun <init> ()V
public final fun addCodeGenerators (Ljava/util/List;)V
Expand All @@ -24,6 +28,10 @@ public final class com/squareup/anvil/compiler/CommandLineOptions$Companion {
public final fun getCommandLineOptions (Lorg/jetbrains/kotlin/config/CompilerConfiguration;)Lcom/squareup/anvil/compiler/CommandLineOptions;
}

public synthetic class com/squareup/anvil/compiler/CommandLineOptions$Companion$EntriesMappings {
public static final synthetic field entries$0 Lkotlin/enums/EnumEntries;
}

public final class com/squareup/anvil/compiler/codegen/reference/RealAnvilModuleDescriptor : com/squareup/anvil/compiler/internal/reference/AnvilModuleDescriptor, org/jetbrains/kotlin/descriptors/ModuleDescriptor {
public synthetic fun <init> (Lorg/jetbrains/kotlin/descriptors/ModuleDescriptor;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun accept (Lorg/jetbrains/kotlin/descriptors/DeclarationDescriptorVisitor;Ljava/lang/Object;)Ljava/lang/Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ public class AnvilCommandLineProcessor : CommandLineProcessor {
required = false,
allowMultipleOccurrences = false,
),
@Suppress("EnumValuesSoftDeprecate") // Can't use Enum.entries while targeting Kotlin 1.8
CliOption(
optionName = backendName,
valueDescription = AnvilBackend.values().joinToString("|", "<", ">"),
valueDescription = AnvilBackend.entries.joinToString("|", "<", ">"),
description = "Controls whether Anvil is running as an embedded plugin or as KSP.",
required = false,
allowMultipleOccurrences = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ public class CommandLineOptions private constructor(
backend = parseBackend(),
)

@Suppress("EnumValuesSoftDeprecate") // Can't use Enum.entries while targeting Kotlin 1.8
private fun CompilerConfiguration.parseBackend(): AnvilBackend {
val config = get(backendKey, AnvilBackend.EMBEDDED.name)
return config
.uppercase(Locale.US)
.let { value -> AnvilBackend.values().find { it.name == value } }
.let { value -> AnvilBackend.entries.find { it.name == value } }
?: error("Unknown backend option: '$config'")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AnvilVersionMatrix(
) : KaseMatrix by KaseMatrix(agp + kotlin + gradle + dagger) {
private companion object {
val agpList = setOf("7.3.1", "7.4.2", "8.0.2", "8.1.1", "8.2.0").map(::AgpDependencyVersion)
val kotlinList = setOf("1.8.21", "1.9.0", "1.9.10", "1.9.21").map(::KotlinDependencyVersion)
val kotlinList = setOf("1.9.0", "1.9.10", "1.9.21").map(::KotlinDependencyVersion)
val gradleList = setOf("8.5").map(::GradleDependencyVersion)
val daggerList = setOf("2.46.1").map(::DaggerDependencyVersion)
}
Expand All @@ -29,8 +29,6 @@ class AnvilVersionMatrix(
val HasKotlinDependencyVersion.kspDependencyVersion: KspDependencyVersion
get() {
val kspPart = when (kotlinVersion) {
in ("1.8.10"..<"1.8.20") -> "1.0.9"
in ("1.8.20"..<"1.9.0") -> "1.0.11"
in ("1.9.0"..<"1.9.10") -> "1.0.11"
in ("1.9.10"..<"1.9.20") -> "1.0.13"
else -> "1.0.15"
Expand Down