This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: SBT and Idea.

5 replies
Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.

On Wed, Feb 15, 2012 at 9:05 AM, Edmondo Porcu wrote:
> Dear all,
> I followed the instructions to create an sbt based project in IDEA.
> Everything works fine except that my src/main/ folder is not automatically
> considered by idea as a source  folder, and the /src/test is not considered
> as a test folder.  Should I manually set that every time I import the
> project in IDEA?

That should definitely work.

Could you publish a small project to demonstrate the problem so we can
take a look.

Include a transcript of your SBT session; the contents of the
generated .iml files; and the versions of SBT and sbt-idea that you're
using.

-jason

edmondo1984
Joined: 2011-09-14,
User offline. Last seen 28 weeks 3 days ago.
SBT and Idea.
Dear all,
I followed the instructions to create an sbt based project in IDEA. Everything works fine except that my src/main/ folder is not automatically considered by idea as a source  folder, and the /src/test is not considered as a test folder.  Should I manually set that every time I import the project in IDEA?


Thank you very much for your support

Edmondo Porcu

Johannes Rudolph 2
Joined: 2010-02-12,
User offline. Last seen 42 years 45 weeks ago.
Re: SBT and Idea.

Hi Edmondo,

On Wed, Feb 15, 2012 at 9:05 AM, Edmondo Porcu wrote:
> Dear all,
> I followed the instructions to create an sbt based project in IDEA.
> Everything works fine except that my src/main/ folder is not automatically
> considered by idea as a source  folder, and the /src/test is not considered
> as a test folder.  Should I manually set that every time I import the
> project in IDEA?

No, shouldn't have to. I once had a similar problem, when the path to
the project contained (symbolic) links. Not sure what the exact
conditions of the problems were apart from that.

edmondo1984
Joined: 2011-09-14,
User offline. Last seen 28 weeks 3 days ago.
Fwd: SBT and Idea.
I am using 0.11.2  sbt, with sbt-idea 1.0.0 . This is what I see in my project.iml after running sbt gen-idea

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="scala" name="Scala">
      <configuration>
        <option name="compilerLibraryLevel" value="Global" />
        <option name="compilerLibraryName" value="scala-compiler-2.9.1 (2)" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/main" isTestSource="false" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="scala-library-2.9.1 (2)" level="application" />
  </component>
</module>


For some reason, when I right click on the source folder, my list is much shorter ( I can't add a Scala file, but only a scala Script for example) and in the UI the source folder doesn't appear blue as usual.


Thank you for your help
Best Regards
Edmondo

2012/2/15 Jason Zaugg <jzaugg@gmail.com>
On Wed, Feb 15, 2012 at 9:05 AM, Edmondo Porcu <edmondo.porcu@gmail.com> wrote:
> Dear all,
> I followed the instructions to create an sbt based project in IDEA.
> Everything works fine except that my src/main/ folder is not automatically
> considered by idea as a source  folder, and the /src/test is not considered
> as a test folder.  Should I manually set that every time I import the
> project in IDEA?

That should definitely work.

Could you publish a small project to demonstrate the problem so we can
take a look.

Include a transcript of your SBT session; the contents of the
generated .iml files; and the versions of SBT and sbt-idea that you're
using.

-jason


edmondo1984
Joined: 2011-09-14,
User offline. Last seen 28 weeks 3 days ago.
Re: SBT and Idea.
This is what I see when launching my sbt

[info] Loading project definition from C:\Users\porcu.GOTTEXBROKERS\Documents\Projects\springextension\project
[info] Set current project to springextension (in build file:/C:/Users/porcu.GOTTEXBROKERS/Documents/Projects/springextension/)
>  show compile:unmanaged-source-directories
[info] List(C:\Users\porcu.GOTTEXBROKERS\Documents\Projects\springextension\src\main\scala, C:\Users\porcu.GOTTEXBROKERS\Documents\Projects\springextension\src\main\java)
>

Thank you very much
Best Regards
Edmondo

2012/2/15 Edmondo Porcu <edmondo.porcu@gmail.com>
I am using 0.11.2  sbt, with sbt-idea 1.0.0 . This is what I see in my project.iml after running sbt gen-idea

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
  <component name="FacetManager">
    <facet type="scala" name="Scala">
      <configuration>
        <option name="compilerLibraryLevel" value="Global" />
        <option name="compilerLibraryName" value="scala-compiler-2.9.1 (2)" />
      </configuration>
    </facet>
  </component>
  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$">
      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
      <sourceFolder url="file://$MODULE_DIR$/src/main" isTestSource="false" />
    </content>
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="scala-library-2.9.1 (2)" level="application" />
  </component>
</module>


For some reason, when I right click on the source folder, my list is much shorter ( I can't add a Scala file, but only a scala Script for example) and in the UI the source folder doesn't appear blue as usual.


Thank you for your help
Best Regards
Edmondo

2012/2/15 Jason Zaugg <jzaugg@gmail.com>
On Wed, Feb 15, 2012 at 9:05 AM, Edmondo Porcu <edmondo.porcu@gmail.com> wrote:
> Dear all,
> I followed the instructions to create an sbt based project in IDEA.
> Everything works fine except that my src/main/ folder is not automatically
> considered by idea as a source  folder, and the /src/test is not considered
> as a test folder.  Should I manually set that every time I import the
> project in IDEA?

That should definitely work.

Could you publish a small project to demonstrate the problem so we can
take a look.

Include a transcript of your SBT session; the contents of the
generated .iml files; and the versions of SBT and sbt-idea that you're
using.

-jason



Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: SBT and Idea.

On Wed, Feb 15, 2012 at 10:35 AM, Edmondo Porcu wrote:
> Dear Jason,
> that's probably the source of the problem.
>
> I created a project in idea to obtain the right project structure. I added a
> build.sbt, then sbt-idea  to project/plugins.sbt, then I run sbt gen-idea.
> This doesn't work apparently...do you have an easiest way to create a sbt
> project with all the necessary folder structure?
>
> Thank you very much
>
> Edmondo

https://github.com/softprops/np

-jason

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland