https://kotlinlang.org logo
#dsl
Title
# dsl
a

aipok

03/19/2020, 9:04 PM
good anytime, could anyone suggest me how can I unit test logic in
buildSrc
folder?
g

gildor

03/22/2020, 11:26 PM
You probably need #gradle channel This channel about writing of DSL in general You can create
test
source set in buildSrc, the same as for any other Java/Kotlin Gradle project, it will be run automatically on buildSrc compilation https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#sec:build_sources
a

aipok

03/23/2020, 7:30 AM
That was the problem, that it does not run
automatically
. I solved that now using
./gradlew -p buildSrc test
command call from my CI
g

gildor

03/25/2020, 3:21 PM
It's strange, it's default behavior, are you sure that you configured it correctly? You can report to Gradle issue tracker if you have reproducible sample project
a

aipok

03/25/2020, 3:22 PM
I will, thanks for mention this.
g

gildor

03/25/2020, 3:23 PM
Also, keep in mind that test results for buildSrc are caches and test will not run if buildSrc or tests are not chamged
a

aipok

03/25/2020, 3:23 PM
yes. I know that
@gildor I assume it should build once I make a
buildSrc
clean, right? But it did not run tests after that. Also I tried to modify the source files as well, same no results in build folder, nor logs in console. Will try to reflect it in sample project, lets see.
4 Views