Skip to content

Commit 8efed7f

Browse files
committed
Add reference to packager in tools
1 parent 3db7ec2 commit 8efed7f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

arduino-core/src/cc/arduino/contributions/packages/ContributedTool.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ public abstract class ContributedTool {
4242

4343
public abstract List<HostDependentDownloadableContribution> getSystems();
4444

45+
private ContributedPackage contributedPackage;
46+
47+
public ContributedPackage getPackage() {
48+
return contributedPackage;
49+
}
50+
51+
public void setPackage(ContributedPackage pack) {
52+
contributedPackage = pack;
53+
}
54+
55+
public String getPackager() {
56+
return contributedPackage.getName();
57+
}
58+
4559
public DownloadableContribution getDownloadableContribution(Platform platform) {
4660
for (HostDependentDownloadableContribution c : getSystems()) {
4761
if (c.isCompatible(platform))

arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public void parseIndex() throws Exception {
104104
.collect(Collectors.toList());
105105

106106
for (ContributedPackage pack : packages) {
107+
// Fill references to package in tools
108+
for (ContributedTool tool : pack.getTools()) {
109+
tool.setPackage(pack);
110+
}
111+
107112
for (ContributedPlatform platform : pack.getPlatforms()) {
108113
// Set a reference to parent packages
109114
platform.setParentPackage(pack);

0 commit comments

Comments
 (0)