Skip to content

Commit e6a2e8b

Browse files
authored
Merge pull request #12 from FindaDeveloper/dohun
Dohun ShowLayoutBounds 액션 추가
2 parents 976fb63 + 7a0deb6 commit e6a2e8b

File tree

17 files changed

+230
-87
lines changed

17 files changed

+230
-87
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ jobs:
6262
path: ~/.gradle/wrapper
6363
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
6464

65-
# Run verifyPlugin Gradle task
66-
- name: Verify Plugin
67-
run: ./gradlew verifyPlugin
68-
6965
# Build plugin with buildPlugin Gradle task and provide the artifact for the next workflow jobs
7066
# Requires test job to be passed
7167
build:
@@ -133,66 +129,12 @@ jobs:
133129
name: plugin-artifact
134130
path: ./build/distributions/${{ steps.properties.outputs.artifact }}
135131

136-
# Verify built plugin using IntelliJ Plugin Verifier tool
137-
# Requires build job to be passed
138-
verify:
139-
name: Verify
140-
needs: build
141-
runs-on: ubuntu-latest
142-
steps:
143-
144-
# Setup Java 1.8 environment for the next steps
145-
- name: Setup Java
146-
uses: actions/setup-java@v1
147-
with:
148-
java-version: 1.8
149-
150-
# Check out current repository
151-
- name: Fetch Sources
152-
uses: actions/checkout@v2
153-
154-
# Cache Gradle Dependencies
155-
- name: Setup Gradle Dependencies Cache
156-
uses: actions/cache@v2
157-
with:
158-
path: ~/.gradle/caches
159-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
160-
161-
# Cache Gradle Wrapper
162-
- name: Setup Gradle Wrapper Cache
163-
uses: actions/cache@v2
164-
with:
165-
path: ~/.gradle/wrapper
166-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
167-
168-
# Set environment variables
169-
- name: Export Properties
170-
id: properties
171-
shell: bash
172-
run: |
173-
PROPERTIES="$(./gradlew properties --console=plain -q)"
174-
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
175-
176-
echo "::set-output name=ideVersions::$IDE_VERSIONS"
177-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
178-
179-
# Cache Plugin Verifier IDEs
180-
- name: Setup Plugin Verifier IDEs Cache
181-
uses: actions/cache@v2
182-
with:
183-
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
184-
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
185-
186-
# Run IntelliJ Plugin Verifier action using GitHub Action
187-
- name: Verify Plugin
188-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
189-
190132
# Prepare a draft release for GitHub Releases page for the manual verification
191133
# If accepted and published, release workflow would be triggered
192134
releaseDraft:
193135
name: Release Draft
194136
if: github.event_name != 'pull_request'
195-
needs: [build, verify]
137+
needs: [build]
196138
runs-on: ubuntu-latest
197139
steps:
198140

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ intellij {
5656

5757
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
5858
setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
59+
alternativeIdePath = "/Applications/Android Studio.app"
5960
}
6061

6162
// Configure gradle-changelog-plugin plugin.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ platformVersion = 2020.1
1515
platformDownloadSources = true
1616
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1717
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
18-
platformPlugins =
18+
platformPlugins = android
1919

2020
# Opt-out flag for bundling Kotlin standard library.
2121
# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package kr.co.finda.androidtemplate.ext
2+
3+
import com.intellij.openapi.project.Project
4+
import com.intellij.openapi.ui.Messages
5+
import icons.Icons
6+
import kr.co.finda.androidtemplate.type.PluginError
7+
8+
fun Project.showErrorDialog(pluginError: PluginError) {
9+
Messages.showMessageDialog(
10+
this,
11+
pluginError.message,
12+
pluginError.title,
13+
Icons.FindaLogo
14+
)
15+
}
16+
17+
fun Project.showMessageDialog(title: String, message: String) {
18+
Messages.showMessageDialog(
19+
this,
20+
message,
21+
title,
22+
Icons.FindaLogo
23+
)
24+
}

src/main/kotlin/kr/co/finda/androidtemplate/ext/StringExt.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ fun String.replaceAllIfNotNull(oldValue: String, newValue: String?): String {
1616
} else {
1717
this
1818
}
19+
}
20+
21+
fun String.toCamelCase(): String {
22+
"JOBObject"
23+
return "Test"
1924
}

src/main/kotlin/kr/co/finda/androidtemplate/feature/createFindaTemplate/action/CreateFindaTemplateAction.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.intellij.openapi.project.Project
77
import com.intellij.openapi.ui.Messages
88
import com.intellij.openapi.vfs.VirtualFile
99
import icons.Icons
10+
import kr.co.finda.androidtemplate.ext.showErrorDialog
1011
import kr.co.finda.androidtemplate.type.PluginError
1112
import kr.co.finda.androidtemplate.feature.createFindaTemplate.dialog.CreateFindaTemplateDialog
1213
import kr.co.finda.androidtemplate.util.ActionRouterImpl
@@ -34,12 +35,7 @@ class CreateFindaTemplateAction :
3435
project: Project,
3536
error: PluginError
3637
) {
37-
Messages.showMessageDialog(
38-
project,
39-
error.message,
40-
error.title,
41-
Icons.FindaLogo
42-
)
38+
project.showErrorDialog(error)
4339
}
4440

4541
override fun showCreateFindaTemplateDialog(

src/main/kotlin/kr/co/finda/androidtemplate/feature/createFindaTemplate/dialog/CreateFindaTemplateDialog.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.intellij.ui.EnumComboBoxModel
99
import com.intellij.ui.components.JBTextField
1010
import com.intellij.util.ui.FormBuilder
1111
import icons.Icons
12+
import kr.co.finda.androidtemplate.ext.showErrorDialog
1213
import kr.co.finda.androidtemplate.type.PluginError
1314
import kr.co.finda.androidtemplate.util.FileHelperImpl
1415
import kr.co.finda.androidtemplate.util.ReplacerImpl
@@ -59,12 +60,7 @@ class CreateFindaTemplateDialog(
5960
project: Project,
6061
pluginError: PluginError
6162
) {
62-
Messages.showMessageDialog(
63-
project,
64-
pluginError.message,
65-
pluginError.title,
66-
Icons.FindaLogo
67-
)
63+
project.showErrorDialog(pluginError)
6864
}
6965

7066
override fun showConflictNameDialog(

src/main/kotlin/kr/co/finda/androidtemplate/feature/createViewModelTest/action/CreateViewModelTestAction.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ import com.intellij.openapi.actionSystem.AnAction
44
import com.intellij.openapi.actionSystem.AnActionEvent
55
import com.intellij.openapi.actionSystem.CommonDataKeys
66
import com.intellij.openapi.project.Project
7-
import com.intellij.openapi.ui.Messages
87
import com.intellij.openapi.vfs.VirtualFile
9-
import icons.Icons
8+
import kr.co.finda.androidtemplate.ext.showErrorDialog
109
import kr.co.finda.androidtemplate.feature.createViewModelTest.dialog.CreateViewModelTestDialog
11-
import kr.co.finda.androidtemplate.util.ActionRouterImpl
1210
import kr.co.finda.androidtemplate.type.PluginError
11+
import kr.co.finda.androidtemplate.util.ActionRouterImpl
1312

1413
class CreateViewModelTestAction :
1514
AnAction(), CreateViewModelTestActionContract.View {
@@ -31,12 +30,7 @@ class CreateViewModelTestAction :
3130
}
3231

3332
override fun showErrorDialog(project: Project, pluginError: PluginError) {
34-
Messages.showMessageDialog(
35-
project,
36-
pluginError.message,
37-
pluginError.title,
38-
Icons.FindaLogo
39-
)
33+
project.showErrorDialog(pluginError)
4034
}
4135

4236
override fun showCreateViewModelTestTemplateDialog(project: Project, selectedDirectory: VirtualFile) {

src/main/kotlin/kr/co/finda/androidtemplate/feature/createViewModelTest/dialog/CreateViewModelTestDialog.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.intellij.openapi.vfs.VirtualFile
77
import com.intellij.ui.components.JBTextField
88
import com.intellij.util.ui.FormBuilder
99
import icons.Icons
10+
import kr.co.finda.androidtemplate.ext.showMessageDialog
1011
import kr.co.finda.androidtemplate.util.FileHelperImpl
1112
import kr.co.finda.androidtemplate.util.ReplacerImpl
1213
import kr.co.finda.androidtemplate.type.PluginError
@@ -45,11 +46,9 @@ class CreateViewModelTestDialog(
4546
}
4647

4748
override fun showConflictNameDialog(project: Project, pluginError: PluginError, conflictedFileName: String) {
48-
Messages.showMessageDialog(
49-
project,
50-
"${pluginError.message}\n${conflictedFileName}",
51-
pluginError.title,
52-
Icons.FindaLogo
49+
project.showMessageDialog(
50+
title = pluginError.title,
51+
message = "${pluginError.message}\n${conflictedFileName}"
5352
)
5453
}
5554
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package kr.co.finda.androidtemplate.feature.inspection
2+
3+
import com.intellij.codeInspection.InspectionToolProvider
4+
import com.intellij.codeInspection.LocalInspectionTool
5+
import kr.co.finda.androidtemplate.feature.inspection.camelCase.CamelCaseInspection
6+
7+
class FindaInspectionProvider : InspectionToolProvider {
8+
override fun getInspectionClasses(): Array<Class<out LocalInspectionTool>> {
9+
return arrayOf(CamelCaseInspection::class.java)
10+
}
11+
}

0 commit comments

Comments
 (0)