0

I would like to test and run the "difr" utility as described here : https://github.com/wspringer/difr

But, I am getting the error below. Could you please advise on how to overcome this issue ?

[info] Done updating.
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
[warn] Ignoring load failure: no project loaded.
[error] Expected ID character
[error] Not a valid command: build
[error] build.sbt
[error]      ^
[nskalis@app difr-master]$ sbt build.sbt 
[info] Loading project definition from /home/nskalis/app/difr-master/project
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? r
[info] Loading project definition from /home/nskalis/app/difr-master/project
/home/nskalis/app/difr-master/build.sbt:14: error: not found: value defaultExcludes
defaultExcludes in Compile in unmanagedResources := "*.scaml"
^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? l
[info] Loading project definition from /home/nskalis/app/difr-master/project
[debug] 
[debug] Initial source changes: 
[debug]     removed:Set()
[debug]     added: Set()
[debug]     modified: Set()
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug] 
[debug] Sources indirectly invalidated by:
[debug]     product: Set()
[debug]     binary dep: Set()
[debug]     external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings: 
[debug]     
[debug] [Loading] Scanning directory /home/nskalis/app/difr-master
[error] Type error in expression
[debug] > load-failed
[debug] > last
nskalis
  • 2,232
  • 8
  • 30
  • 49

1 Answers1

1

What you are doing is not running difr, but building difr. I'm not sure whether that's what you want or not -- if not, follow the instructions there, which have absolutely nothing to do with cloning the repo and building.

Now, the problem you are having building is that the project is somewhat old, in the sense that it hasn't been updated in a while. If you are using a recent SBT version, it won't work. The project should have used properties to indicate what SBT version works with it, but it doesn't.

Fortunately, it is easy to do that yourself. Just do this:

echo 'sbt.version=0.12.4' >project/build.properties

As long as you are using an SBT version newer than that, it will download the older SBT and run that accordingly.

Oh, be sure to use Java 1.7 -- Java 1.8 won't work with it.

Once you have all that in place -- the build.properties file and Java 1.7 -- and have performed the changes you want, run this command:

sbt assembly

That will generate a file called target/scala-2.9.2/difr.jar, including your changes, which you can then use as described in the github page of difr.

Daniel C. Sobral
  • 295,120
  • 86
  • 501
  • 681
  • thanks Daniel. that took us a step further. now it complains about – nskalis Jan 27 '15 at 10:30
  • [info] Set current project to difr (in build file:/home/nskalis/app/difr-master/) [error] Not a valid key: build (similar: loaded-build) [error] build.sbt [error] ^ – nskalis Jan 27 '15 at 10:31
  • @NikosSkalis In the middle of that paste in your question, you do `sbt build.sbt`. You dont' pass the configuration file to sbt, you just run `sbt`, and go on from there -- there's a `help` command on sbt console if you need. – Daniel C. Sobral Jan 27 '15 at 16:57
  • in other words ./src/main/resources/diff.scaml should be passed to sbt. using the -h for sbt does not provide any option to specify the configuration .scaml file. so i guess this should be somewhere referenced (?) please advise. – nskalis Jan 28 '15 at 10:22
  • @NikosSkalis Again, if you want to run difr, follow the instructions on its github page. – Daniel C. Sobral Jan 28 '15 at 13:27
  • i would like to customize the .html produced. with a .jar file this is not possible. – nskalis Jan 28 '15 at 13:40
  • sbt community says that this tag would help getting answers, as this is their official way of getting support. – nskalis Jan 28 '15 at 13:42
  • @NikosSkalis Didn't you change `./src/main/resources/diff.scaml`? – Daniel C. Sobral Jan 29 '15 at 19:25
  • no. not any changes have been applied to the original source code. – nskalis Jan 30 '15 at 11:53
  • @NikosSkalis Then how do you expect to customize the html produced? And why wouldn't a jar file be enough? – Daniel C. Sobral Jan 31 '15 at 07:39