Skip to content

Commit 8fe351e

Browse files
authored
add new currentDir params (#84)
- Add new parameters for Geminio's recipes and FTL templates
1 parent 0baf716 commit 8fe351e

File tree

70 files changed

+533
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+533
-335
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Список плагинов в репозитории
66

7-
- [hh-carnival](/plugins/hh-carnival) - плагин для быстрого создания нового feature-модуля, который также добавляет ещё немного полезных вещеё
7+
- [hh-carnival](/plugins/hh-carnival) - плагин для быстрого создания нового feature-модуля, который также добавляет ещё немного полезных вещей
88
- [hh-garcon](/plugins/hh-garcon) - плагин для быстрого создания Page Object-ов из XML-вёрстки
99
- [hh-geminio](/plugins/hh-geminio) - плагин, добавляющий возможность создавать свои шаблоны кода на основе FreeMarker-а
1010

build-logic/idea-convention/src/main/kotlin/convention.idea-plugin-base.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ configure<IntelliJPluginExtension> {
2424
plugins.set(currentVersion.pluginsNames)
2525
}
2626

27-
@Suppress("UnstableApiUsage")
2827
tasks.getByName<IntelliJInstrumentCodeTask>("instrumentCode") {
2928
val currentVersion = Libs.chosenIdeaVersion
3029
if (currentVersion is ExternalLibrariesExtension.Product.LocalIde) {

build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ plugins {
66

77
staticAnalysis {
88
detekt {
9-
configPath = files(project.rootDir.resolve("build-logic/static-analysis-convention/rules/detekt/detekt-config.yaml"))
10-
baselinePath = file(project.rootDir.resolve("build-logic/static-analysis-convention/rules/detekt/detekt-baseline.xml"))
9+
configPath = files(
10+
project.rootDir.resolve("build-logic/static-analysis-convention/rules/detekt/detekt-config.yaml")
11+
)
12+
baselinePath = file(
13+
project.rootDir.resolve("build-logic/static-analysis-convention/rules/detekt/detekt-baseline.xml")
14+
)
1115
}
1216
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kotlin.code.style=official
77
systemProp.gradleIntellijPluginVersion=1.12.0
88
systemProp.gradleChangelogPluginVersion=1.3.1
99
systemProp.kotlinVersion=1.8.0
10-
systemProp.detektVersion=1.21.0
10+
systemProp.detektVersion=1.22.0
1111

1212
systemProp.androidStudioPath=/Applications/Android Studio.app/Contents
1313
systemProp.androidStudioCompilerVersion=221.6008.13

infra/scripts/build_all_plugins.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ readonly repoUrl=$(prop "${PROPERTY_PLUGINS_REPO_URL}" "${PLUGINS_PROPERTIES_FIL
88

99
logMessage "Build all plugins..."
1010

11-
bash gradlew clean buildAllPlugins collectUpdatePluginsXmlTask --customRepositoryUrl="${repoUrl}"
11+
bash gradlew \
12+
clean \
13+
buildAllPlugins \
14+
collectUpdatePluginsXmlTask \
15+
--customRepositoryUrl="${repoUrl}" \
16+
--no-configuration-cache
1217

1318
logMessage "Successfully build all plugins"

plugins/hh-carnival/src/main/kotlin/ru/hh/android/plugin/actions/boilerplate/fragment_view_model/GenerateFragmentViewModelNames.kt

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,24 @@ data class GenerateFragmentViewModelNames(
2121
companion object {
2222

2323
fun from(featurePrefix: String, packageName: String): GenerateFragmentViewModelNames {
24-
val (modelsPackageName, mviFeaturePackageName, mviFeatureElementPackageName) = if (packageName.isNotBlank()) {
25-
val splitted = packageName.split(".")
26-
val previous = if (splitted.isNotEmpty()) {
27-
packageName.removeSuffix(".${splitted.last()}")
24+
val (modelsPackageName, mviFeaturePackageName, mviFeatureElementPackageName) =
25+
if (packageName.isNotBlank()) {
26+
val splitted = packageName.split(".")
27+
val previous = if (splitted.isNotEmpty()) {
28+
packageName.removeSuffix(".${splitted.last()}")
29+
} else {
30+
packageName
31+
}
32+
33+
Triple(
34+
"$packageName.model.",
35+
"$previous.feature.",
36+
"$previous.feature.element."
37+
)
2838
} else {
29-
packageName
39+
Triple(String.EMPTY, String.EMPTY, String.EMPTY)
3040
}
3141

32-
Triple(
33-
"$packageName.model.",
34-
"$previous.feature.",
35-
"$previous.feature.element."
36-
)
37-
} else {
38-
Triple(String.EMPTY, String.EMPTY, String.EMPTY)
39-
}
40-
4142
val viewModelClassName = "${featurePrefix}ViewModel"
4243
val singleEventClassName = "${featurePrefix}Event"
4344
val uiStateClassName = "${featurePrefix}UiState"

plugins/hh-carnival/src/main/kotlin/ru/hh/android/plugin/config/view/PluginConfigEditor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ class PluginConfigEditor(
106106
initialJiraHostName != jiraHostNameTextField.text ||
107107
initialJiraUsername != jiraUsernameTextField.text ||
108108
initialJiraPassword != jiraPasswordTextField.text ||
109-
initialJiraDevelopmentTeam != JiraDevelopmentTeam.fromLabel(jiraDevelopmentTeamComboBoxModel.selected.orEmpty())
109+
initialJiraDevelopmentTeam != JiraDevelopmentTeam.fromLabel(
110+
jiraDevelopmentTeamComboBoxModel.selected.orEmpty()
111+
)
110112
}
111113

112114
fun applyNewConfiguration(project: Project, pluginConfig: PluginConfig) {

plugins/hh-carnival/src/main/kotlin/ru/hh/android/plugin/core/model/enums/CodeStyleViewDeclaration.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ru.hh.android.plugin.core.model.enums
22

3-
43
private const val ANDROID_WIDGET_PKG = "android.widget"
54
private const val ANDROIDX_APPCOMPAT_WIDGET_PKG = "androidx.appcompat.widget"
65

plugins/hh-carnival/src/main/kotlin/ru/hh/android/plugin/core/model/jira/JiraDevelopmentTeam.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ enum class JiraDevelopmentTeam(
1414

1515
companion object {
1616

17-
fun fromLabel(label: String): JiraDevelopmentTeam = values().firstOrNull { it.comboBoxLabel == label } ?: MOBILE_CORE
17+
fun fromLabel(label: String): JiraDevelopmentTeam = values().firstOrNull { it.comboBoxLabel == label }
18+
?: MOBILE_CORE
1819
}
1920
}

plugins/hh-carnival/src/main/kotlin/ru/hh/android/plugin/extensions/PsiDirectoryExt.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ fun PsiDirectory.findSubdirectoryByPackageName(moduleName: String, packageName:
2121
for (item in directoriesNames) {
2222
result = result.findSubdirectory(item)
2323
?: throw CopyModuleActionException(
24-
"Can't find main package directory in copying module. Please, check AndroidManifest.xml in \"${moduleName}\" module and make sure that main package name is \"${packageName}\""
24+
"""Can't find main package directory in copying module.
25+
|Please, check AndroidManifest.xml in \"$moduleName\"
26+
|module and make sure that main package name is \"$packageName\"""
27+
.trimMargin()
2528
)
2629
}
2730
return result

0 commit comments

Comments
 (0)