-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't require appmap.configFile
Only pass appmap.config.file to the agent if appmap.configFile is set in build.gradle. Otherwise, let the agent take care of it (e.g. by generating a default config if appmap.yml is missing).
- Loading branch information
1 parent
fa11246
commit eaa87c0
Showing
22 changed files
with
633 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.idea/ | ||
build | ||
.gradle | ||
/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
java temurin-11.0.20+8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/main/java/com/appland/appmap/gradle/ValidateConfigAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
package com.appland.appmap.gradle; | ||
|
||
import java.io.File; | ||
|
||
import org.gradle.api.Action; | ||
import org.gradle.api.GradleException; | ||
import org.gradle.api.Task; | ||
import org.gradle.api.file.RegularFile; | ||
import org.gradle.api.file.RegularFileProperty; | ||
import org.gradle.api.provider.Provider; | ||
|
||
/** | ||
* Action to validates the configuration for appmap exists and is readable. | ||
*/ | ||
public class ValidateConfigAction implements Action<Task> { | ||
|
||
private final Provider<File> configFile; | ||
private final Provider<RegularFile> configFile; | ||
|
||
public ValidateConfigAction(Provider<File> configFile) { | ||
this.configFile = configFile; | ||
public ValidateConfigAction(RegularFileProperty regularFileProperty) { | ||
this.configFile = regularFileProperty; | ||
} | ||
|
||
@Override | ||
public void execute(Task task) { | ||
if (!isConfigFileValid()) { | ||
throw new GradleException( | ||
"Config file " + configFile.get().getPath() + " not found or not readable." | ||
"Config file " + configFile.get().getAsFile().getPath() + " not found or not readable." | ||
); | ||
} | ||
} | ||
|
||
protected boolean isConfigFileValid() { | ||
return AppMapPluginExtension.isConfigFileValid(configFile.get()); | ||
return AppMapPluginExtension.isConfigFileValid(configFile.getOrNull()); | ||
} | ||
} |
Oops, something went wrong.