score:0
Previous answer/s is/are of high importance as well as the question since these tools are not self explanatory. Based on personal experience with this challenge which seemed impossible but when one acknowledges few key insurance policy reference points things will become reality:
- Implementation of development environment may require radical re-installation as new tool is adopted (if you adopt GIT after you already had SBT in place you may need to empty SBT's working directory as GIT require the cloning process to have empty house on local working directory)
- Keep really well updated backups especially when considering re-setting any of this "domino" environment layers as some of the GUI or command initiated cleansing operations truly take care of that sometimes with surprising effectiveness and without any regard to other tools / layers requirements
- Keep really good documentation (including previous pragmatic answer) on key stages to make things a reality (again)
score:30
A new Scala project typically requires being set up for sbt, eclipse (if you so choose) and github such that it all works together. After investing some time on this setup, it may help to have this list for aligning these 3 tools/services, for as long as simpler ways are not available. The series of steps that works for me follows. It assumes you have the Scala IDE plugin installed in eclipse.
- Create a new repo in Github.
- Decide a directory location for the new project
- In eclipse, use the Git Repositories View to import the Github repo into that location. Alternatively you can use command line git for that.
- Locate to that same location you've chosen for the project and run
sbt eclipse
. This makes sure eclipse will be able to handle the sbt project structure, so that your project can be built by sbt while also being intelligible for eclipse. Ifsbt eclipse
doesn't work, the sbt eclipse plugin is probably not installed in sbt - install it. - In eclipse, use
File --> Import --> General --> Existing Projects into Workspace
, selecting that same location, so that eclipse builds its project structure for the file structure having just been prepared by sbt. Make git ignore all but the core of your new project by updating the .gitignore file to ignore eclipse and sbt files. The following seems to be currently fine.
*.class *.log # sbt specific dist/* target/ lib_managed/ src_managed/ project/boot/ project/plugins/project/ # Scala-IDE specific .scala_dependencies # Eclipse specific .project .classpath .cache
You should now be able to run the project in eclipse, and in sbt, and commit and push code changes through git. To see the empty project run, which may very well make sense at this stage, you can add a scala class in eclipse to it, containing merely the following code. Note that scala sources should typically sit under src/main/scala. If this path doesn't exist yet, create it through e.g. mkdir -p src/main/scala
on Unix.
object hello {
def main(args: Array[String]) {
println("Main starting")
}
}
Or alternatively only this code:
object app extends App {
println("Application starting")
}
It should work now. Need to disclaim that future versions of eclipse, sbt, etc may render this outdated. If this is dead wrong in your environment, you can add a better answer.
Source: stackoverflow.com
Related Query
- How to initialize a new Scala project in sbt, Eclipse and github
- How to synchronize Intellij and sbt builds for a scala project
- How to avoid adding a 'root' scala sbt project in IntelliJ when defining github dependencies?
- How to setup scala sbt project for nd4j and deeplearning4j
- How can I use scala sources from a different location in a sbt project and also make it work with IntelliJ IDEA?
- How to debug permgen memory errors for a project that uses sbt and play 2 framework in Scala
- How to build a jar file out of github project in sbt to be used in a scala program
- How to compile and run existing project of scala in eclipse
- Pros and cons of using sbt vs maven in Scala project
- How to fully clean, re-resolve and rebuild a Scala sbt-managed project in IDEA?
- IntelliJ IDEA 13: new Scala SBT project hasn't src directory structure generated
- Mixing Scala and Java files in an Eclipse project
- How can I change version of Scala that is used by Play, SBT and its plugins?
- How turn off/on typer phase in scala repl and sbt console
- How do you open a single project for Java, Scala and JRuby in Eclipse?
- How to create an Eclipse Scala project in typesafe activator?
- How do you run cucumber with Scala 2.11 and sbt 0.13?
- How to obfuscate fat Scala Jar with Proguard and SBT
- How to debug a Scala SBT project in IntelliJ 13?
- How to share code between project and build definition project in SBT
- how can I interop kotlin code in an existing SBT scala project
- How to develop and run spark scala from vscode using sbt or Metals
- How can I run a Scala project as a Scala application by default in Eclipse IDE?
- how to debug scala sbt project in vs code
- Importing a Scala project from github into Eclipse
- Mixing AspectJ and Scala in an Eclipse Project
- scala sbt test run setup and cleanup command once on multi project
- How to run an existing Scala project using VS Code and Metals?
- Spark Scala - How do I iterate rows in dataframe, and add calculated values as new columns of the data frame
- How to combine sbt continuous testing with eclipse scala ide?
More Query from same tag
- Accessing value by javascript Play Framework/Scala
- How to get project name using activator (or sbt)?
- Why is immutable map size always zero?
- How to make fully functional immutable classes in Scala?
- Where to find tutorials for scaladoc 2?
- Sort and Remove performance in Scala
- Scala - How to convert a Dataset[Row] to a column that can be added to a Dataframe
- Transforming the inner elements of a stream of collections
- Global Variable in Scala
- Akka http trust all certs
- LinearRegressionWithSGD.train "error: type mismatch "
- Map a homogenous HList of one type into a hetergenous HList of different types
- Scala: Bad inferred type for Option composed with StateT monad transformer
- Exception after Setting property 'spark.sql.hive.metastore.jars' in 'spark-defaults.conf'
- Elasticsearch-Hadoop library cannot connect to to docker container
- Scala DBs? Relational algebra?
- Is it possible to make Spark UDF working with Array that could be None?
- module not found: com.eed3si9n#sbt-assembly;0.14.3
- Akka Distributed Pub/Sub and number of named topics
- Scala Play: How to dynamically set response view per language?
- Return type depending on parameter type (e.g. Await.ready()) does not work as expected
- scala - can't existentially abstract over parameterized type
- Scala-Not compiling for comprehension
- Managing flexible, typed, immutable data structures in Scala in 2.8.x
- Scala continuation type error
- Creating and Accessing Abstract Class Fields in Scala
- Extending instantiated objects by importing: Bad Idea?
- Wrong FS s3://ss-pprd-v2-dart//tempdir/962c6007-77c0-4294-b021-b9498e3d66ab/manifest.json -expected s3a://ss-pprd-v2-dart
- Reading Spring Boot ConfigurationProperties with Scala
- Finding implicit method definitions in macro context