Skip to content

Commit 014099f

Browse files
authored
Merge pull request #355 from SeeSharpSoft/fb_version_dependent_build
Fb version dependent build
2 parents 18004c7 + 59347a9 commit 014099f

File tree

7 files changed

+36
-30
lines changed

7 files changed

+36
-30
lines changed

.github/workflows/PublishStable.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414

15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- ideaVersion: IC-2022.1.1
20+
gkVersion: 2021.1.2
21+
- ideaVersion: IC-2022.2.1
22+
gkVersion: 2021.1.2
23+
1524
steps:
1625
- uses: actions/checkout@v2
1726
- name: Set up JDK 17
@@ -23,8 +32,9 @@ jobs:
2332
run: chmod +x gradlew
2433
- name: Build with Gradle
2534
env:
26-
IDEA_VERSION: IU-2022.1.1
27-
GRAMMAR_KIT_VERSION: 2021.1.2
35+
36+
IDEA_VERSION: ${{ matrix.ideaVersion }}
37+
GRAMMAR_KIT_VERSION: ${{ matrix.gkVersion }}
2838
IDEA_SOURCES: false
2939
JI_CHANNELS: Stable
3040
JI_TOKEN: ${{ secrets.JI_TOKEN }}

build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jacocoTestReport {
1919
}
2020

2121
group 'net.seesharpsoft.intellij.plugins'
22-
version '3.0.0'
2322

2423
apply plugin: 'java'
2524
project.sourceCompatibility = JavaVersion.VERSION_11
@@ -67,20 +66,30 @@ idea {
6766
}
6867
}
6968

69+
var final EAP_VERSION = 'LATEST-EAP-SNAPSHOT';
70+
// IDE version - https://www.jetbrains.com/intellij-repository/releases
71+
var idea_version = System.getenv().getOrDefault('IDEA_VERSION', 'IC-2022.1.1')
72+
var build_version = idea_version == EAP_VERSION ? idea_version : idea_version.substring(5, 7) + idea_version.charAt(8) // extract e.g. '221' from 'IC-2022.1.1'
73+
74+
version '3.0.0-' + build_version
75+
7076
apply plugin: 'org.jetbrains.intellij'
7177
intellij {
72-
// IDE version - https://www.jetbrains.com/intellij-repository/releases
73-
version = System.getenv().getOrDefault('IDEA_VERSION', 'IC-2022.1.1')
78+
version = idea_version
7479
pluginName = 'CSV'
75-
updateSinceUntilBuild = false
80+
updateSinceUntilBuild = true
7681
downloadSources = Boolean.parseBoolean(System.getenv().getOrDefault('IDEA_SOURCES', "true"))
7782

7883
plugins = [
79-
System.getenv().getOrDefault('GIT_PLUGIN_VERSION', 'Git4Idea'),
80-
System.getenv().getOrDefault('GITHUB_PLUGIN_VERSION', 'org.jetbrains.plugins.github')
84+
'Git4Idea',
85+
'org.jetbrains.plugins.github'
8186
]
8287
}
8388
patchPluginXml {
89+
// see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description
90+
sinceBuild = build_version == EAP_VERSION ? '221' : build_version
91+
untilBuild = build_version == EAP_VERSION ? '*' : build_version + ".*"
92+
8493
changeNotes = """<pre style="font-family: sans-serif">
8594
Major update release 3.*!
8695

src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package net.seesharpsoft.intellij.plugins.csv;
22

3+
import com.intellij.ide.BrowserUtil;
34
import com.intellij.ide.actions.ShowSettingsUtilImpl;
45
import com.intellij.ide.plugins.IdeaPluginDescriptor;
56
import com.intellij.ide.plugins.PluginManagerCore;
6-
import com.intellij.ide.ui.IdeUiService;
77
import com.intellij.notification.*;
88
import com.intellij.openapi.extensions.PluginId;
99
import com.intellij.openapi.options.ShowSettingsUtil;
@@ -37,7 +37,7 @@ private static void openLink(Project project, String link) {
3737
if (link.startsWith("#")) {
3838
((ShowSettingsUtilImpl) ShowSettingsUtil.getInstance()).showSettingsDialog(project, link.substring(1), null);
3939
} else {
40-
IdeUiService.getInstance().browse(link);
40+
BrowserUtil.browse(link);
4141
}
4242
}
4343

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/CsvTableEditor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.intellij.openapi.editor.colors.EditorFontType;
99
import com.intellij.openapi.fileEditor.*;
1010
import com.intellij.openapi.project.Project;
11-
import com.intellij.openapi.util.CheckedDisposable;
1211
import com.intellij.openapi.util.Key;
1312
import com.intellij.openapi.util.UserDataHolder;
1413
import com.intellij.openapi.util.UserDataHolderBase;
@@ -32,7 +31,7 @@
3231
import java.util.Arrays;
3332
import java.util.Collection;
3433

35-
public abstract class CsvTableEditor implements FileEditor, FileEditorLocation, CheckedDisposable, PsiFileHolder {
34+
public abstract class CsvTableEditor implements FileEditor, FileEditorLocation, PsiFileHolder {
3635

3736
public static final String EDITOR_NAME = "Table Editor";
3837

@@ -190,7 +189,6 @@ public void dispose() {
190189
getTableModel().dispose();
191190
}
192191

193-
@Override
194192
public boolean isDisposed() {
195193
return this.myDisposed;
196194
}

src/main/java/net/seesharpsoft/intellij/plugins/csv/editor/table/swing/CsvTableEditorActionListeners.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
package net.seesharpsoft.intellij.plugins.csv.editor.table.swing;
22

3+
import com.intellij.ide.BrowserUtil;
34
import com.intellij.openapi.fileEditor.FileEditorManager;
45
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
56
import com.intellij.ui.components.labels.LinkLabel;
67
import com.intellij.ui.components.labels.LinkListener;
78
import net.seesharpsoft.intellij.plugins.csv.editor.table.CsvTableActions;
89

910
import javax.swing.*;
10-
import java.awt.*;
1111
import java.awt.event.ActionListener;
12-
import java.io.IOException;
13-
import java.net.URI;
1412
import java.util.Arrays;
1513
import java.util.stream.Collectors;
1614

@@ -173,16 +171,7 @@ public void linkSelected(LinkLabel linkLabel, Object o) {
173171
private final class OpenCsvPluginLink implements LinkListener {
174172
@Override
175173
public void linkSelected(LinkLabel linkLabel, Object o) {
176-
if (Desktop.isDesktopSupported()) {
177-
Desktop desktop = Desktop.getDesktop();
178-
if (desktop.isSupported(Desktop.Action.BROWSE)) {
179-
try {
180-
desktop.browse(URI.create("https://github.com/SeeSharpSoft/intellij-csv-validator"));
181-
} catch (IOException e) {
182-
e.printStackTrace();
183-
}
184-
}
185-
}
174+
BrowserUtil.browse("https://github.com/SeeSharpSoft/intellij-csv-validator");
186175
}
187176
}
188177
}

src/main/java/net/seesharpsoft/intellij/plugins/csv/formatter/CsvFormattingModelBuilder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ private static SpacingBuilder createSpaceBuilder(CodeStyleSettings settings) {
3939
return builder;
4040
}
4141

42+
private static ExternalFormattingModelBuilderImpl DUMMY_FORMATTING_MODEL_PROVIDER = new ExternalFormattingModelBuilderImpl(null);
43+
4244
@Override
4345
@NotNull
4446
public FormattingModel createModel(FormattingContext formattingContext) {
4547
switch (formattingContext.getFormattingMode()) {
4648
case ADJUST_INDENT:
4749
case ADJUST_INDENT_ON_ENTER:
4850
// do not care about indent during editing (baaad performance)
49-
return FormatterImpl.getInstance().createDummyFormattingModel(formattingContext.getPsiElement());
51+
// NOTE: Formatter.getInstance().createDummyFormattingModel(formattingContext.getPsiElement()); <-- marked as internal, but this DummyFormattingModel is all I want
52+
return DUMMY_FORMATTING_MODEL_PROVIDER.createModel(formattingContext);
5053
case REFORMAT:
5154
PsiElement element = formattingContext.getPsiElement();
5255
CodeStyleSettings settings = formattingContext.getCodeStyleSettings();

src/main/resources/META-INF/plugin.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
</p>
4646
]]></description>
4747

48-
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
49-
<idea-version since-build="221" />
50-
5148
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html on how to target different products -->
5249
<depends>com.intellij.modules.lang</depends>
5350
<depends optional="true" config-file="withGithub.xml">org.jetbrains.plugins.github</depends>

0 commit comments

Comments
 (0)