Merge branch 'develop' into feature/fga/navigation First step: makes it compile by disabling the new screens (need to migrate to nodes)

This commit is contained in:
ganfra 2023-01-06 19:22:52 +01:00
commit 9e211b5e04
312 changed files with 8608 additions and 261 deletions

View file

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:OptIn(ExperimentalAnvilApi::class)
package io.element.android.x.anvilcodegen
@ -31,10 +47,10 @@ import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import dagger.multibindings.IntoMap
import io.element.android.x.anvilannotations.ContributesViewModel
import java.io.File
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.psi.KtFile
import java.io.File
/**
* This is an anvil plugin that allows ViewModels to use [ContributesViewModel] alone and let this plugin automatically
@ -69,7 +85,12 @@ class ContributesViewModelCodeGenerator : CodeGenerator {
.returns(assistedViewModelFactoryFqName.asClassName(module).parameterizedBy(STAR, STAR))
.addAnnotation(Binds::class)
.addAnnotation(IntoMap::class)
.addAnnotation(AnnotationSpec.Companion.builder(viewModelKeyFqName.asClassName(module)).addMember("%T::class", vmClass.asClassName()).build())
.addAnnotation(
AnnotationSpec.Companion
.builder(viewModelKeyFqName.asClassName(module))
.addMember("%T::class", vmClass.asClassName())
.build()
)
.build(),
)
.build(),