Skip to content
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

Update Gradle config #194

Merged
merged 19 commits into from
Jul 25, 2022
Merged

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Jul 23, 2022

Preparation for #192

  • This PR breaks up the Gradle config into smaller convention plugins. Each convention plugin can be applied to each subproject as required. This helps with organising build configuration, and only applying it as required. All of the config was copy&pasted from the root build.gradle.kts, so nothing should be different.

  • I enabled some Gradle caching options. This should speed up build speeds, and when developing locally (for example, when switching branches).

  • I adjusted some of the Gradle build config which seemed unusual to me. I changed them to be more conventional - which could be a mistake! I'll make notes of these so you can review them.

  • I changed the name of the Maven POMs to include the subproject name, prefixed by skrape{it}.

  • This PR includes the README updates README minor spelling/grammar fixes #193

  • I updated Gradle to 7.5

  • I merged the 3 .gitignores into one

WIP:

  • Confirm that the dependency update plugins still work as expected
  • Confirm that detect still works
  • Confirm Dokka still works
  • Double check I've copied the signing variables correctly

Okay, all done!

Changes of note:

  • I added a project-local Maven repo, so I can test that the Maven deployment still works and the signatures are generated as expected. Just run ./gradlew publishAllPublicationsToLocalProjectDirRepository
  • I added the Dokka docs to the Javadoc jar
  • I enabled Gradle caching (see gradle.properties). You might see some configuration cache warnings like
    265 problems were found storing the configuration cache, 75 of which seem unique.
    - Task `:assertions:dokkaJavadoc` of type `org.jetbrains.dokka.gradle.DokkaTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as    these are not supported with the configuration cache.
    
    but they're just warnings. If they're an issue, then set org.gradle.unsafe.configuration-cache=false. Note that the build cache is stable, that shouldn't cause issues.
  • I'm not able to verify that Nexus publishing still works, so please check!

@aSemy aSemy marked this pull request as draft July 23, 2022 17:06
buildSrc/build.gradle.kts Show resolved Hide resolved
@@ -0,0 +1,8 @@
package buildsrc.convention

plugins {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

prep for #192

integrationtests/build.gradle.kts Outdated Show resolved Hide resolved
settings.gradle.kts Show resolved Hide resolved
html-parser/build.gradle.kts Outdated Show resolved Hide resolved
Comment on lines +16 to +21
dependencies {
testImplementation(Deps.jUnit)
testImplementation(Deps.strikt)
testImplementation(Deps.Mockk.mockk)
testImplementation(Deps.Mockk.dslJvm)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a comment: normally I prefer keeping dependencies out of convention plugins. buildSrc doesn't play very nicely with the dependency management plugins and tools (like version catalogs), and it can make the subprojects config a bit more obfuscated. But this works fine, especially for common test dependencies, and because Deps.kt is well managed and organised.

@aSemy aSemy marked this pull request as ready for review July 24, 2022 11:15
Comment on lines +17 to +18
name.set("skrape{it}")
description.set("A Kotlin-based testing/scraping/parsing library providing the ability to analyze and extract data from HTML (server & client-side rendered). It places particular emphasis on ease of use and a high level of readability by providing an intuitive DSL. First and foremost it aims to be a testing lib, but it can also be used to scrape websites in a convenient fashion.")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

small notes:

Now the POM name includes the subproject name.

By default Gradle will use project.description for the POM description, so you might want to move this description to the root project, and make the subproject descriptions more specific

@aSemy aSemy mentioned this pull request Jul 24, 2022
5 tasks
@christian-draeger christian-draeger merged commit f2325c8 into skrapeit:master Jul 25, 2022
@christian-draeger
Copy link
Collaborator

christian-draeger commented Jul 25, 2022

Really really big thanks for the great work 🎉👌
This will help to evolve the library a lot 🙂

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