GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix build directory for classes from Kotlin files by volivan239 · Pull Request #1019 · UnitTestBot/UTBotJava

Conversation

@volivan239

@volivan239 volivan239 commented Sep 27, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Description

Changed the method used to compile classes so that now Kotlin files are compiled to build/classes/kotlin and Java files are compiled to build/classes/java (previously the latter directory was used for both). This avoids duplication with classes generated by default IDEA actions.

Also, refactored some methods to support multiple build directories (important when there are both Java and Kotlin files in project).

Fixes #950

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Refactoring (typos and non-functional changes)

How Has This Been Tested?

Manual Scenario

Launched plugin on scenario from #950 and several other scenarios with Kotlin files in projects -- everything works normal.

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@volivan239
volivan239 requested a review from sergeypospelov September 27, 2022 15:52
@volivan239
volivan239 force-pushed the volivan239/fix_kotlin_compile_dir branch from 7ba3710 to 68442fb Compare September 27, 2022 16:25
@volivan239
volivan239 requested a review from Vassiliy-Kudryashov September 27, 2022 16:27
@volivan239
volivan239 force-pushed the volivan239/fix_kotlin_compile_dir branch from 68442fb to 2e0427a Compare September 27, 2022 16:42
@volivan239
volivan239 marked this pull request as ready for review September 27, 2022 21:45
sergeypospelov
sergeypospelov requested changes Sep 28, 2022
View reviewed changes

@sergeypospelov sergeypospelov left a comment

Copy link
Copy Markdown
Member

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.

LGTM, just some minor issues.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread utbot-framework/src/main/kotlin/org/utbot/framework/plugin/api/TestCaseGenerator.kt Outdated
checkFrameworkDependencies(dependencyPaths)

logger.trace("Initializing ${this.javaClass.name} with buildDir = $buildDir, classpath = $classpath")
logger.trace("Initializing ${this.javaClass.name} with buildDir = $buildDirs, classpath = $classpath")

@sergeypospelov sergeypospelov Sep 28, 2022

Copy link
Copy Markdown
Member

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.

Suggested change
logger.trace("Initializing ${this.javaClass.name} with buildDir = $buildDirs, classpath = $classpath")
logger.trace("Initializing ${this.javaClass.name} with buildDirs = ${buildDirs.joinToString(File.pathSeparator)}, classpath = $classpath")

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@volivan239 volivan239 Sep 28, 2022

Copy link
Copy Markdown
Collaborator Author

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.

fixed as suggested

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread utbot-framework/src/main/kotlin/org/utbot/framework/util/SootUtils.kt Outdated
)
set_src_prec(Options.src_prec_only_class)
set_process_dir(listOf("$buildDir"))
set_process_dir(buildDirs.map { "$it" })

@sergeypospelov sergeypospelov Sep 28, 2022

Copy link
Copy Markdown
Member

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.

Suggested change
set_process_dir(buildDirs.map { "$it" })
set_process_dir(buildDirs.map { it.toString() })

it avoids creating unnecessary StringBuilder.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@volivan239 volivan239 Sep 28, 2022

Copy link
Copy Markdown
Collaborator Author

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.

fixed as suggested

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread utbot-framework/src/main/kotlin/org/utbot/framework/util/SootUtils.kt Outdated
import org.utbot.engine.overrides.collections.AssociativeArray
import org.utbot.engine.overrides.collections.Collection
import org.utbot.engine.overrides.collections.List
import org.utbot.engine.overrides.collections.List as UtList

@sergeypospelov sergeypospelov Sep 28, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

This may be confusing, because we already have UtList. Maybe use fqn like org.utbot.engine.overrides.collections.List?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@volivan239 volivan239 Sep 28, 2022

Copy link
Copy Markdown
Collaborator Author

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.

replaced all overrides with FQN

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@volivan239
volivan239 force-pushed the volivan239/fix_kotlin_compile_dir branch from 2e0427a to afd95ca Compare September 28, 2022 13:02
@volivan239
volivan239 requested a review from sergeypospelov September 28, 2022 13:52
Vassiliy-Kudryashov
Vassiliy-Kudryashov approved these changes Sep 30, 2022
View reviewed changes
volivan239 added 2 commits September 30, 2022 12:24
@volivan239
Fix build directory for classes from Kotlin files
5401bd3
@volivan239
Fix review comments relative to soot
3d7829e
@volivan239
volivan239 force-pushed the volivan239/fix_kotlin_compile_dir branch from afd95ca to 3d7829e Compare September 30, 2022 09:51
@volivan239
volivan239 enabled auto-merge (squash) September 30, 2022 09:51
sergeypospelov
sergeypospelov approved these changes Sep 30, 2022
View reviewed changes
@volivan239
volivan239 merged commit edf6c5a into main Sep 30, 2022
@volivan239
volivan239 deleted the volivan239/fix_kotlin_compile_dir branch September 30, 2022 10:33
viktoriia-fomina pushed a commit that referenced this pull request Sep 30, 2022
@volivan239 @viktoriia-fomina
Fix build directory for classes from Kotlin files (#1019)
ea046d0
@volivan239 volivan239 mentioned this pull request Oct 5, 2022
Cancel test generation if compilation was not successful #1100 #1103
Merged
5 of 7 tasks
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
@volivan239 @AbdullinAM
Fix build directory for classes from Kotlin files (UnitTestBot#1019)
b13c803
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
@volivan239 @AbdullinAM
Fix build directory for classes from Kotlin files (UnitTestBot#1019)
f96c118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Vassiliy-Kudryashov Vassiliy-Kudryashov Vassiliy-Kudryashov approved these changes
@sergeypospelov sergeypospelov sergeypospelov approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

"Entry <...> is a duplicate" error after launching test generated for Kotlin

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@volivan239 @Vassiliy-Kudryashov @sergeypospelov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.