Skip to content

Conversation

@EugeneTheDev
Copy link
Collaborator

@EugeneTheDev EugeneTheDev commented Sep 16, 2025

UPD

I've updated this PR to actually migrate examples to a separate simple-examples Gradle project in examples directory, that depends on the root Koog project via composite build. examples is not a module in Koog anymore, just a directory with example projects.

After some experiments, I decided not to migrate other example projects, such as Demo Compose App, to composite build approach, at least for now. I believe it's more beneficial to keep these logically uncoupled from the main project, with exact pinned version. Makes it easier to work on, and also doesn't make CI run Demo App checks on every PR.

Also, updated READMEs to reflect these changes.

Previous description, outdated

This is just a demo PR, not intended to be merged. It demonstrates how examples can be turned into Gradle composite builds, to make them more self-contained and separate them from the main Koog project, while still preserving the flexibility of depending directly on the Koog's source code at the same time.

To check it for yourself:

  1. Checkout the branch
  2. In the IntelliJ's Gradle tool window click on + (Link Gradle Project action) and select composite-build-demo directory No need to link simple-examples as additional Gradle Project, it will be linked as a composite build dependency in the root project automatically. When working on root Koog project, it is actually not recommended to link explicitly, IntelliJ then looses proper project context.
  3. Wait until it indexes it
  4. Run it, e.g. by cd'ing to the composite project's directy and calling ./gradlew :run or using Run anything action with the correct context
  5. Now you have additional Gradle project that you can run and that is linked to the main Koog project via the composite build feature. Try changing something in main the Koog sources (e.g. add new dummy function to PromptDSL). You will see and can use these changes in composite demo project immediately and when you rerun it, it automatically rebuilds main Koog project if needed as well. Navigation between demo project and main Koog project works seamlessly too.

Note: to make it work properly, we need to modify rootProject.name in root settings.gradle.kts - when producing artifacts, it conflicts with already existing meta-module koog-agents.

@EugeneTheDev EugeneTheDev changed the title [demo] Demo setup demonstrating how Gradle composite builds feature can be leveraged to make examples more self-sustained while still depending on the actual Koog sources [demo] Demo setup demonstrating how Gradle composite builds feature can be leveraged to make examples more self-sustained Sep 16, 2025
@github-actions
Copy link

github-actions bot commented Sep 16, 2025

Qodana for JVM

915 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 870
Missing KDoc for public API declaration 🔶 Warning 24
Vulnerable imported dependency 🔶 Warning 21
@@ Code coverage @@
+ 68% total lines covered
12138 lines analyzed, 8272 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@EugeneTheDev EugeneTheDev mentioned this pull request Sep 22, 2025
15 tasks
@EugeneTheDev EugeneTheDev changed the title [demo] Demo setup demonstrating how Gradle composite builds feature can be leveraged to make examples more self-sustained [examples] Migrate examples to composite builds Sep 22, 2025
@EugeneTheDev EugeneTheDev force-pushed the eugenethedev/examples-composite-build-demo branch from 3662801 to 2230f20 Compare September 22, 2025 18:28
@EugeneTheDev EugeneTheDev force-pushed the eugenethedev/examples-composite-build-demo branch from b71bc0d to 3c5b193 Compare September 23, 2025 00:22
@EugeneTheDev EugeneTheDev marked this pull request as ready for review September 23, 2025 07:44
@EugeneTheDev EugeneTheDev requested a review from Rizzen September 23, 2025 07:53
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @EugeneTheDev 🎉

@EugeneTheDev EugeneTheDev merged commit 992175f into develop Sep 23, 2025
15 checks passed
@EugeneTheDev EugeneTheDev deleted the eugenethedev/examples-composite-build-demo branch September 23, 2025 11:07
@kpavlov kpavlov added the build Build process and CI improvement 🏗️ label Sep 23, 2025
karloti pushed a commit to karloti/koog that referenced this pull request Sep 25, 2025
I've updated this PR to actually migrate `examples` to a separate
`simple-examples` Gradle project in `examples` directory, that depends
on the root Koog project via composite build. `examples` is not a module
in Koog anymore, just a directory with example projects.

After some experiments, I decided not to migrate other example projects,
such as Demo Compose App, to composite build approach, at least for now.
I believe it's more beneficial to keep these logically uncoupled from
the main project, with exact pinned version. Makes it easier to work on,
and also doesn't make CI run Demo App checks on every PR.

Also, updated READMEs to reflect these changes.
karloti pushed a commit to karloti/koog that referenced this pull request Oct 21, 2025
I've updated this PR to actually migrate `examples` to a separate
`simple-examples` Gradle project in `examples` directory, that depends
on the root Koog project via composite build. `examples` is not a module
in Koog anymore, just a directory with example projects.

After some experiments, I decided not to migrate other example projects,
such as Demo Compose App, to composite build approach, at least for now.
I believe it's more beneficial to keep these logically uncoupled from
the main project, with exact pinned version. Makes it easier to work on,
and also doesn't make CI run Demo App checks on every PR.

Also, updated READMEs to reflect these changes.
karloti pushed a commit to karloti/koog that referenced this pull request Oct 21, 2025
I've updated this PR to actually migrate `examples` to a separate
`simple-examples` Gradle project in `examples` directory, that depends
on the root Koog project via composite build. `examples` is not a module
in Koog anymore, just a directory with example projects.

After some experiments, I decided not to migrate other example projects,
such as Demo Compose App, to composite build approach, at least for now.
I believe it's more beneficial to keep these logically uncoupled from
the main project, with exact pinned version. Makes it easier to work on,
and also doesn't make CI run Demo App checks on every PR.

Also, updated READMEs to reflect these changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build process and CI improvement 🏗️

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants