Skip to content

Commit

Permalink
Add package versions in STUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
minecrafter committed Apr 23, 2017
1 parent 4d7a266 commit b889480
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/io/playpen/core/utils/STUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import io.playpen.core.p3.P3Package;
import io.playpen.core.p3.PackageContext;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.misc.Aggregate;

import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

public class STUtils {
Expand All @@ -20,6 +22,14 @@ public static void buildSTProperties(P3Package p3, PackageContext ctx, ST templa
for(Map.Entry<String, String> entry : ctx.getProperties().entrySet()) {
template.add(entry.getKey(), entry.getValue());
}

Map<String, String> versions = new HashMap<>();
for (P3Package p3Package : ctx.getDependencyChain()) {
versions.put(p3Package.getId(), p3Package.getVersion());
}
versions.put(p3.getId(), p3.getVersion());

template.add("package_versions", versions);
}

private STUtils() {}
Expand Down

0 comments on commit b889480

Please sign in to comment.