Skip to content

Commit

Permalink
Updated for Android Studio Giraffe
Browse files Browse the repository at this point in the history
  • Loading branch information
uyt95 committed Jul 31, 2023
1 parent 7764291 commit b0bb0a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ plugins {
}

group 'me.uyt'
version '1.0.5'
version '1.0.6'
patchPluginXml {
changeNotes = """
Updated for Android Studio Flamingo.
Updated for Android Studio Giraffe.
"""
}

Expand All @@ -25,7 +25,7 @@ dependencies {
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
// Define IntelliJ Platform against which to build the plugin project.
version = '222.4459.24' // Same IntelliJ IDEA version as target Android Studio version
version = '223.8836.35' // Same IntelliJ IDEA version as target Android Studio version
type = 'IC' // Use IntelliJ IDEA CE because it's the basis of the IntelliJ Platform

// Require the Android plugin, Gradle will match the plugin version to intellij.version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,27 @@ class BuildVariantSelectorAction : AnAction() {
return Pair(module, model)
}

private fun parseFlavors(module: GradleAndroidModel): Map<String, List<SelectOption>> {
private fun parseFlavors(model: GradleAndroidModel): Map<String, List<SelectOption>> {
val flavors = mutableMapOf<String, MutableList<SelectOption>>()
module.androidProject.flavorDimensions.forEach {
model.androidProject.flavorDimensions.forEach {
flavors[it] = mutableListOf()
}
module.androidProject.productFlavors.forEach { flavorContainer ->
model.androidProject.multiVariantData?.productFlavors?.forEach { flavorContainer ->
val flavor = flavorContainer.productFlavor
val dimension = flavor.dimension ?: return@forEach
val selected = module.selectedVariant.productFlavors.contains(flavor.name)
val selected = model.selectedVariant.productFlavors.contains(flavor.name)
flavors[dimension]?.add(SelectOption(flavor.name, selected))
}
return flavors
}

private fun parseBuildTypes(module: GradleAndroidModel): List<SelectOption> {
return module.androidProject.buildTypes.map {
private fun parseBuildTypes(model: GradleAndroidModel): List<SelectOption> {
return model.androidProject.multiVariantData?.buildTypes?.map {
SelectOption(
it.buildType.name,
it.buildType.name == module.selectedVariant.buildType
it.buildType.name == model.selectedVariant.buildType
)
}
} ?: emptyList()
}

private fun getSelectedVariant(
Expand Down

0 comments on commit b0bb0a6

Please sign in to comment.