Skip to content

Commit ad26b1d

Browse files
Apply default outputDir indexing logic to user-provided output dir
Signed-off-by: Valery Petrov <[email protected]>
1 parent 1a33e76 commit ad26b1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/gradle/profiler/CommandLineParser.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public InvocationSettings parseSettings(String[] args) throws IOException, Setti
4747
OptionSpecBuilder disableStudioSandbox = parser.accepts("no-studio-sandbox", "Marks that Android Studio should not use sandbox");
4848
ArgumentAcceptingOptionSpec<File> scenarioFileOption = parser.accepts("scenario-file", "Scenario definition file to use").withRequiredArg().ofType(File.class);
4949
ArgumentAcceptingOptionSpec<String> sysPropOption = parser.accepts("D", "Defines a system property").withRequiredArg();
50-
ArgumentAcceptingOptionSpec<File> outputDirOption = parser.accepts("output-dir", "Directory to write results to").withRequiredArg()
51-
.ofType(File.class).defaultsTo(findOutputDir("profile-out"));
50+
ArgumentAcceptingOptionSpec<String> outputDirPathOption = parser.accepts("output-dir", "Directory to write results to").withRequiredArg().defaultsTo("profile-out");
5251
ArgumentAcceptingOptionSpec<Integer> warmupsOption = parser.accepts("warmups", "Number of warm-up build to run for each scenario").withRequiredArg().ofType(Integer.class);
5352
ArgumentAcceptingOptionSpec<Integer> iterationsOption = parser.accepts("iterations", "Number of builds to run for each scenario").withRequiredArg().ofType(Integer.class);
5453
ArgumentAcceptingOptionSpec<String> profilerOption = parser.accepts("profile",
@@ -111,7 +110,8 @@ public InvocationSettings parseSettings(String[] args) throws IOException, Setti
111110
return fail(parser, "Neither --profile or --benchmark specified.");
112111
}
113112

114-
File outputDir = toAbsoluteFileOrNull(parsedOptions.valueOf(outputDirOption));
113+
String outputDirPath = parsedOptions.valueOf(outputDirPathOption);
114+
File outputDir = toAbsoluteFileOrNull(findOutputDir(outputDirPath));
115115
File gradleUserHome = toAbsoluteFileOrNull(parsedOptions.valueOf(gradleUserHomeOption));
116116
Integer warmups = parsedOptions.valueOf(warmupsOption);
117117
Integer iterations = parsedOptions.valueOf(iterationsOption);

0 commit comments

Comments
 (0)