Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7969359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:13:30+00:00 2026-06-04T07:13:30+00:00

I observed SBT compiles all source files everytime when I issue the compile task,

  • 0

I observed SBT compiles all source files everytime when I issue the “compile” task, regardless of time stamps since the last compile. The following is my build.sbt file:

name := "HelloSbt"

scalaVersion := "2.8.2"

unmanagedSourceDirectories in Compile := List(file("src"))

The following is my project structure (ignored project and target directories):

./src
./src/Hello1.scala
./src/a
./src/a/Hello2.scala
./build.sbt

The two source files are just empty object definitions for test purpose.

When I type in “sbt compile”, I got the following information:

[info] Compiling 2 Scala sources to...

and I can find newly compiled class files in target directory.

Without modifying any source file, after a minute, typing “sbt compile” again I got the same info and class files, except the time stamp of class files are up to date. I was expecting the second compile would not find any modified source file and no compilation should happen.

I did the test in both Windows 7 and Debian. During the test, I didn’t have any editor open. Can some one give some hint about how to setup a customized src directory while still be able to only compile modified files since last build?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:13:31+00:00Added an answer on June 4, 2026 at 7:13 am

    That’s because you are using a relative path as if it were an absolute path. I’m surprised it even produces a result, but, anyway, you should write it like this:

    unmanagedSourceDirectories in Compile <<= baseDirectory(base => List(base / "src"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do open large files with fopen under c with a kind-of observed folder
I observed the NSLog() does log all my messages with error level Warning but
I have observed following error logs in one of log files 2012-01-31 10:52:46,424 IST
I observed something last week that I did not expect, and will describe below.
NOTE: This question deals with an issue observed back in 2011 with an old
I observed that generally all good CMS, forums and portals are written in PHP
I have observed that, very infrequently, Internet Explorer (7 or 8, it does not
I've observed a difference in behavior between the new library in Visual Studio 11
What best practices should be observed when implementing HDL code? What are the commonalities
With a third party API I observed the following. Instead of using, public static

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.