Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More wip

  • Loading branch information...
commit 386d0147e555ddee47e8cd11fd529c420be2532c 1 parent 2f8862f
@skyluc skyluc authored
View
5 src/main/scala/org/scalaide/buildtools/EcosystemConfig.scala
@@ -11,7 +11,7 @@ object EcosystemConfig {
// regex for the config file
private val ConfigCategory = "category.([^=]*)=(.*)".r
- private val ConfigRepository = "baseRepository.([^=]*)=(.*)".r
+ private val ConfigRepository = "ecosystemBaseRepository.([^=]*)=(.*)".r
def apply(configFile: File): Either[String, EcosystemConfig] = {
for {
@@ -46,6 +46,7 @@ object EcosystemConfig {
case class EcosystemConfig(categories: Map[String, String], repositories: List[EcosystemRepository])
-case class EcosystemRepository(id: String, location: String) {
+case class EcosystemRepository(id: String, location: String, baseLocation: String) {
def getRepository() = Repositories(location)
+ def getBaseRepository() = Repositories(baseLocation)
}
View
22 src/main/scala/org/scalaide/buildtools/GenerateEcosystemBuilds.scala
@@ -77,13 +77,12 @@ class GenerateEcosystemBuilds(rootFolder: String) {
}
private def findScalaIDEsAndResolvedAvailableFeatures(repository: P2Repository, requestedFeatures: List[RequestedFeature], availableFeatures: List[FeatureDefinition]): Map[ScalaIDEDefinition, List[FeatureDefinition]] = {
- val allAvailableFeatures= mergeFeatureList(availableFeatures, findExistingFeatures(requestedFeatures, repository))
+ val allAvailableFeatures = mergeFeatureList(availableFeatures, findExistingFeatures(requestedFeatures, repository))
repository.findIU(ScalaIDEFeatureIdOsgi).map(ScalaIDEDefinition(_, repository))
-
+
repository.findIU(ScalaIDEFeatureIdOsgi).foldLeft(Map[ScalaIDEDefinition, List[FeatureDefinition]]())((m, ui) =>
- // TODO: might be a nice place to check versions
- m + (ScalaIDEDefinition(ui, repository) -> allAvailableFeatures.filter(f => ScalaIDEDefinition.matches(ui.version, f.sdtFeatureRange.range)))
- )
+ // TODO: might be a nice place to check versions
+ m + (ScalaIDEDefinition(ui, repository) -> allAvailableFeatures.filter(f => ScalaIDEDefinition.matches(ui.version, f.sdtFeatureRange.range))))
}
private def findFeatures(requestedFeatures: List[RequestedFeature]): Either[String, List[FeatureDefinition]] = {
@@ -91,7 +90,14 @@ class GenerateEcosystemBuilds(rootFolder: String) {
}
private def findFeatures(requestedFeature: RequestedFeature): Seq[FeatureDefinition] = {
- requestedFeature.repositories.flatMap(location => findFeatures(requestedFeature, Repositories(location).right.get))
+ requestedFeature.repositories.flatMap { location =>
+ Repositories(location) match {
+ case Right(p2repo) =>
+ findFeatures(requestedFeature, p2repo)
+ case Left(_) =>
+ Nil
+ }
+ }
}
private def findFeatures(feature: RequestedFeature, repository: P2Repository): Seq[FeatureDefinition] = {
@@ -99,7 +105,7 @@ class GenerateEcosystemBuilds(rootFolder: String) {
}
private def mergeFeatureList(base: List[FeatureDefinition], toMerge: List[FeatureDefinition]): List[FeatureDefinition] = {
-
+
def loop(toProcess: List[FeatureDefinition]): List[FeatureDefinition] = {
toProcess match {
case Nil =>
@@ -112,7 +118,7 @@ class GenerateEcosystemBuilds(rootFolder: String) {
}
}
}
- val res= loop(toMerge)
+ val res = loop(toMerge)
res
}
Please sign in to comment.
Something went wrong with that request. Please try again.