Skip to content

Commit

Permalink
drop android support
Browse files Browse the repository at this point in the history
  • Loading branch information
azdrojowa123 committed Sep 20, 2023
1 parent 74f89b4 commit a2c91b4
Show file tree
Hide file tree
Showing 21 changed files with 7 additions and 9,402 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ object CreateTasks extends (State => State) with SbtStateOps {
StructureKeys.testConfigurations := UtilityTasks.testConfigurations.value,
StructureKeys.sourceConfigurations := UtilityTasks.sourceConfigurations.value,

StructureKeys.extractAndroid := extractors.extractAndroidSdkPlugin.value,
StructureKeys.extractPlay2 := Play2Extractor.taskDef.value,
StructureKeys.extractBuild := BuildExtractor.taskDef.value,
StructureKeys.extractDependencies := DependenciesExtractor.taskDef.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ object StructureKeys {
val acceptedProjects: TaskKey[Seq[ProjectRef]] = TaskKey("ssAcceptedProjects", rank = Invisible)

val extractPlay2: TaskKey[Option[Play2Data]] = TaskKey("ssExtractPlay2", rank = Invisible)
val extractAndroid: TaskKey[Option[AndroidData]] = TaskKey("ssExtractAndroid", rank = Invisible)
val extractBuild: TaskKey[BuildData] = TaskKey("ssExtractBuild", rank = Invisible)
val extractBuilds: TaskKey[Seq[BuildData]] = TaskKey("ssExtractBuilds", rank = Invisible)
val extractDependencies: TaskKey[DependencyData] = TaskKey("ssExtractDependencies", rank = Invisible)
val extractProject: TaskKey[Seq[ProjectData]] = TaskKey("ssExtractProject", rank = Invisible)
val extractProject: TaskKey[ProjectData] = TaskKey("ssExtractProject", rank = Invisible)
val extractProjects: TaskKey[Seq[ProjectData]] = TaskKey("ssExtractProjects", rank = Invisible)
val extractRepository: TaskKey[Option[RepositoryData]] = TaskKey("ssExtractRepository", rank = Invisible)
val extractStructure: TaskKey[StructureData] = TaskKey("extractStructure", rank = Invisible)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ class ProjectExtractor(
sourceConfigurations: Seq[sbt.Configuration],
testConfigurations: Seq[sbt.Configuration],
dependencies: DependencyData,
android: Option[AndroidData],
play2: Option[Play2Data],
settingData: Seq[SettingData],
taskData: Seq[TaskData],
commandData: Seq[CommandData]
) {

private[extractors] def extract: Seq[ProjectData] = {
private[extractors] def extract: ProjectData = {

val resolvers = allResolvers.collect {
case repo: MavenRepository => ResolverData(repo.name, repo.root)
Expand All @@ -58,7 +57,7 @@ class ProjectExtractor(
sourceConfigurations.flatMap(extractConfiguration(Compile.name)) ++
testConfigurations.flatMap(extractConfiguration(Test.name))
)
val projectData = ProjectData(
ProjectData(
projectRef.id,
projectRef.build,
name,
Expand All @@ -72,36 +71,13 @@ class ProjectExtractor(
extractJava,
extractScala,
compileOrder.toString,
android,
dependencies,
resolvers,
play2,
settingData,
taskData,
commandData
)

android match {
case None => Seq(projectData)
case Some(a) =>
val deps = a.aars.map(
aar =>
ProjectDependencyData(aar.name, None, Configuration.Compile :: Nil)
)
// add aar module dependencies
val updatedProject = projectData.copy(
dependencies = dependencies
.copy(projects = projectData.dependencies.projects ++ deps)
)
updatedProject +: a.aars.map(
_.project.copy(
java = projectData.java,
scala = projectData.scala,
resolvers = projectData.resolvers,
dependencies = projectData.dependencies
)
)
}
}

private def extractConfiguration(
Expand Down Expand Up @@ -274,7 +250,7 @@ object ProjectExtractor extends SbtStateOps with TaskOps {
state: State) =
key.in(projectRef, Compile).get(state)

def taskDef: Initialize[Task[Seq[ProjectData]]] = Def.taskDyn {
def taskDef: Initialize[Task[ProjectData]] = Def.taskDyn {

implicit val state: State = Keys.state.value
implicit val projectRef: ProjectRef = sbt.Keys.thisProjectRef.value
Expand Down Expand Up @@ -365,7 +341,6 @@ object ProjectExtractor extends SbtStateOps with TaskOps {
StructureKeys.sourceConfigurations.value,
StructureKeys.testConfigurations.value,
StructureKeys.extractDependencies.value,
StructureKeys.extractAndroid.value,
StructureKeys.extractPlay2.value,
StructureKeys.settingData.value,
StructureKeys.taskData.value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ object UtilityTasks extends SbtStateOps {
Def.task {
StructureKeys.extractProject
.forAllProjects(state, accepted)
.map(_.values.toSeq.flatten)
.map(_.values.toSeq)
.value
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jetbrains.sbt

import org.jetbrains.sbt.extractors.AndroidSdkPluginExtractor.{androidTask, _}
import org.jetbrains.sbt.structure.{AndroidData, StructureData}
import org.jetbrains.sbt.structure.StructureData
import sbt.{Def, Keys, Task}


Expand All @@ -19,14 +18,4 @@ package object extractors {
StructureKeys.localCachePath.value
)
}

val extractAndroidSdkPlugin: Def.Initialize[Task[Option[AndroidData]]] = Def.taskDyn {
val state = sbt.Keys.state.value
val projectRef = sbt.Keys.thisProjectRef.value
val androidTaskOpt = androidTask(state, projectRef)

Def.task {
androidTaskOpt.getOrElse(Option.empty[AndroidData].toTask).value
}
}
}
16 changes: 0 additions & 16 deletions extractor/src/test/data/0.13/android-1.4/build.sbt

This file was deleted.

3 changes: 0 additions & 3 deletions extractor/src/test/data/0.13/android-1.4/project/plugins.sbt

This file was deleted.

This file was deleted.

Loading

0 comments on commit a2c91b4

Please sign in to comment.