From 218dcc6f46ab2c09bab54bbb8c806890fe7a9cbd Mon Sep 17 00:00:00 2001 From: Cedrick Cooke Date: Fri, 9 Jul 2021 10:26:24 -0700 Subject: [PATCH] Dependency Version Updates (#40) Co-authored-by: Travis Wyatt --- .github/workflows/ci.yml | 81 ++++++++++--------- .github/workflows/publish.yml | 62 ++++++-------- .github/workflows/snapshot.yml | 45 +++++------ build.gradle.kts | 23 ++---- buildSrc/src/main/kotlin/Dependencies.kt | 8 +- compile/api/compile.api | 7 +- compile/src/main/kotlin/ExerciseProcessor.kt | 60 ++++++++------ .../main/kotlin/ExerciseProcessorProvider.kt | 13 +++ compile/src/main/kotlin/Logging.kt | 50 +++++------- compile/src/main/kotlin/read/Receiver.kt | 10 ++- ...le.devtools.ksp.processing.SymbolProcessor | 1 - ...ols.ksp.processing.SymbolProcessorProvider | 1 + .../src/test/kotlin/ExerciseProcessorTests.kt | 6 +- gradle/wrapper/gradle-wrapper.properties | 2 +- runtime/api/runtime.api | 2 - .../exercise/runtime/ParcelerExtensions.kt | 0 stubs/build.gradle.kts | 1 - 17 files changed, 182 insertions(+), 190 deletions(-) create mode 100644 compile/src/main/kotlin/ExerciseProcessorProvider.kt delete mode 100644 compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor create mode 100644 compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider rename runtime/src/main/{java => kotlin}/com/juul/exercise/runtime/ParcelerExtensions.kt (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74fb229..a75fddb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,59 +1,60 @@ name: CI on: - push: + pull_request: + +env: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" jobs: build: - runs-on: ubuntu-18.04 - - env: - GRADLE_ARGS: >- - --no-daemon - --max-workers 2 - -Pkotlin.incremental=false - + runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Set up JDK - uses: actions/setup-java@v1 + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 + - uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: "adopt-hotspot" + java-version: "11.0.11+9" - - name: Gradle cache - uses: actions/cache@v2 + - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper ~/.konan - key: ${{ runner.os }}-build-${{ hashFiles('**/build.gradle.kts') }} + ~/.android/build-cache + ~/.android/cache + key: ${{ runner.os }}-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-build- ${{ runner.os }}- - - name: Check - run: ./gradlew $GRADLE_ARGS check jacocoTestReport - - - name: Keyring - run: echo "${{ secrets.SIGNING_SECRET_KEY_RING }}" | base64 --decode > "$HOME/secring.gpg" - - - name: Publish Locally - run: >- - ./gradlew - $GRADLE_ARGS - --no-parallel - -PVERSION_NAME=unspecified - -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" - -Psigning.password="${{ secrets.SIGNING_PASSWORD }}" - -Psigning.secretKeyRingFile="$HOME/secring.gpg" - publishToMavenLocal - - - name: Codecov - uses: codecov/codecov-action@v1 + - run: ./gradlew check jacocoTestReport + - uses: EnricoMi/publish-unit-test-result-action@v1 + with: + files: '**/build/test-results/**/*.xml' + report_individual_runs: 'true' + + - run: | + set -o xtrace + if [ ! -z "${{ secrets.SIGNING_KEY }}" ]; then + ./gradlew \ + --no-parallel \ + -PVERSION_NAME="unspecified" \ + -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" \ + -PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" \ + publishToMavenLocal + else + ./gradlew \ + --no-parallel \ + -PVERSION_NAME="unspecified-SNAPSHOT" \ + publishToMavenLocal + fi + + - uses: codecov/codecov-action@v1 with: fail_ci_if_error: true + + - run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 353fe01..bf3f859 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,56 +4,44 @@ on: types: - published +env: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + jobs: publish: - runs-on: ubuntu-18.04 - - env: - GRADLE_ARGS: >- - --no-daemon - --max-workers 2 - -Pkotlin.incremental=false - + runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@v1 - - - name: Set up JDK - uses: actions/setup-java@v1 + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 + - uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: "adopt-hotspot" + java-version: "11.0.11+9" - - name: Gradle cache - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper ~/.konan - key: ${{ runner.os }}-publish-${{ hashFiles('**/build.gradle.kts') }} + ~/.android/build-cache + ~/.android/cache + key: ${{ runner.os }}-publish-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-publish- ${{ runner.os }}- - - name: Check - run: ./gradlew $GRADLE_ARGS check - - - name: Keyring - run: echo "${{ secrets.SIGNING_SECRET_KEY_RING }}" | base64 --decode > ~/secring.gpg - - - name: Publish - env: - SONATYPE_NEXUS_USERNAME: ${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }} - SONATYPE_NEXUS_PASSWORD: ${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }} - run: >- + - run: ./gradlew check + - run: >- ./gradlew - $GRADLE_ARGS --no-parallel - -PVERSION_NAME=${GITHUB_REF/refs\/tags\//} - -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" - -Psigning.password="${{ secrets.SIGNING_PASSWORD }}" - -Psigning.secretKeyRingFile="$HOME/secring.gpg" - uploadArchives + -PVERSION_NAME="${GITHUB_REF/refs\/tags\//}" + -PsigningInMemoryKey="${{ secrets.SIGNING_KEY }}" + -PsigningInMemoryKeyPassword="${{ secrets.SIGNING_PASSWORD }}" + -PmavenCentralUsername="${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}" + -PmavenCentralPassword="${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}" + publish + + - run: | + rm -f ~/.gradle/caches/modules-2/modules-2.lock + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index c95edbd..fa63312 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -4,47 +4,38 @@ on: branches: - main +env: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + jobs: snapshot: - runs-on: ubuntu-18.04 - - env: - GRADLE_ARGS: >- - --no-daemon - --max-workers 2 - -Pkotlin.incremental=false - + runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up JDK - uses: actions/setup-java@v1 + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 + - uses: actions/setup-java@v2 with: - java-version: 1.8 + distribution: "adopt-hotspot" + java-version: "11.0.11+9" - - name: Gradle cache - uses: actions/cache@v2 + - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper ~/.konan - key: ${{ runner.os }}-snapshot-${{ hashFiles('**/build.gradle.kts') }} + ~/.android/build-cache + ~/.android/cache + key: ${{ runner.os }}-snapshot-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: | ${{ runner.os }}-snapshot- ${{ runner.os }}- - - name: Check - run: ./gradlew $GRADLE_ARGS check - - - name: Snapshot - env: - SONATYPE_NEXUS_USERNAME: ${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }} - SONATYPE_NEXUS_PASSWORD: ${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }} - run: >- + - run: ./gradlew check + - run: >- ./gradlew - $GRADLE_ARGS --no-parallel -PVERSION_NAME=main-SNAPSHOT - uploadArchives + -PmavenCentralUsername="${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}" + -PmavenCentralPassword="${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}" + publish diff --git a/build.gradle.kts b/build.gradle.kts index 4fc1bdd..092c67a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,13 +7,13 @@ buildscript { } plugins { - kotlin("jvm") version "1.4.30" apply false - id("com.android.application") version "4.0.0" apply false - id("com.android.library") version "4.0.0" apply false - id("org.jmailen.kotlinter") version "3.2.0" apply false - id("binary-compatibility-validator") version "0.2.3" - id("org.jetbrains.dokka") version "1.4.30" apply false - id("com.vanniktech.maven.publish") version "0.13.0" apply false + kotlin("jvm") version "1.5.10" apply false + id("com.android.application") version "4.2.0" apply false + id("com.android.library") version "4.2.0" apply false + id("org.jmailen.kotlinter") version "3.4.5" apply false + id("binary-compatibility-validator") version "0.6.0" + id("org.jetbrains.dokka") version "1.5.0" apply false + id("com.vanniktech.maven.publish") version "0.17.0" apply false id("net.mbonnin.one.eight") version "0.2" } @@ -21,15 +21,6 @@ subprojects { repositories { mavenCentral() google() - jcenter { - content { - // https://youtrack.jetbrains.com/issue/IDEA-261387 - includeModule("org.jetbrains.trove4j", "trove4j") - - // https://github.com/Kotlin/kotlinx.html/issues/173 - includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm") - } - } } tasks.withType().configureEach { diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index d479647..36dfc91 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -5,18 +5,18 @@ fun assertj( fun kotlinCompileTesting( submodule: String? = null, - version: String = "1.3.6" + version: String = "1.4.2" ) = when (submodule) { null -> "com.github.tschuchortdev:kotlin-compile-testing:$version" else -> "com.github.tschuchortdev:kotlin-compile-testing-$submodule:$version" } fun kotlinPoet( - version: String = "1.7.2" + version: String = "1.9.0" ) = "com.squareup:kotlinpoet:$version" fun kotlinSymbolProcessing( - version: String = "1.4.31-1.0.0-alpha06" + version: String = "1.5.10-1.0.0-beta01" ) = "com.google.devtools.ksp:symbol-processing-api:$version" fun robolectric( @@ -25,5 +25,5 @@ fun robolectric( fun tuulbox( module: String, - version: String = "3.2.0" + version: String = "4.2.0" ) = "com.juul.tuulbox:$module:$version" diff --git a/compile/api/compile.api b/compile/api/compile.api index 1a8c625..9eb875a 100644 --- a/compile/api/compile.api +++ b/compile/api/compile.api @@ -1,8 +1,5 @@ -public final class com/juul/exercise/compile/ExerciseProcessor : com/google/devtools/ksp/processing/SymbolProcessor { +public final class com/juul/exercise/compile/ExerciseProcessorProvider : com/google/devtools/ksp/processing/SymbolProcessorProvider { public fun ()V - public fun finish ()V - public fun init (Ljava/util/Map;Lkotlin/KotlinVersion;Lcom/google/devtools/ksp/processing/CodeGenerator;Lcom/google/devtools/ksp/processing/KSPLogger;)V - public fun onError ()V - public fun process (Lcom/google/devtools/ksp/processing/Resolver;)Ljava/util/List; + public fun create (Lcom/google/devtools/ksp/processing/SymbolProcessorEnvironment;)Lcom/google/devtools/ksp/processing/SymbolProcessor; } diff --git a/compile/src/main/kotlin/ExerciseProcessor.kt b/compile/src/main/kotlin/ExerciseProcessor.kt index 6f9dd03..b303e29 100644 --- a/compile/src/main/kotlin/ExerciseProcessor.kt +++ b/compile/src/main/kotlin/ExerciseProcessor.kt @@ -1,7 +1,6 @@ package com.juul.exercise.compile import com.google.devtools.ksp.processing.CodeGenerator -import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.symbol.KSAnnotated @@ -13,44 +12,51 @@ import com.juul.exercise.compile.read.findParameters import com.juul.exercise.compile.write.ExerciseWriter import com.juul.tuulbox.logging.Log -public class ExerciseProcessor : SymbolProcessor { +internal class ExerciseProcessor( + private val codeGenerator: CodeGenerator +) : SymbolProcessor { - private lateinit var codeGenerator: CodeGenerator - - override fun init( - options: Map, - kotlinVersion: KotlinVersion, - codeGenerator: CodeGenerator, - logger: KSPLogger - ) { - Log.dispatcher.install(KspTuulboxLogger(logger)) - this.codeGenerator = codeGenerator - } + private var isFirstRound = true override fun process(resolver: Resolver): List { - val symbols = resolver.getSymbolsWithAnnotation(checkNotNull(Exercise::class.qualifiedName)) - .asSequence() + // FIXME: Hypothetically, somebody could write a KSP generator which outputs @Exercise annotated classes. This + // won't work as long as we have this shortcut in place. That said, this shortcut works around a crasher + // where we see `NoDescriptorForDeclarationException: Descriptor wasn't found for declaration CLASS` + if (!isFirstRound) return emptyList() + + val symbols = resolver.getSymbolsWithAnnotation(Exercise::class.java.name) .filterIsInstance() - .toList() - if (symbols.isNotEmpty()) { + if (symbols.any()) { Log.info { "Found @Exercise annotated classes: ${symbols.joinToString()}" } for (symbol in symbols) { processClass(symbol) } } + isFirstRound = false return emptyList() } private fun processClass(symbol: KSClassDeclaration) { - val logSymbol = symbol.loggable() - Log.debug(logSymbol) { "Start processing file." } + Log.debug { metadata -> + metadata[Node] = symbol + "Start processing file." + } try { val dependencies = symbol.findDependencies() - Log.verbose(logSymbol) { "Found dependencies: ${dependencies.originatingFiles.joinToString()}" } + Log.verbose { metadata -> + metadata[Node] = symbol + "Found dependencies: ${dependencies.originatingFiles.joinToString()}" + } val parameters = symbol.findParameters() - Log.verbose(logSymbol) { "Found parameters: ${symbol.findParameters()}" } + Log.verbose { metadata -> + metadata[Node] = symbol + "Found parameters: ${symbol.findParameters()}" + } val receiver = symbol.asReceiver() - Log.verbose(logSymbol) { "Using receiver: $receiver" } + Log.verbose { metadata -> + metadata[Node] = symbol + "Using receiver: $receiver" + } val writer = ExerciseWriter(receiver, parameters) val fileSpec = writer.generateFileSpec() codeGenerator.createNewFile(dependencies, fileSpec.packageName, fileSpec.name).use { stream -> @@ -59,8 +65,14 @@ public class ExerciseProcessor : SymbolProcessor { } } } catch (t: Throwable) { - Log.error(t.withNode(symbol)) { "An exception was thrown during processing." } + Log.error { metadata -> + metadata[Node] = symbol + "An exception was thrown during processing." + } + } + Log.debug { metadata -> + metadata[Node] = symbol + "Finished processing file." } - Log.debug(logSymbol) { "Finished processing file." } } } diff --git a/compile/src/main/kotlin/ExerciseProcessorProvider.kt b/compile/src/main/kotlin/ExerciseProcessorProvider.kt new file mode 100644 index 0000000..d4afcbe --- /dev/null +++ b/compile/src/main/kotlin/ExerciseProcessorProvider.kt @@ -0,0 +1,13 @@ +package com.juul.exercise.compile + +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.processing.SymbolProcessorEnvironment +import com.google.devtools.ksp.processing.SymbolProcessorProvider +import com.juul.tuulbox.logging.Log + +public class ExerciseProcessorProvider : SymbolProcessorProvider { + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor { + Log.dispatcher.install(KspTuulboxLogger(environment.logger)) + return ExerciseProcessor(environment.codeGenerator) + } +} diff --git a/compile/src/main/kotlin/Logging.kt b/compile/src/main/kotlin/Logging.kt index 2b6cdad..153f998 100644 --- a/compile/src/main/kotlin/Logging.kt +++ b/compile/src/main/kotlin/Logging.kt @@ -2,57 +2,49 @@ package com.juul.exercise.compile import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.symbol.KSNode +import com.juul.tuulbox.logging.Key import com.juul.tuulbox.logging.Logger +import com.juul.tuulbox.logging.ReadMetadata -/** Interface indicating that a throwable has a [KSNode] for the logger to associate the message with. */ -internal interface HasKSNode { - val node: KSNode -} - -/** Dirty hack to pass [KSNode] into Tuulbox logging for non-exceptional cases. */ -internal class NonExceptionalNode(override val node: KSNode) : Throwable(), HasKSNode - -internal class ExceptionalNode(cause: Throwable, override val node: KSNode) : Exception(cause), HasKSNode +internal object Node : Key internal class KspTuulboxLogger( private val backend: KSPLogger ) : Logger { - override fun verbose(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::logging, tag, message, throwable) + override fun verbose(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::logging, tag, message, metadata, throwable) - override fun debug(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::logging, tag, message, throwable) + override fun debug(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::logging, tag, message, metadata, throwable) - override fun info(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::info, tag, message, throwable) + override fun info(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::info, tag, message, metadata, throwable) - override fun warn(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::warn, tag, message, throwable) + override fun warn(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::warn, tag, message, metadata, throwable) - override fun error(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::error, tag, message, throwable) + override fun error(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::error, tag, message, metadata, throwable) - override fun assert(tag: String, message: String, throwable: Throwable?) = - callBackend(KSPLogger::error, tag, message, throwable) + override fun assert(tag: String, message: String, metadata: ReadMetadata, throwable: Throwable?) = + callBackend(KSPLogger::error, tag, message, metadata, throwable) private fun callBackend( action: KSPLogger.(String, KSNode?) -> Unit, tag: String, message: String, + metadata: ReadMetadata, throwable: Throwable? ) { - val node = (throwable as? HasKSNode)?.node + val node = metadata[Node] backend.action("$tag: $message", node) - if (throwable != null && throwable !is NonExceptionalNode) { + if (throwable != null) { backend.exception(throwable) } } -} - -/** Convert a [KSNode] into a special-case throwable so it can be included in a log without reporting an exception. */ -internal fun KSNode.loggable() = NonExceptionalNode(this) -/** Convert a [KSNode] into a special-case throwable so it can be included in a log without reporting an exception. */ -internal fun Throwable.withNode(node: KSNode) = ExceptionalNode(this, node) + override fun hashCode(): Int = backend.hashCode() + override fun equals(other: Any?): Boolean = other is KspTuulboxLogger && backend == other.backend +} diff --git a/compile/src/main/kotlin/read/Receiver.kt b/compile/src/main/kotlin/read/Receiver.kt index 1126d80..2b41b9c 100644 --- a/compile/src/main/kotlin/read/Receiver.kt +++ b/compile/src/main/kotlin/read/Receiver.kt @@ -35,6 +35,14 @@ internal fun KSClassDeclaration.asReceiver(): Receiver { val className = asStubAnnotation.getArgument(CLASS_NAME) as String Receiver.Stub(ClassName(packageName, className)) } - else -> throw IllegalArgumentException("@Exercise annotated class must be a subclass of Activity, Fragment, or Service; or, must also be annotated @AsStub.") + else -> { + val message = buildString { + append("@Exercise annotated class must be a subclass of Activity, Fragment, or Service; or, must also be annotated @AsStub. Found classes:") + for (superClass in superClasses) { + append("\n ", superClass) + } + } + error(message) + } } } diff --git a/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor b/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor deleted file mode 100644 index 4658f3a..0000000 --- a/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessor +++ /dev/null @@ -1 +0,0 @@ -com.juul.exercise.compile.ExerciseProcessor diff --git a/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider b/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider new file mode 100644 index 0000000..fe1e30c --- /dev/null +++ b/compile/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider @@ -0,0 +1 @@ +com.juul.exercise.compile.ExerciseProcessorProvider diff --git a/compile/src/test/kotlin/ExerciseProcessorTests.kt b/compile/src/test/kotlin/ExerciseProcessorTests.kt index 2ae392c..4f083c4 100644 --- a/compile/src/test/kotlin/ExerciseProcessorTests.kt +++ b/compile/src/test/kotlin/ExerciseProcessorTests.kt @@ -2,7 +2,8 @@ package com.juul.exercise.compile import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.SourceFile -import com.tschuchort.compiletesting.symbolProcessors +import com.tschuchort.compiletesting.symbolProcessorProviders +import org.jetbrains.kotlin.config.JvmTarget import org.junit.Rule import org.junit.rules.TemporaryFolder @@ -15,9 +16,10 @@ public abstract class ExerciseProcessorTests { protected fun compile(vararg files: SourceFile): Pair { val compilation = KotlinCompilation().apply { workingDir = temporaryFolder.root + jvmTarget = JvmTarget.JVM_1_8.description inheritClassPath = true sources = files.toList() - symbolProcessors = listOf(ExerciseProcessor()) + symbolProcessorProviders = listOf(ExerciseProcessorProvider()) } return compilation to compilation.compile() } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8d1d40d..8347912 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip diff --git a/runtime/api/runtime.api b/runtime/api/runtime.api index be23540..0bd395a 100644 --- a/runtime/api/runtime.api +++ b/runtime/api/runtime.api @@ -2,8 +2,6 @@ public final class com/juul/exercise/runtime/BuildConfig { public static final field BUILD_TYPE Ljava/lang/String; public static final field DEBUG Z public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; - public static final field VERSION_CODE I - public static final field VERSION_NAME Ljava/lang/String; public fun ()V } diff --git a/runtime/src/main/java/com/juul/exercise/runtime/ParcelerExtensions.kt b/runtime/src/main/kotlin/com/juul/exercise/runtime/ParcelerExtensions.kt similarity index 100% rename from runtime/src/main/java/com/juul/exercise/runtime/ParcelerExtensions.kt rename to runtime/src/main/kotlin/com/juul/exercise/runtime/ParcelerExtensions.kt diff --git a/stubs/build.gradle.kts b/stubs/build.gradle.kts index 23b2d94..349600d 100644 --- a/stubs/build.gradle.kts +++ b/stubs/build.gradle.kts @@ -1,5 +1,4 @@ plugins { kotlin("jvm") - // Not real code, so not worrying about coverage or lints. id("com.vanniktech.maven.publish") }