Last active
May 19, 2016 18:50
-
-
Save MasseGuillaume/645f610e65f7ae848a945709b2c8245e to your computer and use it in GitHub Desktop.
metadata
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
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