-
Notifications
You must be signed in to change notification settings - Fork 1
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: VSS Specification Generation fails for specific Folder Structure #67
Conversation
Unfortunately I had to fallback to the minimum viable solution. I debugged into the ksp generation and at a few different places the "projectPath" is visible. However, none of them are freely accessable.
We could solve it by using reflections to access these properties, but I don't think we should do that. |
|
||
private val fileSeparator = File.separator | ||
private val assetsDir = "intermediates" + fileSeparator + "assets" + fileSeparator | ||
private val buildDir = fileSeparator + "build" + fileSeparator |
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.
Since we are now using "replaceAfterLast" we just moved the problem. The solution might still fail when the folder structure looks like:
$projectDir/build/.../build/.../file.kt
This might happen when somebody introduces a buildType named "build" without any other flavors -> "/home/vagrant/build/org.eclipse.kuksa.companion/app/build/generated/ksp/fDroid/kotlin/org/eclipse/kuksa/vss/MainActivityProcessor.kt
I added the starting fileSeparator to be a bit more robust and reduce the number of fase-positives in case some other string is appended
private const val ASSETS_BUILD_DIRECTORY = "intermediates/assets/" | ||
private const val BUILD_FOLDER_NAME = "build/" | ||
|
||
private val fileSeparator = File.separator |
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.
Due to how we resolve the buildFolder the approach was not working on windows before due to the difference in fileSeparators ("/" vs "\"). I changed it, however did not test it. So we should probably test if VssSpec generation also works on Windows devices!
FIrst I thought this would only be an issue for windows runners, but in fact it's an issue for each and every windows user of our lib - so we need to test and fix this ;)
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.
Works for me on Linux.
What I did:
- move
kuksa-android-sdk
underhome/user/build/
./gradlew clean assemble
- ran unit test config -> succeeded
- ran app -> set/get possible
Closes: #66