Skip to content

Commit

Permalink
Updated libs
Browse files Browse the repository at this point in the history
  • Loading branch information
IVIanuu committed Feb 16, 2024
1 parent 1f55bfd commit 11d71d8
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 23 deletions.
12 changes: 6 additions & 6 deletions buildSrc/src/main/kotlin/dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Build {
}

object Deps {
const val androidGradlePlugin = "com.android.tools.build:gradle:7.4.0"
const val androidGradlePlugin = "com.android.tools.build:gradle:8.2.2"

object AndroidX {
object Activity {
Expand Down Expand Up @@ -45,14 +45,14 @@ object Deps {
const val classGraph = "io.github.classgraph:classgraph:4.8.108"

object Compose {
const val version = "1.5.3"
const val compiler = "org.jetbrains.compose.compiler:compiler:1.5.2"
const val version = "1.6.0-rc01"
const val compiler = "org.jetbrains.compose.compiler:compiler:1.5.8"
const val material = "org.jetbrains.compose.material:material:$version"
const val runtime = "org.jetbrains.compose.runtime:runtime:$version"
}

object Coroutines {
private const val version = "1.7.3"
private const val version = "1.8.0"
const val android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$version"
const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"
const val test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$version"
Expand All @@ -70,14 +70,14 @@ object Deps {
const val junit = "junit:junit:4.12"

object Kotlin {
const val version = "1.9.10"
const val version = "1.9.22"
const val compilerEmbeddable = "org.jetbrains.kotlin:kotlin-compiler-embeddable:$version"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version"
const val gradlePluginApi = "org.jetbrains.kotlin:kotlin-gradle-plugin-api:$version"
}

object KotlinCompileTesting {
private const val version = "0.3.2"
private const val version = "0.4.0"
const val kotlinCompileTesting = "dev.zacsweers.kctfork:core:$version"
const val ksp = "dev.zacsweers.kctfork:ksp:$version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class InjectCallTransformer(
private fun ScopeContext.receiverExpression(
descriptor: ParameterDescriptor
): IrExpression = DeclarationIrBuilder(irCtx, symbol).run {
scopeStack.reversed().firstNotNullOfOrNull { scope ->
allScopes.reversed().firstNotNullOfOrNull { scope ->
val element = scope.irElement
when {
element is IrClass &&
Expand All @@ -441,7 +441,7 @@ class InjectCallTransformer(
descriptor.type.constructor.declarationDescriptor ->
irGet(element.dispatchReceiverParameter!!)
element is IrProperty &&
scopeStack.getOrNull(scopeStack.indexOf(scope) + 1)?.irElement !is IrField &&
allScopes.getOrNull(allScopes.indexOf(scope) + 1)?.irElement !is IrField &&
element.parentClassOrNull?.descriptor == descriptor.type.constructor.declarationDescriptor ->
irGet(element.getter!!.dispatchReceiverParameter!!)
else -> null
Expand Down Expand Up @@ -481,7 +481,7 @@ class InjectCallTransformer(
): IrExpression = if (descriptor.getter != null)
DeclarationIrBuilder(irCtx, symbol)
.irCall(
irCtx.symbolTable.referenceSimpleFunction(descriptor.getter!!),
irCtx.symbolTable.descriptorExtension.referenceSimpleFunction(descriptor.getter!!),
injectable.type.toIrType(irCtx).typeOrNull!!
)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import java.io.File

fun ClassDescriptor.irClass(irCtx: IrPluginContext): IrClass =
irCtx.symbolTable.referenceClass(this).ensureBound(irCtx).owner
irCtx.symbolTable.descriptorExtension.referenceClass(this).ensureBound(irCtx).owner

fun CallableDescriptor.irCallable(irCtx: IrPluginContext): IrFunction =
if (this is PropertyDescriptor)
irCtx.symbolTable.referenceProperty(this).ensureBound(irCtx).owner.getter!!
irCtx.symbolTable.descriptorExtension.referenceProperty(this).ensureBound(irCtx).owner.getter!!
else irCtx.symbolTable.referenceFunction(this).ensureBound(irCtx).owner

fun TypeRef.toIrType(irCtx: IrPluginContext): IrTypeArgument {
Expand Down Expand Up @@ -188,7 +188,7 @@ fun IrModuleFragment.dumpToFiles(dumpDir: File, ctx: Context) {
e.stackTraceToString()
}
val newFile = dumpDir
.resolve(irFile.fqName.asString().replace(".", "/"))
.resolve(irFile.packageFqName.asString().replace(".", "/"))
.also { it.mkdirs() }
.resolve(file.name.removeSuffix(".kt"))
try {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ POM_SCM_CONNECTION=scm\:git\:git\://github.com/IVIanuu/injekt.git
POM_DEVELOPER_ID=ivianuu

GROUP=com.ivianuu.injekt
VERSION_NAME=0.0.1-dev725
VERSION_NAME=0.0.1-dev726

android.useAndroidX=true

Expand Down
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Sep 18 18:07:02 CEST 2022
#Fri Feb 16 12:41:08 CET 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ fun compilation(block: KotlinCompilation.() -> Unit = {}) = KotlinCompilation().
commandLineProcessors += InjektCommandLineProcessor()

inheritClassPath = true
useIR = true
jvmTarget = "1.8"
verbose = false
kotlincArguments += "-XXLanguage:+NewInference"
Expand Down
14 changes: 11 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ plugins {
id("com.ivianuu.injekt")
}

apply(from = "https://raw.githubusercontent.com/IVIanuu/gradle-scripts/master/android-build-app.gradle")
apply(from = "https://raw.githubusercontent.com/IVIanuu/gradle-scripts/master/java-8-android.gradle")
apply(from = "https://raw.githubusercontent.com/IVIanuu/gradle-scripts/master/kt-source-sets-android.gradle")
android {
defaultConfig {
namespace = "com.ivianuu.injekt.samples.android"
applicationId = Build.applicationId
compileSdk = Build.compileSdk
minSdk = Build.minSdk
targetSdk = Build.targetSdk
versionCode = Build.versionCode
versionName = Build.versionName
}
}

dependencies {
implementation(Deps.AndroidX.Activity.activity)
Expand Down
3 changes: 1 addition & 2 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
~ Copyright 2022 Manuel Wrage. Use of this source code is governed by the Apache 2.0 license.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ivianuu.injekt.samples.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ fun interface AppTheme {
}
}
}

0 comments on commit 11d71d8

Please sign in to comment.