Skip to content

Commit

Permalink
allow referencing endorsed plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
oehme committed Jul 27, 2015
1 parent 18de60a commit d22f9b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class IdeaComponentPlugin implements Plugin<Project> {
idea.pluginDependencies.externalDependencies.forEach [
assembleSandboxTask.rootSpec.addChild.into(id).from(idea.pluginsCache / id / version)
]
idea.pluginDependencies.endorsedDependencies.forEach [
assembleSandboxTask.rootSpec.addChild.into(id).from(idea.ideaHome / "plugins" / id)
]
val upstreamSandBoxTasks = idea.pluginDependencies.projectDependencies
.map[project.project(id)]
.map[(tasks.getAt(ASSEMBLE_SANDBOX_TASK_NAME) as AssembleSandbox)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class IdeaExtension {
val unpackedDependencies = pluginDependencies.externalDependencies.map[
pluginsCache / id / version
]
+
pluginDependencies.endorsedDependencies.map[
getIdeaHome / "plugins"/ id
]
val dependencyClasses = unpackedDependencies
.map[project.files(it / "classes")]
.reduce[FileCollection a, FileCollection b| a.plus(b)]
Expand Down Expand Up @@ -111,6 +115,7 @@ class IdeaPluginRepositories implements Iterable<IdeaPluginRepository> {
class IdeaPluginDependencies {

val dependencies = <IdeaPluginDependency>newTreeSet[$0.id.compareTo($1.id)]
val projectDependencies = <IdeaPluginDependency>newTreeSet[$0.id.compareTo($1.id)]

def IdeaPluginDependency id(String id) {
val dependency = new IdeaPluginDependency(id)
Expand All @@ -119,15 +124,21 @@ class IdeaPluginDependencies {
}

def project(String id) {
id(id)
val dependency = new IdeaPluginDependency(id)
projectDependencies += dependency
dependency
}

def getEndorsedDependencies() {
dependencies.filter[version == null]
}

def getExternalDependencies() {
dependencies.filter[version != null]
}

def getProjectDependencies() {
dependencies.filter[version == null]
projectDependencies
}
}

Expand Down

0 comments on commit d22f9b4

Please sign in to comment.