Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ public static FileHolder findRootProjectHolder(ProcessingEnvironment processingE
} catch (IOException ignored) {
throw new FileNotFoundException();
}
String dummySourceFilePath = dummySourceFile.toUri().toString();

return createFileHolder(dummySourceFile.toUri().toString());
}

private static FileHolder createFileHolder(String dummySourceFilePath) throws FileNotFoundException {
if (dummySourceFilePath.startsWith("file:")) {
if (!dummySourceFilePath.startsWith("file://")) {
dummySourceFilePath = "file://" + dummySourceFilePath.substring("file:".length());
Expand Down Expand Up @@ -89,19 +92,10 @@ private static FileHolder findKaptRootProjectHolder(ProcessingEnvironment proces
return null;
}

File kaptFolder = new File(kaptFolderOption.replace("kaptKotlin", "kapt"));
File dummySourceFile = new File(kaptFolder, "dummy");
String dummySourceFile = kaptFolderOption.replace("kaptKotlin", "kapt") + File.separator + "dummy";
String dummySourceFilePath = new File(dummySourceFile).toURI().toString();

String dummySourceFilePath;
try {
dummySourceFilePath = new URI("file://" + dummySourceFile.getAbsolutePath()).toString();
} catch (URISyntaxException e) {
throw new FileNotFoundException();
}

File sourcesGenerationFolder = kaptFolder;
File projectRoot = kaptFolder.getParentFile();
return new FileHolder(dummySourceFilePath, sourcesGenerationFolder, projectRoot);
return createFileHolder(dummySourceFilePath);
}

public static File resolveOutputDirectory(ProcessingEnvironment processingEnv) throws FileNotFoundException {
Expand Down