Skip to content

Commit

Permalink
Bump kotlin to 1.9.22 & compose compiler to 1.5.8 (#19)
Browse files Browse the repository at this point in the history
* Bump kotlin to 1.9.22 & compose compiler to 1.5.8

* Bump dependencies

* Adapt for lib updates

---------

Co-authored-by: Vassili Simon <[email protected]>
Co-authored-by: jeppeman <[email protected]>
  • Loading branch information
3 people authored Feb 1, 2024
1 parent f2854f9 commit 7d1bd62
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ buildscript {
}
dependencies {
classpath 'com.jeppeman.mockposable:mockposable-gradle:0.6'
classpath 'com.jeppeman.mockposable:mockposable-gradle:0.7'
}
}
Expand Down
16 changes: 9 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[versions]
kotlin = '1.9.0'
compose-ui = '1.4.3'
compose-compiler = '1.5.1'
google-ksp = '1.9.0-1.0.13'
activity = '1.6.1'
kotlin = '1.9.22'
compose-ui = '1.5.4'
compose-compiler = '1.5.8'
google-ksp = '1.9.22-1.0.16'
activity = '1.8.2'
agp = '8.2.1'
espresso = '3.4.0'
hamcrest = '2.2'
mockk = '1.13.2'
Expand All @@ -30,14 +31,15 @@ compose-foundation = { module = 'androidx.compose.foundation:foundation', versio
compose-ui-test-junit4 = { module = 'androidx.compose.ui:ui-test-junit4', version.ref = 'compose-ui' }
compose-ui-test-manifest = { module = 'androidx.compose.ui:ui-test-manifest', version.ref = 'compose-ui' }

android-gradle = { module = 'com.android.tools.build:gradle', version = '7.4.1' }
android-gradle = { module = 'com.android.tools.build:gradle', version.ref = 'agp' }

autoservice-ksp = { module = 'dev.zacsweers.autoservice:auto-service-ksp', version = '1.0.0' }
autoservice-annotations = { module = 'com.google.auto.service:auto-service-annotations', version = '1.0.1' }

google-ksp = { module = 'com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin', version.ref = 'google-ksp' }

compile-testing = { module = 'com.github.tschuchortdev:kotlin-compile-testing', version = '1.5.0' }
# compile-testing = { module = 'com.github.tschuchortdev:kotlin-compile-testing', version = '1.5.0' }
compile-testing = { module = 'dev.zacsweers.kctfork:core', version = '0.4.0' }

junit = { module = 'androidx.test.ext:junit', version = '1.1.3' }

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 18 11:21:10 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4 changes: 3 additions & 1 deletion integration-tests/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ mockposable {
}

android {
compileSdk = 33
compileSdk = 34
namespace = "com.jeppeman.mockposable.integrationtests.android"

defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -37,6 +38,7 @@ android {

buildFeatures {
compose = true
buildConfig = true
}

testOptions {
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/android/src/main/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.jeppeman.mockposable.compiler

import androidx.compose.compiler.plugins.kotlin.ComposeCommandLineProcessor
import androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar
import com.tschuchort.compiletesting.CompilationResult
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.PluginOption
import com.tschuchort.compiletesting.SourceFile
Expand All @@ -10,6 +11,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test

@OptIn(ExperimentalCompilerApi::class)
class MockposableCompilerTest {
@Test
fun `GIVEN mockk plugin applied WHEN compiling THEN should compile successfully`() {
Expand Down Expand Up @@ -85,16 +87,14 @@ fun main() {
fun compile(
sourceFiles: List<SourceFile>,
vararg plugins: String,
): KotlinCompilation.Result {
): CompilationResult {
val mockposableCommandLineProcessor = MockposableCommandLineProcessor()
val composeCommandLineProcessor = ComposeCommandLineProcessor()
return KotlinCompilation().apply {
languageVersion = "1.8"
sources = sourceFiles
useIR = true
commandLineProcessors = listOf(mockposableCommandLineProcessor, composeCommandLineProcessor)
componentRegistrars = listOf(MockposablePlugin())
compilerPluginRegistrars = listOf(ComposePluginRegistrar())
componentRegistrars = listOf(ComposePluginRegistrar(), MockposablePlugin())
pluginOptions = listOf(
PluginOption(
pluginId = mockposableCommandLineProcessor.pluginId,
Expand All @@ -106,9 +106,10 @@ fun compile(
}.compile()
}

@OptIn(ExperimentalCompilerApi::class)
fun compile(
sourceFile: SourceFile,
vararg plugins: String
): KotlinCompilation.Result {
): CompilationResult {
return compile(listOf(sourceFile), *plugins)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ plugins {
}

android {
compileSdk = 33
compileSdk = 34
namespace = "com.jeppeman.mockposable.composeui"

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
Expand Down

This file was deleted.

0 comments on commit 7d1bd62

Please sign in to comment.