https://github.com/b1f6c1c4/gradle-run-with-arguments
IntelliJ IDEA plugin: gradlew run --args "..."; System.out.print(...);
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Repository
IntelliJ IDEA plugin: gradlew run --args "..."; System.out.print(...);
Basic Info
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
gradle-run-with-arguments
IntelliJ IDEA plugin:
gradlew run --args "...";System.out.print(...);
Why
What's wrong with the Gradle application plugin
The Gradle application plugin requires that you pass the command line arguments in the --args task property.
This becomes troublesome when using IntelliJ IDEA, in which the task properties are buried deep in the menu.
It's a total nightmare if you are debugging by changing the arguments.
So I wrote this plugin to automatically prompt for the arguments and change the --args task property accordingly.
What's wrong with the IntelliJ IDEA's Gradle plugin
There is a long-standing bug that System.out.print will not flush to the Run panel in IntelliJ IDEA.
See the following links for more information:
This bug hasn't been fixed for years and we can't wait infinitely for this. So I wrote this plugin (specifically v2.0 and above) as a workaround. How this plugin works will be explained lateron.
How (TL;DR)
- You should first install the IntelliJ IDEA plugin
Gradle Run with Arguments. OpenSettings/Plugin(orPreferences/Plugin). Type the name in the search box. Install. - Decide if you want to use a JAR configuration or a Gradle configuration.
- Choose JAR if you want to use
System.out.printbut not the built-in debugging functionality for gradle. - Choose Gradle if you want to use the built-in debugging functionality for gradle but not
System.out.print.
- Choose JAR if you want to use
- If you've chosen JAR configuration, you need to patch your
gradle/wrapper/gradle-wrapper.jarfile by right-click on it and selectPatch for "Run with Arguments". This step is required as long as you are using JAR configuration. - If you don't have a configuration yet, just click the blue triangle next to the
Build Projectbutton next to the configuration combo in the toolbar run group. It will prompt you for creating a new configuration. Click the blue triangle again to modify your command line arguments. - If you already have a configuration and you want to add another one, just click
Run/Run with Arguments/Add XXX Configuration.
Warning
Using this plugin is likely to destroy all the script argument settings of your run configuration(s). Only use this plugin on its own run configurations.
Common Problems
Quoting is not behaving properly
Consider using single quotes (') instead of (") when introducing argument(s) with spaces.
However, there is no way to escape quotes.
no main manifest attribute
RTFM - patch your gradle/wrapper/gradle-wrapper.jar file by right-click on it and select Patch for "Run with Arguments".
Limitation
- There's currently no way to support
System.out.printwhile supporting in IntelliJ IDEA built-in debugging functionality at the same time. - There's currently no way to escape a quote (
'or") in the argument. - There's currently no way to use
"instead of'to group the arguments.
Owner
- Login: b1f6c1c4
- Kind: user
- Location: NJ, USA
- Company: Princeton University
- Repositories: 26
- Profile: https://github.com/b1f6c1c4
52BE D143 A92D BE96 2B83 092B 9BAC 0164 9600 1E70
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0