4

I have GitHub integration and Scala plugin enabled on my Intellij Ultimate. All I want to do is to create a Scala project and be able to publish it on to GitHub so that my collaborators can check out the project using their Intellij (with the same config as mine). I do the following steps. What am I doing wrong?

  1. Click "Create New Project" on Intellij Welcome window enter image description here

  2. Select "Scala Module" and set the Scala home. I called my project "Test" --> Project is now setup

  3. Create a Test.scala file. This will represent my project for now.

  4. Create a .gitignore file with the following entries. (Note that I ignore *.iml and .idea because they may be different for different users and they change frequently, i.e. the .iml file and the content of the .idea folder change frequently)

    *.iml .DS_Store .idea

  5. Publish the project via VCS --> Import into Version Control --> Share project on GitHub

  6. Add the Test.scala file and the .gitignore file to be committed and pushed. enter image description here

  7. Commit & push. It's successful.

---- Problem starts here ----

On a different machine (that has Intellij with the same config)

  1. Click "Check out from Version Control" on Intellij Welcome pane. Select GitHub enter image description here

  2. Select the remote repository to check out and the directory name for the local repository.

  3. Intellij prompts "Would you like to create an Intellij IDEA project for the sources you have checked out to /Users/platypus/IdeaProject/Test?" Click "Yes"

  4. Select the SDK enter image description here

  5. Click "Next" on "Import Project from Existing Sources" enter image description here

  6. Intellij displays, "Source files for your project not found." When you click finish, on the left/navigation pane, you see no Test.scala or .gitignore files. enter image description here

How do you share your Scala project with others on GitHub using Intellij??

Makoto
  • 104,088
  • 27
  • 192
  • 230
platypus
  • 1,165
  • 5
  • 27
  • 47
  • Have you find out why there is the "Source files for your project not found" message? I have the same problem with Clojure and can't figure it out... – tillda Aug 12 '13 at 18:43
  • My best guess is that Intellij doesn't recognize Scala files by default, but no I don't know the answer with 100% certainty. – platypus Aug 21 '13 at 20:26

2 Answers2

2

I would not check-in IntelliJ specific (or eclipse specific) files at all, why limit the contributors to a specific IDE? and why limit them to specific settings? I think you have 2 main choices that will allow any collaborator to work on the project while making the configuration overhead of a new contributor to a minimum.

  1. Maven - although for Scala projects sbt is more idiomatic, maven is ubiquitous, supported by all major IDEs - and doens't even require to have an IDE

  2. SBT - although it has less "mainstream" support in IDEs it can create the project files for you using plugins (e.g. see this question: How to create SBT project with IntelliJ Idea?)

I would recommend #1 - start with a new Maven project, and add a Scala nature, you can create it from an archtype so scala compilation is supported from maven command line (see this for example)

Community
  • 1
  • 1
Eran Medan
  • 44,555
  • 61
  • 184
  • 276
  • I am not trying to limit contributors to a specific IDE. That's why I put all the IDE-specific files in the .gitignore before I commit and push. – platypus Jul 08 '13 at 20:53
  • and I assume you use http://maven.apache.org/plugins/maven-idea-plugin/ to generate idea files for Maven projects. Is this correct? – platypus Jul 08 '13 at 21:15
0

You should checkout from Git. Not Github. I faced the same problem. Its resolved at my end

A user
  • 1,060
  • 3
  • 19
  • 47