@@ -35,6 +35,8 @@ public abstract class ContributionTask extends DefaultTask {
35
35
@ Inject
36
36
protected abstract ExecOperations getExecOperations ();
37
37
38
+ private Path gradlew ;
39
+
38
40
private final ObjectMapper objectMapper = new ObjectMapper ().enable (SerializationFeature .INDENT_OUTPUT ).setSerializationInclusion (JsonInclude .Include .NON_NULL );
39
41
40
42
private Path testsDirectory ;
@@ -48,6 +50,7 @@ private record ContributingQuestion(String question, String help) {}
48
50
private void initializeWorkingDirectories (){
49
51
testsDirectory = Path .of (getProject ().file (CoordinateUtils .replace ("tests/src/$group$/$artifact$/$version$" , coordinates )).getAbsolutePath ());
50
52
metadataDirectory = Path .of (getProject ().file (CoordinateUtils .replace ("metadata/$group$/$artifact$/$version$" , coordinates )).getAbsolutePath ());
53
+ this .gradlew = Path .of (getProject ().file ("gradlew" ).getAbsolutePath ());
51
54
}
52
55
53
56
private void loadQuestions () throws IOException {
@@ -270,9 +273,9 @@ private List<Coordinates> getAdditionalDependencies() {
270
273
private void createStubs (boolean shouldUpdate ){
271
274
InteractiveTaskUtils .printUserInfo ("Generating stubs for: " + coordinates );
272
275
if (shouldUpdate ) {
273
- invokeCommand ("gradle scaffold --coordinates " + coordinates + " --update" , "Cannot generate stubs for: " + coordinates );
276
+ invokeCommand (gradlew + " scaffold --coordinates " + coordinates + " --update" , "Cannot generate stubs for: " + coordinates );
274
277
} else {
275
- invokeCommand ("gradle scaffold --coordinates " + coordinates , "Cannot generate stubs for: " + coordinates );
278
+ invokeCommand (gradlew + " scaffold --coordinates " + coordinates , "Cannot generate stubs for: " + coordinates );
276
279
}
277
280
}
278
281
@@ -431,10 +434,10 @@ private void addAgentConfigBlock() {
431
434
432
435
private void collectMetadata () {
433
436
InteractiveTaskUtils .printUserInfo ("Generating metadata" );
434
- invokeCommand ("gradle -Pagent test" , "Cannot generate metadata" , testsDirectory );
437
+ invokeCommand (gradlew + " -Pagent test" , "Cannot generate metadata" , testsDirectory );
435
438
436
439
InteractiveTaskUtils .printUserInfo ("Performing metadata copy" );
437
- invokeCommand ("gradle metadataCopy --task test --dir " + metadataDirectory , "Cannot perform metadata copy" , testsDirectory );
440
+ invokeCommand (gradlew + " metadataCopy --task test --dir " + metadataDirectory , "Cannot perform metadata copy" , testsDirectory );
438
441
}
439
442
440
443
private enum CONFIG_FILES {
0 commit comments