Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

The /project directory needs cleanup #108

Closed
@hlxid

Description

@hlxid

Description

As said in #96 (comment) the /project directory requires a cleanup. The directory currently consists of 14 files which is just too much for one directory. #103 lowers that to 13 by merging assembly.sbt and plugins.sbt into one file.

We should reduce the count of files in one directory to make the folder structure more clear e.g. by using packages. The problem with that is that we need to move the source files into the actual sbt sources root that is located at /project/src/main/scala.
Sbt has no problem with this and is working fine even with the use of packages, but the IntelliJ IDEA Scala plugin doesn't register that the sources root has moved to that directory and always thinks that it is at /project. This means that IntelliJ creates new files with the wrong package always starting with src.main.scala and always wants to auto-"correct" the packages in existing source files.
A solution to that problem might be to have a sbt project in some directory inside the repo root that is adding the sbt api to it's dependencies and to then import that project inside the /project/plugins.sbt file.

Also we currently have two methods that get all files inside a directory and all following sub-directories:

  1. private def getAllChilds(directory: File): Seq[File] = {
    directory.listFiles().filter(_.isFile) ++ directory.listFiles().filter(_.isDirectory).flatMap(getAllChilds)
    }
  2. private def recursiveFileListing(f: File): Set[File] = {
    if (f.isDirectory) {
    f.listFiles().flatMap(recursiveFileListing).toSet
    } else {
    Set(f)
    }
    }

We should either agree on one method and get rid of the other one or create a utils object with methods such these, because they are pretty generic and may be reused by other parts of our build code.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions