Difference between pages "Talk:ASH Errors" and "IntelliJ Setup"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>PhilmASTErpLus
 
 
Line 1: Line 1:
Is this like were things like <font color="#ff7000">Script parsing error (X.ash, line Y)</font> are listed?--[[User:Icon315|Icon315]] 22:33, 14 April 2010 (UTC)
 
  
:It's where they WILL be listed, once they are listed. --[[User:Bale|Bale]] 22:52, 14 April 2010 (UTC)
+
==== KoLmafia has migrated to the GitHub with gradle builds. ====
  
What Bale said. Also, I changed that to orange; I kept trying to click on it. :( --[[User:StDoodle|StDoodle (#1059825)]] 00:35, 15 April 2010 (UTC)
 
  
Also, if anyone's feeling particularly ambitious, https://kolmafia.svn.sourceforge.net/svnroot/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java should help. Just look for all the instances of parseException. (Speaking of which, would it be useful if these were presented in the order that they're checked?) --[[User:Heeheehee|Heeheehee]] 00:17, 17 April 2010 (UTC)
+
[https://www.jetbrains.com/idea/ IntelliJ IDEA] is an IDE for developing Java applications. This guide assumes that you have a recent enough version of Java JDK, Ant, and IntelliJ IDEA. Completing [[Compiling from Source]] is a requirement for this guide, although experienced developers can skip to whatever step is appropriate.
  
I think alphabetical order would be better: this page is going to be excellent for first-time ASH scripters to understand what's wrong with their script. --[[User:Slyz|Slyz]] 10:41, 17 April 2010 (UTC)
+
The following instructions are based on IntelliJ IDEA 2021.2 Community Edition. Instructions for other versions/editions of IntelliJ may be slightly different.  The latest version is recommended.
  
Should we add the correct examples? Or are the fixes clear enough?
+
== Create a Project ==
--[[User:Slyz|Slyz]] 08:36, 18 April 2010 (UTC)
+
=== Create a new project ===
 +
# Start IntelliJ IDEA. In the ''Welcome to IntelliJ IDEA'' dialog, click '''Get from VCS'''.<br>[[File:Intellij-setup-c2021.2-welcome.png|300px]]
 +
# In the ''Get from Version Control'' dialog, select the '''Repository URL''' tab.
 +
## In ''Version control'', select '''GitHub'''.<br>[[File:Intellij-setup-c2021.2-get-from-vcs.png|300px]]
 +
## Add a new repository location. To do so, click the '''+''' button next to ''Repositories''.<br>[[File:Intellij-setup-c2021.2-get-from-vcs-subversion.png|300px]]
 +
## In the ''New Repository Location'' popup, enter the URL to KoLmafia's GitHub repository. If you have a GitHub account and a Personal Access Token, use  git@github.com:kolmafia/kolmafia.git  If you do not have a GitHub account, use  https://github.com/kolmafia/kolmafia.git<br>[[File:Intellij-setup-c2021.2-new-repository-location.png|200px]]
 +
## Click '''OK''' to close the popup.
 +
## Once the repository has been added, '''click the repository URL to highlight it''', then click '''Check Out'''.<br>[[File:Intellij-setup-c2021.2-get-from-vcs-check-out.png|300px]]
 +
# If the ''Destination Directory'' popup appears, choose a directory to check out the working copy.<br>''Caution'': Don't choose a common directory like <samp>C:\Users\&lt;username&gt;\Documents</samp>. Instead, create a new directory under it (by clicking the folder icon) and give it an appropriate name (e.g. <samp>kolmafia</samp>).<br>[[File:Intellij-setup-c2021.2-choose-working-copy-dir.png|200px]]<br>Click '''OK''' to continue.
 +
# IntelliJ will generate a new project. If it asks you whether to add <code>kolmafia.iml</code> to Subversion, you may click '''Cancel''' to skip it
  
If anything particularly complicated shows, we can give both. But so far, if you can't follow as written, I'm not sure you ever will. (That's the hypothetical "you," not the specific "hey Slyz what's wrong with you, you"). --[[User:StDoodle|StDoodle (#1059825)]] 23:35, 19 April 2010 (UTC)
+
=== Add the Gradle Build File ===
 +
# Open the Gradle Toolbar Item (typically on the right side, and not very large)
 +
# Click the '''+''' button to add a build file
 +
# Choose build.gradle from the file selector and press Open
 +
#Run Configurations should contain <code>kolmafia [runShadow]</code>. If it does not, continue to the next steps.
 +
#In the Gradle Toolbar click on the elephant to Execute Gradle Task
 +
#A window titled ''Run Anything'' will popup. Search for <code>runShadow</code> and select it
  
 
+
===How to build and run/debug===
 
+
#Click the drop down in the top right and select the desired option
{{CodeSample|description=The following code results in an error.
+
##<code>kolmafia [runShadow]</code> is the application itself
|code=<syntaxhighlight>
+
##<code>Tests in 'KoLMafia'</code> are the unit tests
void my_function( string myvar = "value" )
+
#Click the play button to build and run
{
+
#Or click the bug button to build and debug
  /* Do something */
 
}
 
</syntaxhighlight>}}
 
Error message: <blockquote>Cannot initialize parameter myvar (filename.ash, line X)</blockquote>
 
I'd like to add this to the article myself, but I'm not sure how to explain its exact nature. Would this message appear only in a situation like the above code? --[[User:PhilmASTErpLus|PhilmASTErpLus]] 09:30, 28 July 2010 (UTC)
 

Latest revision as of 01:09, 5 December 2023

KoLmafia has migrated to the GitHub with gradle builds.

IntelliJ IDEA is an IDE for developing Java applications. This guide assumes that you have a recent enough version of Java JDK, Ant, and IntelliJ IDEA. Completing Compiling from Source is a requirement for this guide, although experienced developers can skip to whatever step is appropriate.

The following instructions are based on IntelliJ IDEA 2021.2 Community Edition. Instructions for other versions/editions of IntelliJ may be slightly different. The latest version is recommended.

Create a Project

Create a new project

  1. Start IntelliJ IDEA. In the Welcome to IntelliJ IDEA dialog, click Get from VCS.
    Intellij-setup-c2021.2-welcome.png
  2. In the Get from Version Control dialog, select the Repository URL tab.
    1. In Version control, select GitHub.
      Intellij-setup-c2021.2-get-from-vcs.png
    2. Add a new repository location. To do so, click the + button next to Repositories.
      Intellij-setup-c2021.2-get-from-vcs-subversion.png
    3. In the New Repository Location popup, enter the URL to KoLmafia's GitHub repository. If you have a GitHub account and a Personal Access Token, use git@github.com:kolmafia/kolmafia.git If you do not have a GitHub account, use https://github.com/kolmafia/kolmafia.git
      Intellij-setup-c2021.2-new-repository-location.png
    4. Click OK to close the popup.
    5. Once the repository has been added, click the repository URL to highlight it, then click Check Out.
      Intellij-setup-c2021.2-get-from-vcs-check-out.png
  3. If the Destination Directory popup appears, choose a directory to check out the working copy.
    Caution: Don't choose a common directory like C:\Users\<username>\Documents. Instead, create a new directory under it (by clicking the folder icon) and give it an appropriate name (e.g. kolmafia).
    Intellij-setup-c2021.2-choose-working-copy-dir.png
    Click OK to continue.
  4. IntelliJ will generate a new project. If it asks you whether to add kolmafia.iml to Subversion, you may click Cancel to skip it

Add the Gradle Build File

  1. Open the Gradle Toolbar Item (typically on the right side, and not very large)
  2. Click the + button to add a build file
  3. Choose build.gradle from the file selector and press Open
  4. Run Configurations should contain kolmafia [runShadow]. If it does not, continue to the next steps.
  5. In the Gradle Toolbar click on the elephant to Execute Gradle Task
  6. A window titled Run Anything will popup. Search for runShadow and select it

How to build and run/debug

  1. Click the drop down in the top right and select the desired option
    1. kolmafia [runShadow] is the application itself
    2. Tests in 'KoLMafia' are the unit tests
  2. Click the play button to build and run
  3. Or click the bug button to build and debug