Functional Programming Principles in Scala: Setting up IntelliJ

Functional Programming Principles in Scala: Setting up IntelliJ 1
Plugins

Tips and hints from software program developers on the way to installation your IntelliJ IDE to paintings well with Coursera’s Functional Programming Principles in Scala course
The IntelliJ IDE, properly installation for Scala
The IntelliJ IDE, properly installation for Scala
Coursera’s Functional Programming Principles in Scala course has kicked off, and we’re very well taking part in it so far. However, Scala is one of the principal languages we use, and we opt to use IntelliJ in place of the officially supported Eclipse. It took a chunk of tinkering, but we’ve got compiled a listing of instructions for purchasing IntelliJ up and strolling with the path’s assignments. If, like us, you’d as a substitute use IntelliJ, then read on!

We’ll count on (because you’ve got a choice) that you have already got IntelliJ set up and introduced the Scala plugin. We’ll also count on you have observed the route’s instructions on installing SBT, so do that now if you haven’t already. These instructions, on the whole, apply to Unix-like working systems (OSX and Linux) with a command line and a general domestic listing. However, if you manage to follow those instructions on Windows (or have an opportunity method), please let us know the feedback underneath.

For this walkthrough, we’re going to use the introductory example project. Still, you could use identical commands for the primary week’s project, and – we expect that destiny weeks will work the same way.

Image result for plug

The first step is to get a set-idea, an SBT plugin that mechanically generates the files IntelliJ desires to run a Scala task. To use the plugin, upload the subsequent line in your ~/.Sat/plugins/build.Sbt record (you could create the directories if they do not exist).

AddSbtPlugin(“com.Github.Mpeltonen” %% “set-idea” % “1.1.Zero-M2-TYPESAFE”)
Then, download the mission’s zip record from the internet site and extract it to anyplace you need to paintings on the assignments.

From within your newly extracted directory, open an SBT console (by typing set) and run:

RELATED ARTICLES :

This will create an IntelliJ mission and ensure all of the mission’s dependencies are included. More data about the sbt-idea plugin is in this StackOverflow thread or the plugin’s documentation.

Don’t worry if you see a few warnings – SBT is quite noisy, and unless there are any severe mistakes, it’s commonly simply grumbling.

SBT complaining about things
SBT complaining approximately things
Now open IntelliJ and select File > Open Project

Your listing should now end up an IntelliJ mission
Your directory ought to now come to be an IntelliJ mission
The set-concept plugin has already become this listing into an IntelliJ challenge, so it has to appear with the IntelliJ emblem, as within the screenshot above.

With the assignment now open, we will need to do a chunk of config to make it paintings efficiently. This is because the zip document you download genuinely includes a few one-of-a-kind initiatives. For instance, a submission undertaking within it looks after submitting your work to be marked. While these initiatives are required to make the submission system work, we don’t need to fear it inside the IDE while working on the assignments.

Go to File, Project Structure, and pick out the “Modules” segment if it isn’t already highlighted.

Your project shape should display three modules
Your venture shape must show three modules
In the second panel, you need to see three modules, “task,” “project-construct,” and “submission.” The mission is your actual paintings, so cross in advance and remove the alternative two.

It ought to then look like the subsequent screenshot:

Just one module ultimate
Just one module closing
Next, you could put off the resources folders from the sources src/important/resources and src/check/resources. These are highlighted in red because IntelliJ can’t locate them (they don’t exist).

The purple
The crimson “lacking” folders at the moment are gone
We want to tell IntelliJ to use the Scala Compiler and Library while running code inside the task.

Select the Scala facet beneath the task challenge:

Note the
Note the “Settings” hyperlink along with the “Use undertaking FSC” checkbox
Where it says “Use assignment FSC,” we’re going to need to click on Settings to configure the compiler. In the “Project FSC” phase, choose “Scala-2.9.2” from the drop-down field and click OK.

Make certain to pick your Compiler library
Make sure to select your Compiler library
It may also say “2 errors determined” at the bottom of the venture settings; however, these are just unused libraries, so cross in advance and close the settings. (If you do determine to tidy it up, do not delete the Scala-2.9.2 library – IntelliJ may also say it is not using it; however, you may fast see it is fibbing).

The Helicopter Game
Facebook Twitter Pinterest
This easy flight sim, which calls for you to deftly faucet the mouse button to keep your chopper airborne, is one of the maximum performed Flash games inside the records of the platform. It’s also absolutely an influence on certainly one of the most important phone gaming hits of 2013: Flappy Bird. Be warned: in case you begin playing it, you likely gained’t get whatever else done nowadays.

Now you ought to be up and walking! To test that it’s far operating, open up the ListsSuite.Scala document and strive strolling the exams. They need to run successfully, and (until you’ve got already constantly them) you should see that six assessments had been run, four of which failed.

Success! Your IDE is now geared up to head.
Success! Your IDE is now prepared to go.
Now you are ready to tackle the example assignment in IntelliJ and then, with any luck, move on to the path itself. Success!