Skip to content

Update distZip task to use the locally published artifacts via publishToMavenLocal #425

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

Merged
merged 13 commits into from
Jul 18, 2025

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Jul 17, 2025

Note: this branch merges into the Kotlin 2.1.21 bump branch since the kotlin bump doesn't work with the current/old publication anyway

💡 Motivation and Context

Instead of processing artifacts ourselves let's just use the locally published artifacts directly which makes it more robust for the future

💚 How did you test it?

CI test

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.

🔮 Next steps

@buenaflor buenaflor marked this pull request as ready for review July 17, 2025 20:31
@buenaflor buenaflor requested a review from romtsn as a code owner July 17, 2025 20:31
@buenaflor
Copy link
Contributor Author

@sentry review

}

tasks.named("distZip").configure {
this.dependsOn("publishToMavenLocal")
this.doLast {
System.setProperty("maven.repo.local", buildPublishDir)
Copy link
Member

@romtsn romtsn Jul 18, 2025

Choose a reason for hiding this comment

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

so this will tell the task where to publish to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, it then publishes into the specified dir

}
}
platforms.forEach { (distName, projectName) ->
val distribution = if (distName == "main") getByName("main") else maybeCreate(distName)
Copy link
Member

@romtsn romtsn Jul 18, 2025

Choose a reason for hiding this comment

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

not sure if we need an extension like getOrCreate something like that. Is it possible other sourcesets also exist and we should getByName in some cases?

Copy link
Contributor Author

@buenaflor buenaflor Jul 18, 2025

Choose a reason for hiding this comment

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

I think we can just use maybeCreate by default, it will look for it and if it doesnt exist it creates it which is basically a getOrCreate - updated it

it.replace("module.json", "$projectName$target-$version.module")
}
}
// Rename the POM since craft looks for pom-default.xml
Copy link
Member

Choose a reason for hiding this comment

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

ugh, I guess ideal-world we wouldn't need this, but would have to change craft again 🙈 maybe makes sense to align this between repos and change craft at some point

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

LGTM, looks like you're on a streak 🎉

@buenaflor buenaflor merged commit 0a7ac5a into deps/upgrade-kotlin Jul 18, 2025
5 checks passed
@buenaflor buenaflor deleted the chore/update-distribution-generation branch July 18, 2025 10:30
buenaflor added a commit that referenced this pull request Jul 18, 2025
* Update Kotlin and Compose version

* Missing newline

* Update

* Update deprecations

* Fix K2 compiler issue

* Formatting

* Fix test

* Update

* Update

* Formatting

* Formatting

* Fix Java 11 config

* Bump test lib versions

* Versions

* Java config

* Update

* Enable debug temporarily

* Revert

* Update

* Update

* Update

* Line end

* Formatting

* Add toolchain to java block

* Update CHANGELOG

* Update publication

* Update

* Update

* Update `distZip` task to use the locally published artifacts via `publishToMavenLocal` (#425)

* Update

* Update

* Update

* Let CI run for testing

* Update

* Update

* Update

* Update

* Update

* Clean up

* Update use maybeCreate always

* Update CHANGELOG.md
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