Skip to content

Commit

Permalink
Merge branch 'release/0.2.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-a committed Jan 18, 2021
2 parents 8d04478 + 0810aad commit a9c5c40
Show file tree
Hide file tree
Showing 34 changed files with 716 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Desktop.ini
.DS_Store
/tools/
/BuildArtifacts/
.history/
2 changes: 1 addition & 1 deletion GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ create:
footer-heading: Where to get it
footer-content: >
You can download this release from the
[marketplace](https://plugins.jetbrains.com/plugin/15729-cake-rider/versions/).
[marketplace](https://plugins.jetbrains.com/plugin/15729-cake-rider/versions/), after it has been released.
footer-includes-milestone: true
milestone-replace-text: "{milestone}"
export:
Expand Down
53 changes: 20 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typing the following in an elevated command prompt:
## Install Cake for Rider

Go to File -> Settings -> Plugins -> Marketplace and search for *Cake Rider*
Go to File -> Settings -> Plugins -> Marketplace and search for *Cake for Rider*

![Cake Rider Plugin](./images/riderPlugin.png)

Expand All @@ -29,53 +29,40 @@ however, Cake for Rider might make use of two other channels:
To use one of the channels open the [plugin page in the JetBrains Marketplace](https://plugins.jetbrains.com/plugin/15729-cake-rider/)
select *Versions* and switch the channel on the left side of the page. Download the desired version and install it manually.

## Build scripts tool window
## Documentation

Cake files in the project are automatically found by extension and their tasks are displayed in a tool window:
The full documentation of the latest release of Cake for Rider can be found at [https://cakebuild.net/](https://cakebuild.net/docs/integrations/editors/rider/)

![Cake tasks tool window](./images/toolWindow.png)
### Documentation changes in the upcoming release

Here, a double click on the task will run the task immediately:
#### File icons

![Running a Cake task](./images/cake-run.png)
Files with the extension `.cake` have the Cake logo as file icons now.

Alternatively, the buttons at the top of the tool window can be used to either run the task directly,
or create a new run configuration.
#### Custom arguments in run configurations

## Run configurations:
A new setting has been added to run configuration: *Arguments*. It can be used to supply custom arguments when running that configuration.

It is possible to have Cake tasks as run configurations:
![arguments](./images/runConfiguration-editor.png)

![Run configurations](./images/runConfigurations.png)
#### Search path and excludes

The configurations can either be created from an existing Cake task, using the tool window or
created manually using the run configuration editor:
The search path for where Cake files are searched to populate the Cake Tasks Window are now
configurable. Additionally excludes can be defined.

![Run configuration editor](./images/runConfiguration-editor.png)
The Paths are relative to the project root and should use "/" as separator between directories.
(e.g.`../build`.) Default is `.`.

## Settings
Excludes are regular expressions that each path is match against. Paths that match one of the expressions will be excluded.
Default: `.*/tools/.*`.

There are multiple configuration settings available under File -> Settings -> Build, Execution, Deployment -> Cake.
![Search paths settings](./images/searchPathsSettings.png)

All settings are project - specific and stored in the `.idea` folder. To share settings between project members, make sure to include `CakeRider.xml` in your source control.
## Discussion

### Generic settings
If you have questions, search for an existing one, or create a new discussion on the Cake GitHub repository.

* *Cake file extension*
This setting is used to find all Cake files and display them in the tool window.
Default: `cake`
* *Task Regex*
This regex is used to parse tasks from the Cake files.
Default: `Task\s*?\(\s*?"(.*?)"\s*?\)`
* *Verbosity*
This is the default verbosity to use, when running a task directly from the tool window or when creating a new run configuration.
Default: `normal`

### Runner settings

This window contains the runner to use when starting Cake. Additionally, a set of overrides can be added: Here, a regular expression is matched against the system property `os.name` and, if it matches, the runner is overridden.

Default value is `dotnet-cake` and default override is `dotnet-cake.exe` for the regex `^.*windows.*$`. This default requires the [Cake .NET tool](https://cakebuild.net/docs/running-builds/runners/dotnet-tool) being globally installed.
[![Join in the discussion on the Cake repository](https://img.shields.io/badge/GitHub-Discussions-green?logo=github)](https://github.com/cake-build/cake/discussions)

## Contribute

Expand Down
Binary file removed images/cake-run.png
Binary file not shown.
Binary file modified images/runConfiguration-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/runConfigurations.png
Binary file not shown.
Binary file added images/searchPathsSettings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/toolWindow.png
Binary file not shown.
22 changes: 20 additions & 2 deletions rider/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.gradle.internal.os.OperatingSystem
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
Expand All @@ -11,7 +12,7 @@ plugins {
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "0.6.5"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "0.6.2"
id("org.jetbrains.changelog") version "1.0.1"
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
id("io.gitlab.arturbosch.detekt") version "1.15.0"
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
Expand Down Expand Up @@ -83,10 +84,26 @@ tasks {
kotlinOptions.jvmTarget = "1.8"
}
}

withType<Detekt> {
jvmTarget = "1.8"
}
// workaround for https://youtrack.jetbrains.com/issue/IDEA-210683
getByName<JavaExec>("buildSearchableOptions") {
jvmArgs(
"--illegal-access=deny",
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
"--add-opens=java.desktop/java.awt=ALL-UNNAMED",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED",
"--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED",
"--add-opens=java.desktop/sun.font=ALL-UNNAMED",
"--add-opens=java.desktop/sun.swing=ALL-UNNAMED"
)

if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
jvmArgs("--add-opens=java.desktop/com.apple.eawt.event=ALL-UNNAMED")
}
}

patchPluginXml {
version(pluginVersion)
Expand Down Expand Up @@ -125,6 +142,7 @@ tasks {

runPluginVerifier {
ideVersions(pluginVerifierIdeVersions)
// reports are in ${project.buildDir}/reports/pluginVerifier - or set verificationReportsDirectory()
}

publishPlugin {
Expand Down
2 changes: 2 additions & 0 deletions rider/detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ formatting:
style:
ReturnCount:
max: 10
LoopWithTooManyJumpStatements:
maxJumpCount: 5
2 changes: 1 addition & 1 deletion rider/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pluginSinceBuild = 193
pluginUntilBuild = 203.*
# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
# See https://jb.gg/intellij-platform-builds-list for available build versions
pluginVerifierIdeVersions = 2019.3.5, 2020.1.4, 2020.2.3, 2020.3
pluginVerifierIdeVersions = RD-2019.3.4, RD-2020.1.4, RD-2020.2.3, RD-2020.3.2

platformType = RD
platformVersion = 2019.3
Expand Down
20 changes: 18 additions & 2 deletions rider/src/main/java/net/cakebuild/run/CakeConfigurationEditor.form
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="net.cakebuild.run.CakeConfigurationEditor">
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
Expand Down Expand Up @@ -56,9 +56,25 @@
</component>
<vspacer id="c4db2">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="66083" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Arguments"/>
</properties>
</component>
<component id="c829" class="javax.swing.JTextField" binding="argumentsField" custom-create="true">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.ui.components.fields.ExpandableTextField;
import net.cakebuild.shared.ui.VerbosityComboBox;
import org.jetbrains.annotations.NotNull;

Expand All @@ -15,6 +16,7 @@ public class CakeConfigurationEditor extends SettingsEditor<CakeConfiguration> {
private JTextField scriptPathField;
private JTextField taskField;
private JComboBox<String> verbosityBox;
private JTextField argumentsField;

@Override
protected void resetEditorFrom(@NotNull CakeConfiguration configuration) {
Expand All @@ -25,18 +27,20 @@ protected void resetEditorFrom(@NotNull CakeConfiguration configuration) {
scriptPathField.setText(state.getScriptPath());
taskField.setText(state.getTaskName());
((VerbosityComboBox)verbosityBox).setVerbosity(state.getVerbosity());
argumentsField.setText((state.getAdditionalArguments()));
}

@Override
protected void applyEditorTo(@NotNull CakeConfiguration configuration) throws ConfigurationException {
CakeConfigurationOptions state = configuration.getState();
if(state == null) {
throw new ConfigurationException("state is null: Can not set state.");
throw new ConfigurationException("State is null: can not set state.");
}

state.setScriptPath(scriptPathField.getText());
state.setTaskName(taskField.getText());
state.setVerbosity(((VerbosityComboBox)verbosityBox).getVerbosity());
state.setAdditionalArguments(argumentsField.getText());
}

@NotNull
Expand All @@ -47,5 +51,6 @@ protected JComponent createEditor() {

private void createUIComponents() {
verbosityBox = new VerbosityComboBox();
argumentsField = new ExpandableTextField();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="net.cakebuild.settings.CakeSearchPathSettingsEditor">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="59657" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="f01f4" class="javax.swing.JLabel">
<constraints border-constraint="North"/>
<properties>
<text value="Search paths"/>
</properties>
</component>
<grid id="b465e" binding="searchPathsPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
<grid id="adaa6" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="333f8" class="javax.swing.JLabel">
<constraints border-constraint="North"/>
<properties>
<text value="Exclude expressions"/>
</properties>
</component>
<grid id="9dd86" binding="excludesPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints border-constraint="Center"/>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</children>
</grid>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package net.cakebuild.settings;

import net.cakebuild.settings.controls.SimpleAddEditControl;
import net.cakebuild.shared.ui.RegexCellEditor;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.Collection;

public class CakeSearchPathSettingsEditor {
private JPanel content;
private JPanel searchPathsPanel;
private JPanel excludesPanel;
private SimpleAddEditControl mySearchPathsPanel;
private SimpleAddEditControl myExcludesPanel;

public JPanel getContent() { return content; }

public void setScriptSearchPaths(@NotNull Collection<String> paths){
mySearchPathsPanel.setData(paths);
}

public Collection<String> getScriptSearchPaths() {
return mySearchPathsPanel.getData();
}

public void setScriptSearchIgnores(@NotNull Collection<String> expressions) {
myExcludesPanel.setData(expressions);
}

public Collection<String> getScriptSearchIgnores() {
return myExcludesPanel.getData();
}

private void createUIComponents() {
mySearchPathsPanel = new SimpleAddEditControl(new String[] { "Path" }, () -> new String[] { "" } );
searchPathsPanel = mySearchPathsPanel.getContent();

myExcludesPanel = new SimpleAddEditControl(new String[] { "Exclude Regex" }, () -> new String[] { "" });
excludesPanel = myExcludesPanel.getContent();
RegexCellEditor regexCellEditor = new RegexCellEditor();
regexCellEditor.setOnValidationError(s -> { myExcludesPanel.setValidationError(s); return null; });
regexCellEditor.setOnValidationSuccess(() -> { myExcludesPanel.setValidationError(null); return null; });
myExcludesPanel.setCellEditor(0, regexCellEditor);
}
}
Loading

0 comments on commit a9c5c40

Please sign in to comment.