File tree Expand file tree Collapse file tree 4 files changed +31
-25
lines changed
src/main/kotlin/io/cjlee/gitnote Expand file tree Collapse file tree 4 files changed +31
-25
lines changed Original file line number Diff line number Diff line change 72
72
73
73
- name : Build JAR
74
74
working-directory : ./gitnote-jetbrains
75
- run : ./gradlew buildPlugin -Dgitnote.phase=2
75
+ run : ./gradlew buildPlugin -Dgitnote.useLocalGui=false -Dgitnote.buildCore=false
76
76
77
77
- name : Get Project Version
78
78
id : get_version
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ plugins {
8
8
}
9
9
10
10
group = " io.cjlee"
11
- version = " 0.2.6 "
11
+ version = " 0.2.7 "
12
12
13
13
repositories {
14
14
mavenCentral()
@@ -29,11 +29,18 @@ intellij {
29
29
plugins.set(listOf (/* Plugin Dependencies */ ))
30
30
}
31
31
32
- // phase
33
- val PHASE_DEVELOP = 0
34
- val PHASE_ALPHA = 1
35
- val PHASE_RELEASE = 2
36
- val phase = (System .getProperty(" gitnote.phase" ) ? : " 0" ).toInt()
32
+
33
+ /* *
34
+ * Determine whether to use `localhost:3000` GUI for development. false by default means using the built-in GUI
35
+ */
36
+ val useLocalGui = System .getProperty(" gitnote.useLocalGui" )?.toBoolean() ? : false
37
+
38
+ /* *
39
+ * Determine whether to build the core module locally.
40
+ *
41
+ * Usually set to false when you release the plugin using github-actions.
42
+ */
43
+ val buildCore = System .getProperty(" gitnote.buildCore" )?.toBoolean() ? : true
37
44
38
45
tasks {
39
46
// Set the JVM compatibility versions
@@ -52,14 +59,24 @@ tasks {
52
59
53
60
runIde {
54
61
autoReloadPlugins = true
55
- systemProperty(" gitnote.phase" , phase)
56
62
}
57
63
58
64
buildPlugin {
59
- if (phase == PHASE_ALPHA ) {
60
- dependsOn(" buildCore" )
65
+ if (! useLocalGui) {
61
66
dependsOn(" buildGui" )
62
67
}
68
+ if (buildCore) {
69
+ dependsOn(" buildCore" )
70
+ }
71
+ }
72
+
73
+ processResources {
74
+ if (! useLocalGui) {
75
+ dependsOn(named(" copyGui" ))
76
+ }
77
+ if (buildCore) {
78
+ dependsOn(named(" copyCore" ))
79
+ }
63
80
}
64
81
65
82
signPlugin {
@@ -96,11 +113,4 @@ tasks {
96
113
from(" ../gitnote-gui/build" )
97
114
into(" src/main/resources/webview/." )
98
115
}
99
-
100
- processResources {
101
- if (phase == PHASE_ALPHA ) {
102
- dependsOn(named(" copyCore" ))
103
- dependsOn(named(" copyGui" ))
104
- }
105
- }
106
116
}
Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ class ProcessCoreConnector(
44
44
}
45
45
46
46
companion object {
47
- private val phase = System .getProperty(" gitnote.phase" , " 1" ).toInt()
48
47
private val systemCommand = arrayOf(" git" , " note" )
49
48
val COMMAND : Array <String >
50
49
@@ -53,10 +52,7 @@ class ProcessCoreConnector(
53
52
}
54
53
55
54
private fun determineCommand (): Array <String > {
56
- val platform = ConnectorLoader .platform
57
- if (phase == 0 || platform == null ) {
58
- return systemCommand
59
- }
55
+ val platform = ConnectorLoader .platform ? : return systemCommand
60
56
val filename = when (platform) {
61
57
Platform .WINDOWS -> " git-note.exe"
62
58
else -> " git-note"
Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ class GitNoteViewerWindow(
22
22
private val project : Project ,
23
23
private val protocolHandlers : Map <String , ProtocolHandler >
24
24
) {
25
- private val phase = System .getProperty(" gitnote.phase " , " 1 " ).toInt ()
25
+ private val useLocalGui = System .getProperty(" gitnote.useLocalGui " , " false " ).toBoolean ()
26
26
27
27
val webView: JBCefBrowser = JBCefBrowser .createBuilder()
28
28
.setOffScreenRendering(false )
29
29
.build()
30
30
.apply {
31
- if (phase == 0 ) this .loadURL(" http://localhost:3000/index.html" )
31
+ if (useLocalGui ) this .loadURL(" http://localhost:3000/index.html" )
32
32
else this .loadURL(" http://gitnote/index.html" )
33
33
34
34
registerAppSchemeHandler()
@@ -49,7 +49,7 @@ class GitNoteViewerWindow(
49
49
frontHandler.addHandler(" theme" , ThemeProtocolHandler ())
50
50
jsQuery.addHandler(frontHandler)
51
51
52
- if (phase == 0 ) {
52
+ if (useLocalGui ) {
53
53
browser.jbCefClient.addDisplayHandler(JCefDebugDisplayHandler (), browser.cefBrowser) // for debugging
54
54
}
55
55
}
You can’t perform that action at this time.
0 commit comments