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

Add Jreleaser configuration and clean up build script #115

Merged
merged 5 commits into from
Jan 11, 2024

Conversation

hpmellema
Copy link
Contributor

@hpmellema hpmellema commented Jan 10, 2024

Description of changes:
Implements a number of changes to improve the release process for the plugins.

  1. Removes unnecessary source and javadoc jar tasks (the com.gradle.plugin-publish plugin already generates theses so they were redundant)
  2. Removes the maven-publish setup as the com.gradle.plugin-publish plugin already creates publications.
  3. Renames subprojects to match generated artifacts (otherwise plugin-publish will generate additional unused artifacts)
  4. Updates the build to use Jreleaser for actually publishing artifacts to align with the release process used by the primary smithy repo.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hpmellema hpmellema requested a review from a team as a code owner January 10, 2024 20:26
@hpmellema hpmellema requested a review from milesziemer January 10, 2024 20:26
@rschmitt
Copy link
Contributor

Does --configuration-cache work now?

@hpmellema
Copy link
Contributor Author

Configuration caching should be supported as of 0.8.0.
See: #56
A test case was also added here:

.withArguments("clean", "build", "--stacktrace", "--configuration-cache")

@rschmitt
Copy link
Contributor

I was asking about the build of smithy-gradle-plugin itself, more out of curiosity than anything. It looks like configuration caching doesn't work, even with your changes:

* What went wrong:
Configuration cache state could not be cached: field `isSupportingMultipleReports` of task `:spotbugsMain` of type `com.github.spotbugs.snom.SpotBugsTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultProvider'
> Could not resolve all files for configuration ':spotbugs'.
   > Cannot resolve external dependency com.github.spotbugs:spotbugs:4.7.3 because no repositories are defined.
     Required by:
         project :

Note, however, that this is not due to a configuration caching problem; it's because there's a dependency closure that for some reason isn't getting resolved:

[1] ~/src/smithy-gradle-plugin # g dependencies --configuration spotbugs

> Configure project :
JReleaser Gradle Plugin 1.9.0. Consider becoming a sponsor at https://opencollective.com/jreleaser
Smithy Gradle version: '0.9.0'
Kotlin DSL property assignment is an incubating feature.

> Task :dependencies

------------------------------------------------------------
Root project 'smithy-gradle'
------------------------------------------------------------

spotbugs - configuration for the SpotBugs engine
\--- com.github.spotbugs:spotbugs:4.7.3 FAILED

Maybe you could fix this by not applying the spotbugs plugin to the root project?

@rschmitt
Copy link
Contributor

I think the easiest way to fix CC is to define repositories in the root project:

     id("com.adarshr.test-logger") version "3.2.0"
     id("com.gradle.plugin-publish") version "1.2.1" apply false
     id("org.jreleaser") version "1.9.0"
 }

+repositories {
+    mavenLocal()
+    mavenCentral()
+}
+

The plan is to enable CC by default some time this year, so you might as well get it working now.

build.gradle.kts Outdated Show resolved Hide resolved
@hpmellema hpmellema merged commit 190e9c4 into smithy-lang:main Jan 11, 2024
4 checks passed
@hpmellema hpmellema deleted the jreleaser-setup branch January 11, 2024 16:45
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.

3 participants