Skip to content

Conversation

@vlsi
Copy link
Collaborator

@vlsi vlsi commented Apr 27, 2023

I suggest upgrading Gradle and Koltin compiler versions and migrating to build-logic.
See https://github.com/apache/jmeter/tree/master/build-logic , https://docs.gradle.org/current/userguide/structuring_software_products.html


I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.

@vlsi
Copy link
Collaborator Author

vlsi commented Apr 27, 2023

@robstoll , WDYT?

I want this change so KSP generator can be included better into Atrium source code.

}
}

val jacocoAdditionalExtraName = "jacocoAdditional"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be replaced with a proper plugin, so it exposes a regular extension instead of relying on project.extra

Copy link
Owner

Choose a reason for hiding this comment

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

feel free to improve it 👍

@robstoll
Copy link
Owner

robstoll commented Apr 28, 2023

We cannot merge this into main currently because Kotlin 1.6 cannot guarantee language level 1.2

  • I want to release 1.0.0 with support for Kotlin 1.2
  • 1.1.0 will require at least 1.3 but why not directly jump to 1.4

On top of my head, Kotlin 1.6 should be able to guarantee language level 1.4

So either already create a 1.1.0 branch or wait a bit until I have released 1.0.0

@vlsi
Copy link
Collaborator Author

vlsi commented Apr 28, 2023

What are the projects that are stuck with language level 1.2 for test projects?

Is it really that important to support that?

@robstoll
Copy link
Owner

we currently have the support and I would like to release 1.0.0 sooner than later. As said, we drop the support with 1.1.0

@vlsi
Copy link
Collaborator Author

vlsi commented Apr 28, 2023

What is the 1.0.0 release date?
Frankly speaking, I would like to start working on KSP generator.
The KSP generator will be atrium-specific as it would use atrium annotations, and it will generate atirum-specific Expect<..>... extension properties.
That means the generator should be placed in atrium repository rather than something like https://github.com/vlsi/kotlin-argument-expression.

At the same time, the current Gradle project structure is not welcoming to add subprojects of different types, so I would like to migrate to build-logic before adding KSP and Gradle plugins to the repo.

@robstoll
Copy link
Owner

robstoll commented Apr 28, 2023

no worries, you can start right away, just create a corresponding branch, we will merge it into main once 1.0.0 is released. (I will release a RC-1 after the relocation PR is merged)

@robstoll
Copy link
Owner

@vlsi 1.0.0 is out, looking forward to a rebased version of this PR 🙂

@vlsi vlsi changed the title chore: bump Gradle to 8.1.1, Kotlin to 1.6.21 chore: bump Gradle to 8.1.1, Kotlin to 1.8.21 Jun 5, 2023
@robstoll
Copy link
Owner

robstoll commented Jun 5, 2023

@vlsi see other PR regarding update to gradle 8.1 I already fixed a few issues there which you will encounter here as well

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 5, 2023

The current error comes from check-dexer.gradle, and I don't understand what it is doing. It is doing cross-project configuration again which is, well, hard to reason.

I suggest reworking check-dexer into a build-logic plugin after this PR is merged.

@vlsi
Copy link
Collaborator Author

vlsi commented Jun 5, 2023

@robstoll , I think this is good enough.

It fails with the following error that is out of my control:

Build atrium FAILURE reason:                                
    Execution failed for task ':atrium-api-fluent:validateBeforePublish':
        java.lang.IllegalStateException: You need to define property with name gpgPassphrase or System.env variable with name GPG_PASSPHRASE for publishing (empty or blank is considered to be undefined)
            at ch.tutteli.gradle.plugins.publish.ValidationKt.throwIllegalStateException(Validation.kt:23)
            at ch.tutteli.gradle.plugins.publish.ValidateBeforePublishTask.getProjectExtraThrowIfNullOrBlank(ValidateBefo

@robstoll
Copy link
Owner

robstoll commented Jun 5, 2023

@vlsi sweet, thanks I'll take care of the rest 👍

@robstoll robstoll changed the base branch from main to gradle8 June 6, 2023 19:24
@robstoll robstoll merged commit 723e1e8 into robstoll:gradle8 Jun 6, 2023
Copy link
Owner

@robstoll robstoll left a comment

Choose a reason for hiding this comment

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

@vlsi I am currently rebasing these changes (almost done: https://github.com/robstoll/atrium/tree/build-logic) and I have a few questions in addition.

id("ch.tutteli.gradle.plugins.dokka")
}

fun AbstractDokkaTask.configurePlugins() {
Copy link
Owner

Choose a reason for hiding this comment

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

same as in /build.gradle.kts is there a way to mitigate duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, you suggested using ch.tutteli.gradle.plugins.dokka, and I used it. In that case, I expect you could factor the logic into that plugin.

Of course, you can create build-logic.dokka.gradle.kts and factor Dokka configuration there, however, at this point it is more like your preference, and a lack of my interest in reverse-engineering ch.tutteli.gradle.plugins.dokka

Copy link
Owner

Choose a reason for hiding this comment

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

good, I am not familiar with build-logic and thought there might be a reason why it cannot be move to an own convention-plugin. Thanks for the explanation 👍

@@ -0,0 +1,13 @@
plugins {
id("java-platform")
Copy link
Owner

Choose a reason for hiding this comment

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

do you know if this plugin is the cause that running ./gradlew build includes creating the javadoc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not think so. java-platform should be something that configures the project to serve as pom.xml (== type=pom, dependency-only project which can be used as a set of version constraints).

What do you mean by "creating javadocs"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I recently migrated some of Apache JMeter javadocs to Dokka-generated javadocs, and here's the pattern I arrived to: https://github.com/apache/jmeter/blob/88423edfb1a354a6170ca608d3fb074bb5b7f2ff/build-logic/jvm/src/main/kotlin/build-logic.dokka-javadoc.gradle.kts#L30-L47

It might help if you want "remove javadoc-generated javadocs" (see altering default javadoc classifier and removing it from JAVADOC_ELEMENTS_CONFIGURATION_NAME configuration artifacts).

Copy link
Owner

Choose a reason for hiding this comment

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

suddenly the build task depends on the javadoc task. I'll figure out why

id("java")
id("ch.tutteli.gradle.plugins.junitjacoco")
id("com.github.vlsi.crlf")
id("com.github.vlsi.gradle-extensions")
Copy link
Owner

Choose a reason for hiding this comment

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

@vlsi I like the improved error reporting in case a gradle build fails due to some misconfiguration or whatever. Yet, it is too verbose regarding tests for my taste. Is there a way to disable the report for the individual tests? This basically clutters the output too much, having ~4500 tests for atrium-api-fluent alone. The summary would be enough (in this case I could disable the one of tutteli-plugin as yours looks nicer 🙂)
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How about the following?

# com.github.vlsi.gradle-extensions prints only failing or slow test results
slowTestLogThreshold=1000
slowSuiteLogThreshold=2000

Copy link
Owner

Choose a reason for hiding this comment

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

I don't think the problem are slow tests, most prints mention 0.0sec
maybe the problem is that it prints a summary per suite as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The properties above are the thresholds, so if you increase them, it won't print tests that fit into the thresholds. The defaults are 0, 0 which might not be a best selection for projects that have many tests.

I think I would increase the default thresholds from 0, 0 to something less verbose.
The key idea there was to catch cases when a single test takes significant time.

Here's sample output in jqwik:

Copy link
Owner

Choose a reason for hiding this comment

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

Ah ok, I was so sure that the default threshold would be above 0 that I did not even try it out. Sorry about that, going to adjust it then. I see the idea behind the threshold and IMO it makes sense to have something like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants