Skip to content

Instantly share code, notes, and snippets.

@MasseGuillaume
Last active May 19, 2016 18:50
Show Gist options
  • Save MasseGuillaume/645f610e65f7ae848a945709b2c8245e to your computer and use it in GitHub Desktop.
Save MasseGuillaume/645f610e65f7ae848a945709b2c8245e to your computer and use it in GitHub Desktop.
metadata
import com.scalakata._
import ch.epfl.scala.index._
import data._
import bintray._
import cleanup._
import scala.util.Success
object A {
def keep(pom: maven.MavenModel, metas: List[BintraySearch]) = {
val packagingOfInterest = Set("aar", "jar")
val typesafeNonOSS = Set(
"for-subscribers-only",
"instrumented-reactive-platform",
"subscribers-early-access"
)
packagingOfInterest.contains(pom.packaging) &&
!metas.exists(meta => meta.owner == "typesafe" && typesafeNonOSS.contains(meta.repo))
}
val scmCleanup = new ScmCleanup
val poms = maven.Poms.get.collect{ case Success((pom, metas)) =>
(maven.PomConvert(pom), metas)
}.filter{ case (pom, metas) => keep(pom, metas)}
}
@instrument class Playground {
import A._
val nl = System.lineSeparator
poms.map(_._1).flatMap(p => scmCleanup(p).toList).sortBy{case GithubRepo(user, repo) =>
(user.toLowerCase, repo.toLowerCase)
}.distinct.map{
case GithubRepo(user, repo) => s""" "$user/$repo": []"""
}.mkString("{" + nl, "," + nl, nl + "}")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment