-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Renzu generating for Ant, Kobalt and Maven #894
Changes from 1 commit
89ba0b5
eeaa788
f8c54c2
dd03034
cd9874a
f6de23f
880754b
ff03971
76736fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,12 +169,17 @@ fun ClassOrPackageDataWrapper.typeConstraints(): String = | |
} | ||
} | ||
|
||
fun recurseFilesUpwards(fileName: String): File = | ||
recurseFilesUpwards(fileName, File(".").absoluteFile) | ||
fun recurseFilesUpwards(fileNames: Set<String>): File = | ||
recurseFilesUpwards(fileNames, File(".").absoluteFile) | ||
|
||
fun recurseFilesUpwards(fileName: String, currentDirectory: File): File = | ||
if (currentDirectory.list().contains(fileName)) { | ||
fun recurseFilesUpwards(fileNames: Set<String>, currentDirectory: File): File { | ||
|
||
val filesInDir = currentDirectory.list() | ||
|
||
//Am I being to smart? Basically we want to check if there is an element that is in both fileNames and filesInDir | ||
return if ((fileNames - filesInDir).isNotEmpty()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. insersect would be readable, and then you can remove the comment. |
||
currentDirectory | ||
} else { | ||
recurseFilesUpwards(fileName, currentDirectory.parentFile) | ||
recurseFilesUpwards(fileNames, currentDirectory.parentFile) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,10 +90,13 @@ class RenzuGenerator( | |
} | ||
|
||
fun generate() { | ||
|
||
val topLevelFiles = setOf("settings.gradle", "pom.xml", "build.xml", "Build.kt") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add settings.gradle.kt - build.gradle.kt can be in submodule. |
||
|
||
val generatedDir = if (isolateForTests) | ||
File("./infographic") | ||
else | ||
File("${recurseFilesUpwards("settings.gradle").absolutePath}/infographic") | ||
File("${recurseFilesUpwards(topLevelFiles).absolutePath}/infographic") | ||
.also { it.mkdirs() } | ||
|
||
val file = File(generatedDir, "arrow-infographic.txt") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tailrec? Looks like tailrec to me.