Skip to content

Release/0.9.0 m1 #36

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

Merged
merged 5 commits into from
Nov 7, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#! /bin/bash -e
#
# Build, test, and release Scala Async.
#
# Requires credentials:
#
# % cat ~/.sbt/0.13/publish.sbt
# credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", "<user>", "<pass>")

function sbt211() {
sbt 'set scalaVersion := "2.11.0-M6"' 'set scalaBinaryVersion := scalaVersion.value' $@
return $?
}
die () {
echo "$@"
exit 1
}

CHECK=";clean;test;publishLocal"
RELEASE=";clean;test;publish"
VERSION=`gsed -rn 's/version :=.*"(.+).*"/\1/p' build.sbt`
[[ -n "$(git status --porcelain)" ]] && die "working directory is not clean!"

sbt211 $CHECK
sbt $CHECK
sbt $RELEASE
sbt211 $RELEASE

cat <<EOM
Released! For non-snapshot releases:
- tag: git tag -s -a v$VERSION -m "scala-async $VERSION"
- push tag: git push origin v$VERSION
- close the staging repository: https://oss.sonatype.org
- change the version number in build.sbt to a suitable -SNAPSHOT version
EOM
16 changes: 15 additions & 1 deletion src/main/scala/scala/async/internal/AnfTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,21 @@ private[async] trait AnfTransform {
}
}

val typedNewApply = copyApplied(tree, treeInfo.dissectApplied(tree).applyDepth)

/** The depth of the nested applies: e.g. Apply(Apply(Apply(_, _), _), _)
* has depth 3. Continues through type applications (without counting them.)
*/
def applyDepth: Int = {
def loop(tree: Tree): Int = tree match {
case Apply(fn, _) => 1 + loop(fn)
case TypeApply(fn, _) => loop(fn)
case AppliedTypeTree(fn, _) => loop(fn)
case _ => 0
}
loop(tree)
}

val typedNewApply = copyApplied(tree, applyDepth)

funStats ++ argStatss.flatten.flatten :+ typedNewApply

Expand Down
2 changes: 2 additions & 0 deletions src/test/scala/scala/async/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ package object async {
}

def scalaBinaryVersion: String = {
val PreReleasePattern = """.*-(M|RC).*""".r
val Pattern = """(\d+\.\d+)\..*""".r
scala.util.Properties.versionNumberString match {
case s @ PreReleasePattern(_) => s
case Pattern(v) => v
case _ => ""
}
Expand Down