Skip to content

Commit

Permalink
Merge pull request #6 from EgoriusE/develop
Browse files Browse the repository at this point in the history
1.0.0-alpha 5
  • Loading branch information
EgoriusE authored May 16, 2021
2 parents 2e6cbb9 + 02d69ab commit 0838bbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'com.bobrusik.plugin.android_libraries_agent'
version '1.0.0-alpha4'
version '1.0.0-alpha5'

repositories {
mavenCentral()
Expand All @@ -29,6 +29,6 @@ intellij {

patchPluginXml {
version = project.version
sinceBuild = '194'
sinceBuild = '201'
untilBuild = '203.*'
}
7 changes: 3 additions & 4 deletions src/main/kotlin/core/ActionHandler.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

import com.android.tools.idea.gradle.dsl.api.GradleBuildModel
import com.android.tools.idea.gradle.dsl.api.GradleModelProvider
import com.android.tools.idea.gradle.dsl.api.ProjectBuildModel
import com.android.tools.idea.projectsystem.ProjectSystemSyncManager
import com.android.tools.idea.projectsystem.gradle.GradleProjectSystemSyncManager
import com.intellij.openapi.components.Service
Expand All @@ -22,7 +22,7 @@ import utils.extensions.canCreateFile
class ActionHandler(
private val project: Project
) {
private val projectGradleBuildModel: GradleBuildModel? = GradleModelProvider.get().getBuildModel(project)
private val projectGradleBuildModel: GradleBuildModel? = ProjectBuildModel.get(project).projectBuildModel
private val gradleDependenciesManager = GradleDependenciesManager()
private val notificationFactory by lazy { NotificationsFactory.getInstance(project) }
private val gradleProjectSystemSyncManager = GradleProjectSystemSyncManager(project)
Expand Down Expand Up @@ -110,8 +110,7 @@ class ActionHandler(
step: ModificationStep.GradleModificationStep,
model: ModificationModel
) {

val buildModuleModel: GradleBuildModel? = GradleModelProvider.get().getBuildModel(model.module)
val buildModuleModel: GradleBuildModel? = ProjectBuildModel.get(project).getModuleBuildModel(model.module)

when (step) {
is ModificationStep.GradleModificationStep.DependencyModification -> {
Expand Down
8 changes: 0 additions & 8 deletions src/main/kotlin/utils/extensions/Ext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import com.intellij.openapi.command.executeCommand
import com.intellij.openapi.module.Module
import com.intellij.openapi.wm.ToolWindowManager
import com.intellij.psi.PsiBinaryFile
import com.intellij.psi.PsiDirectory
import com.intellij.psi.PsiElement
import com.intellij.refactoring.copy.CopyHandler
import org.jetbrains.android.facet.AndroidFacet
import org.jetbrains.kotlin.idea.core.util.toPsiDirectory
import org.jetbrains.kotlin.idea.util.application.runWriteAction
import org.jetbrains.kotlin.idea.util.module
import utils.extensions.isAndroidProject
Expand All @@ -27,12 +25,6 @@ fun AnActionEvent.getSelectedPsiElement(): PsiElement? = getData(PlatformDataKey
val AnActionEvent.androidFacet: AndroidFacet?
get() = getSelectedPsiElement()?.module?.androidFacet

val Module.moduleParentPsiDirectory: PsiDirectory?
get() = moduleFile?.parent?.parent?.toPsiDirectory(project)

val Module.rootPsiDirectory: PsiDirectory?
get() = moduleFile?.parent?.toPsiDirectory(project)

fun execRunWriteAction(command: () -> Unit) {
executeCommand {
runWriteAction {
Expand Down

0 comments on commit 0838bbe

Please sign in to comment.