-
Notifications
You must be signed in to change notification settings - Fork 153
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
ISSUE-405: init commit with simple code gen #584
base: master
Are you sure you want to change the base?
Conversation
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.
Please:
- Create a new module, move the code there
- Split this file into multiple classes
- Write a couple of unit tests
- Would be great to generate a jar so users wouldn't need to compile this class
…ing new supported views
|
||
@Test | ||
fun checkCodeGen() { | ||
val jarFile = File("src/main/java/com/kaspresso/components/pageobjectcodegen/createKtfromDump.jar") |
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.
it will be better to move .jar file in separate folder (as adbserver does)
|
||
for (element in screenElements) { | ||
when (element.viewType) { | ||
"ImageView" -> importsList.add("import io.guthub.kakaocup.kakao.image.KImageView") |
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.
nit: would be better to move string literals into constants or even evaluate package dynamically KImageView::class.qualifiedName
|
||
object SupportedViews { | ||
val collectableElements = listOf("android.widget.Button", "android.widget.TextView", "android.widget.ImageView") | ||
val elementsWithChild = listOf("androidx.recyclerview.widget.RecyclerView") |
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.
Why only recycler view? Are there any problems with the scroll view, pager, horizontal scroll view etc.?
* output: | ||
* Kotlin file with screen code in the same directory as jar execute | ||
*/ | ||
fun main(vararg args: String) { |
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.
Please, write more documentation (comments, methods documentation or even wiki file like we have in the docs/ folder). Some areas of your code are hard to understand. It would be easier to maintain your code if you express the concept behind code generation
…opy it to artifacts
No description provided.