Skip to content

Commit

Permalink
working raaa
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
  • Loading branch information
spacey-sooty committed Dec 2, 2024
1 parent 91d1498 commit d2f02b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.logging.LogLevel;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.OutputFile;

import java.util.HashMap;

import javax.inject.Inject;

import java.io.IOException;
import java.net.InetAddress;
import java.io.File;
Expand All @@ -32,6 +37,11 @@ public class CreateLogFileTask extends DefaultTask {
private String json;
private String gitDirectory;

@Inject
public CreateLogFileTask(Project project) {
deployFile = project.getObjects().fileProperty();
}

@TaskAction
public void execute() throws IOException {
deployFile.getAsFile().get().getParentFile().mkdirs();
Expand Down Expand Up @@ -80,10 +90,6 @@ public void execute() throws IOException {
ResourceGroovyMethods.setText(deployFile.getAsFile().get(), json);
}

public void setDeployFile(String path) {
deployFile.fileValue(new File(path));
}

public void setGitDirectory(String dir) {
gitDirectory = dir;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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/deploy_info.json");
t.getDeployFile().set(project.getLayout().getBuildDirectory().file("debug/deploy_info.json"));
});

deployExtension.getDeployTask().configure(t -> {
Expand Down

0 comments on commit d2f02b6

Please sign in to comment.