Open max8github opened 8 years ago
I'll have to look into this one. I never intended this to be used during testing, but it's a reasonable request.
Yes, that would be nice. I wish i could help right away, actually, but still have to learn a bit more on how to code sbt plugins and all.
(BTW, if i may ask: if you could share a tentative, rough and uncommitted time on when you could possibly get to it, please let me know: that will help me plan how to get over this problem in the short-medium term)
(To give context to this, if you are interested, this is about setting up unit tests with an in-memory database like h2 or hsqldb. In either case, when i create a Connection object in unit tests, the url cannot contain a relative file path: Connection requires it to be absolute. So, if i want to save the url string in application.conf
under source control, i must use ${baseDirectory}
in it)
With the latest version, this might work:
test in Test := ((test in Test) dependsOn (edit in EditSource)).value
After trying and re-trying , was not able to use this plugin to do token substitution before unit tests are run.
Maybe i am not using sbt well enough, but i was trying something as easy as:
to make tests do their work after token resolution, but it does not work. Maybe i am missing something obvious, but it would still be great if this were in the instructions, i think, which i could add myself if so desired.
Please note that when i run
sbt editsource:edit
it does work: files undertarget
are resolved.But when i run
sbt test
, my unit tests fail: if i look into thetarget
dir, the files that were correctly resolved byeditsource:edit
are now unresolved (they contain${baseDirectory}
strings inside them).