https://github.com/b1f6c1c4/gradle-run-with-arguments

IntelliJ IDEA plugin: gradlew run --args "..."; System.out.print(...);

https://github.com/b1f6c1c4/gradle-run-with-arguments

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

debug gradle intellij intellij-idea intellij-plugin
Last synced: 5 months ago · JSON representation

Repository

IntelliJ IDEA plugin: gradlew run --args "..."; System.out.print(...);

Basic Info
  • Host: GitHub
  • Owner: b1f6c1c4
  • License: mit
  • Language: Java
  • Default Branch: master
  • Homepage:
  • Size: 85 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
debug gradle intellij intellij-idea intellij-plugin
Created about 6 years ago · Last pushed almost 6 years ago
Metadata Files
Readme License

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)

  1. You should first install the IntelliJ IDEA plugin Gradle Run with Arguments. Open Settings/Plugin (or Preferences/Plugin). Type the name in the search box. Install.
  2. Decide if you want to use a JAR configuration or a Gradle configuration.
    • Choose JAR if you want to use System.out.print but 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.
  3. If you've chosen JAR configuration, you need to patch your gradle/wrapper/gradle-wrapper.jar file by right-click on it and select Patch for "Run with Arguments". This step is required as long as you are using JAR configuration.
  4. If you don't have a configuration yet, just click the blue triangle next to the Build Project button 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.
  5. 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.print while 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

52BE D143 A92D BE96 2B83 092B 9BAC 0164 9600 1E70

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 23
  • Total Committers: 1
  • Avg Commits per committer: 23.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
b1f6c1c4 b****4@g****m 23

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
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels