-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross build for SBT 1.0.0-RC3 #57
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2aba214
Cross build for SBT 1.0.0-M6
liff 562f197
Use official scalariform 0.2.0 release
liff 88ceb3f
Use scalariform 0.2.0 for all Scala versions
liff ecf5d8a
Update SBT cross-build to 1.0.0-RC2
liff aa0bc4a
Merge branch 'master' into topic/sbt-1.0
liff db39cb1
Remove explicit scalaVersion
liff 74775a1
Merge branch 'master' into topic/sbt-1.0
liff eefb438
Use SBT 1.0.0-RC3 and 0.13.16
liff 6eac7d9
Merge branch 'master' into topic/sbt-1.0
godenji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.13 | ||
sbt.version=0.13.16-M1 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.typesafe.sbt | ||
|
||
import java.io.File | ||
import sbt.{ Changed, FilesInfo } | ||
import sbinary.Format | ||
|
||
object SbtCompat { | ||
val Analysis = sbt.inc.Analysis | ||
type UpdateFunction = sbt.FileFunction.UpdateFunction | ||
|
||
object FileFunction { | ||
def cached(cacheBaseDirectory: File)(inStyle: FilesInfo.Style, outStyle: FilesInfo.Style)(action: UpdateFunction): Set[File] => Set[File] = | ||
sbt.FileFunction.cached(cacheBaseDirectory)(inStyle, outStyle)(action) | ||
} | ||
|
||
def changed[O: Equiv: Format](cacheFile: File): Changed[O] = new Changed[O](cacheFile) | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/PreferencesProtocol.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.typesafe.sbt | ||
|
||
import java.io.{ StringReader, StringWriter } | ||
import java.util.Properties | ||
import scalariform.formatter.preferences.{ PreferencesImporterExporter, IFormattingPreferences } | ||
import sjsonnew.{ Builder, JsonFormat, Unbuilder } | ||
|
||
object PreferencesProtocol { | ||
|
||
implicit object PrefFormat extends JsonFormat[IFormattingPreferences] { | ||
override def write[J](value: IFormattingPreferences, builder: Builder[J]): Unit = { | ||
val outStream = new StringWriter() | ||
PreferencesImporterExporter.asProperties(value).store(outStream, null) | ||
builder.writeString(outStream.toString) | ||
} | ||
|
||
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): IFormattingPreferences = { | ||
val properties = new Properties | ||
jsOpt match { | ||
case Some(js) => | ||
val str = unbuilder.readString(js) | ||
properties.load(new StringReader(str)) | ||
case None => | ||
} | ||
PreferencesImporterExporter.getPreferences(properties) | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/SbtCompat.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.typesafe.sbt | ||
|
||
import java.io.File | ||
import sbt.{ Changed, FileInfo } | ||
import sbt.util.{ CacheStore, CacheStoreFactory } | ||
import sjsonnew.JsonFormat | ||
|
||
object SbtCompat { | ||
val Analysis = sbt.internal.inc.Analysis | ||
type UpdateFunction = sbt.FileFunction.UpdateFunction | ||
|
||
object FileFunction { | ||
def cached(cacheBaseDirectory: File)(inStyle: FileInfo.Style, outStyle: FileInfo.Style)(action: UpdateFunction): Set[File] => Set[File] = | ||
sbt.FileFunction.cached(CacheStoreFactory(cacheBaseDirectory), inStyle, outStyle)(action) | ||
} | ||
|
||
def changed[O: Equiv: JsonFormat](store: File): Changed[O] = new Changed[O](CacheStore(store)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, the reason for mentioning cross publishing is that library dependencies can now simply be:
libraryDependencies += "org.scalariform" %% "scalariform" % "0.2.0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, seems I failed to properly parse your last comment, sorry. Update on its way.
I was trying to look for 0.2.0 for 2.10 on Maven Central but I suppose its indexing hasn't caught up yet or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, it's not yet up on maven central, but the dependency resolves (0.2.0 was published an hour or so ago)