Skip to content

Commit

Permalink
pass args to grgit.open
Browse files Browse the repository at this point in the history
naming
  • Loading branch information
spacey-sooty committed Mar 28, 2024
1 parent 300bdd7 commit df1512a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CreateLogFileTask extends DefaultTask {
};
private File deployFile;
private String json;
private String gitDirectory;

@Inject
public CreateLogFileTask() {
Expand All @@ -42,7 +43,9 @@ public CreateLogFileTask() {
Grgit grgit;

try {
grgit = Grgit.open();
HashMap<String, Object> openargs = new HashMap<String, Object>();
openargs.put("dir", gitDirectory);
grgit = Grgit.open(openargs);

try {
data.put(DEPLOY_ITEMS[4], grgit.getResolve().toRevisionString("HEAD"));
Expand Down Expand Up @@ -91,6 +94,10 @@ public void setDeployFile(String path) {
deployFile = new File(path);
}

public void setGitDirectory(String dir) {
gitDirectory = dir;
}

@OutputFile
public File getDeployFile() {
return deployFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public FRCExtension(Project project, DeployExtension deployExtension) {
});

deployLogFile = project.getTasks().register("writeDeployFile", CreateLogFileTask.class, t -> {
t.setGitDirectory(project.getRootDir().toString());
t.setDeployFile(project.getLayout().getBuildDirectory().toString() + "debug/debug_info.json");
});

Expand Down

0 comments on commit df1512a

Please sign in to comment.