Skip to content

Commit

Permalink
fatJar in kotlin DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
cschar committed Jul 17, 2021
1 parent 6ea013d commit 8f13bb3
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 57 deletions.
16 changes: 1 addition & 15 deletions README_dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ To run project:
./gradlew runIde


# Snags I ran into:

- If gradle forces you to download new IDE for sandbox
-- download separately and place e.g.
'/Users/USERNAME/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre/jbr-11_0_3-osx-x64-b304.10.tar.gz'
.e.g.
```
cd ~/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre
rm -rf *.*
cp ~/Downloads/jbr-11_0_6-osx-x64-b765.25.tar.gz ~/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre
## or whatever version is current e.g.
cp ~/Downloads/jbr-XX_X_X-osx-x64-bXXX.XX.tar.gz ~/.gradle/caches/modules-2/files-2.1/com.jetbrains/jbre
```


- If serialized options are messed up
--- delete build/idea-sandbox/config/options/power.mode3.xml
Expand All @@ -90,7 +76,7 @@ Caused by: java.lang.ClassNotFoundException: org.json.JSONException PluginClassL

--Fixed by packaging a FAT JAR
https://discuss.gradle.org/t/how-to-include-dependencies-in-jar/19571/5

or using shadowJar w/ gradle

#launch bug:
WARNING: An illegal reflective access operation has occurred
Expand Down
33 changes: 3 additions & 30 deletions README_dev_refactor.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ https://stackoverflow.com/a/46533151/5198805
https://github.com/radarsh/gradle-test-logger-plugin



- SettingsSavingComponent ?

interesting blog post on figuring out openAPI:
http://vladsch.com/blog/3

BINGO
https://github.com/krasa/StringManipulation/issues/92
links to
[1] https://github.com/krasa/StringManipulation/commit/43a4bc5e99f63663a7b2c5d8d75b1550a3e0a408
Expand All @@ -30,36 +26,13 @@ links to
https://www.plugin-dev.com/intellij/general/plugin-initial-load/


## CURRENT BUGS
## BUGS ?


- The PostStartupActivity is called each time a project is opened.. instad of when application is loaded.
------ Not a bug... seems to still only be called once... each EditorActionHandler is unique to each project.

-- Run the "plugin" task, then close the project wihtout hitting red 'stop' icon in launcher IDE...
console shows a Memory leak error....

-- When stopping with CTRL+SHIFT+Z.... particles still float away instead of immediatly disappearing\


--- gradlew :buildSearchableOptions..... HANGS WHEN A BACKGROUND THREAD IS RUNNING In configurable

#### Tests

- Load .xml file from a fixture, assert the settings configured, are whats in the file
--- This will allow us to then change Enum structure, create a 'migration' of settings




## BUG when uprading to v2021

ered in Disposer but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:

java.lang.RuntimeException: Memory leak detected: 'com.cschar.pmode3.PowerMode3$4@107c8977' of class com.cschar.pmode3.PowerMode3$4 is registered in Disposer but wasn't disposed.
Register it with a proper parentDisposable or ensure that it's always disposed by direct Disposer.dispose call.
See https://jetbrains.org/intellij/sdk/docs/basics/disposers.html for more details.
The corresponding Disposer.register() stacktrace is shown as the cause:
-- in Droste, moving caret with arrow keys doesnt resize cover

25 changes: 18 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ plugins {
id("io.gitlab.arturbosch.detekt") version "1.17.1"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
// id("org.jlleitschuh.gradle.ktlint") version "10.0.0"

id("com.github.johnrengelman.shadow") version "7.0.0"
}
group = project.findProperty("pluginGroup").toString()
// group = properties("pluginGroup")
Expand All @@ -44,15 +46,17 @@ var remoteRobotVersion = "0.11.4"

dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1")

implementation("org.junit.jupiter:junit-jupiter:5.7.0")
// implementation(files("libs/imgscalr-lib-4.2.jar"))
// implementation(files("libs/jlayer-1.0.1.jar"))
// implementation(files("libs/json-20090211.jar"))

implementation(group = "org.json", name = "json", version = "20090211")
implementation(group = "javazoom", name = "jlayer", version = "1.0.1")
implementation(group = "org.imgscalr", name = "imgscalr-lib", version = "4.2")

// configurations.compile.extendsFrom(configurations.extraLibs)


// robot-ui testing stuff
// testImplementation 'com.intellij.remoterobot:remote-robot:' + remoteRobotVersion
// testImplementation 'com.intellij.remoterobot:remote-fixtures:' + remoteRobotVersion
Expand All @@ -61,13 +65,11 @@ dependencies {
// https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/com/intellij/remoterobot/
testImplementation("com.intellij.remoterobot:remote-robot:" + "0.11.4")
testImplementation("com.intellij.remoterobot:remote-fixtures:" + "0.11.4")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.2")

// testImplementation(group="org.apache.logging.log4j", name="log4j-slf4j-impl", version= "2.14.1")
// testImplementation(group="org.slf4j", name="slf4j-api", version="1.7")
// testImplementation(group="ch.qos.logback", name="logback-classic", version="1.0.9")
// testImplementation(group="ch.qos.logback", name="logback-core", version="1.0.9")


// Logging Network Calls
testImplementation("com.squareup.okhttp3:logging-interceptor:4.9.1")
Expand Down Expand Up @@ -119,9 +121,18 @@ tasks.register("hello") {
}
}



// https://docs.gradle.org/current/userguide/tutorial_using_tasks.html
tasks {
// https://github.com/johnrengelman/shadow
jar {
//https://docs.gradle.org/current/userguide/more_about_tasks.html
//https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.Jar.html#org.gradle.api.tasks.bundling.Jar:archiveBaseName

//https://stackoverflow.com/questions/56518451/
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
}


// tag example: https://www.baeldung.com/junit-5-gradle#configuring-junit-5-tests-with-gradle
// from CLI: // gradle clean test -DincludeTags='regression' -DexcludeTags='accessibility'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void editorReleased(@NotNull EditorFactoryEvent event) {

public void update(final Editor editor) {

if (PowerMode3.getInstance().isEnabled()) {
if (settings.isEnabled()) {
SwingUtilities.invokeLater(new Runnable() {

@Override
Expand Down Expand Up @@ -150,7 +150,6 @@ public Anchor[] getAnchors(Editor editor, ParticleContainer particleContainer) {
int caretOffset = editor.getCaretModel().getOffset();

ArrayList<Anchor> points = new ArrayList<Anchor>();
// int searchLength = PowerMode3.getInstance().getMaxPsiSearchDistance();
int searchLength = settings.getMaxPsiSearchDistance();

String documentText = editor.getDocument().getText();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
} catch (InterruptedException e) {
e.printStackTrace();
}
menuConfigurableUI.initMemoryStatsPanel();
try{
menuConfigurableUI.initMemoryStatsPanel();
}catch(NullPointerException e){

}
}
}
};
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@




<!-- https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#action-declaration-reference-->
<actions>
<action id="com.cschar.pmode3.PowerModeZeranthiumToggleEnabled"
class="com.cschar.pmode3.hotkeys.HotKeyEnabledAction"
text="Power Mode Zeranthium Toggle"
description="Toggle power mode Zeranthium">
<add-to-group group-id="ToolsMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="shift ctrl z"/>

<override-text place="ToolsMenu" text="Toggle _Zeranthium"/>
</action>

<group id="com.cschar.pmode3.GroupedActions" text="Power Mode Zeranthium Actions" popup="true">
Expand All @@ -65,13 +67,17 @@
text="Trigger Music A for Power Mode Zeranthium"
description="Trigger music A for power mode Zeranthium">
<keyboard-shortcut keymap="$default" first-keystroke="shift ctrl j"/>

<override-text place="ToolsMenu" text="Trigger Music A _Zeranthium"/>
</action>

<action id="com.cschar.pmode3.PowerModeZeranthiumTriggerSongB"
class="com.cschar.pmode3.hotkeys.HotKeyMusicTriggerBAction"
text="Trigger Music B for Power Mode Zeranthium"
description="Trigger music B for power mode Zeranthium">
<keyboard-shortcut keymap="$default" first-keystroke="shift ctrl l"/>

<override-text place="ToolsMenu" text="Trigger Music B _Zeranthium"/>
</action>
</group>

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configJSON/DROSTE.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"val2": 20,
"isCyclic": false,
"alpha": 0.3,
"val1": 20,
"val1": 40,
"scale": 2.0,
"enabled": true,
"speedRate": 2
Expand Down

0 comments on commit 8f13bb3

Please sign in to comment.