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

Implement publishing to Bintray #77

Merged
merged 1 commit into from
Feb 23, 2020
Merged

Implement publishing to Bintray #77

merged 1 commit into from
Feb 23, 2020

Conversation

tindzk
Copy link
Owner

@tindzk tindzk commented Feb 10, 2020

This introduces two user-facing features: the ability to publish and
document modules. The changes resulted in the stabilisation of the
artefact resolution and progress bar logic. Furthermore, the
import keyword is now available in the global Seed configuration
file.

With the new CLI command publish, modules can be published to a
repository. It builds, packages and uploads the specified modules.
At the moment, only Maven-style Bintray repositories are supported.
For each supplied module, JAR artefacts along with a POM file are
created. These artefacts contain the compiled classes, source files
and documentation. Publishing of sources and documentation is
optional and can be disabled. Progress bars are shown when
publishing modules. Unless specified, Seed will attempt to read the
version from the project's Git repository. Internally, the feature
uses the Apache HTTP client, wrapped as a ZIO task, and sends
requests to the Bintray REST API.

The newly-introduced CLI command doc runs Scaladoc on the supplied
modules and generates an HTML documentation for them. Seed runs the
Scala compiler directly, bypassing Bloop. This results in an
additional compilation pass. Compiler bridges are provided for Scala
2.11, 2.12 and 2.13. However, the actual resolution of the
scala-compiler artefact occurs during runtime. Therefore,
documentation generation is compatible with alternative compilers
such as Typelevel Scala.

The aforementioned features required changes to the artefact
resolution. Previously, all dependencies were resolved at once.
However, modular projects are likely to contain libraries with
diverging versions. A resolution pass in Coursier merges these
duplicate libraries, only retaining the latest version. This may
lead to unexpected compile- and runtime behaviour. The new
resolution logic solves this limitation by performing a separate
resolution pass for each module. Test modules are resolved
separately too. As a consequence of these changes, the resolution is
slightly slower, but still acceptable on larger projects.

A further change is that the standard library's organisation and
version are forcibly set during dependency resolution by using
Coursier's ResolutionParams feature. This avoids having to patch
artefacts later on, e.g. during generation.

The progress bar logic was refactored and several bugs were fixed.
Notably, as build targets may run asynchronously, they can produce
output while the project is still compiling. In this case, the
progress bar output would get corrupted. The graphical glitch was
resolved by using the console output's logger in
seed.cli.BuildTarget.buildTargets().

Finally, the import keyword, previously only available in build
files, can now be used within the global Seed configuration. Since
Bintray repository credentials are part of this file, users may want
to move the credentials to a custom file and import it instead.

This introduces two user-facing features: the ability to publish and
document modules. The changes resulted in the stabilisation of the
artefact resolution and progress bar logic. Furthermore, the
`import` keyword is now available in the global Seed configuration
file.

With the new CLI command `publish`, modules can be published to a
repository. It builds, packages and uploads the specified modules.
At the moment, only Maven-style Bintray repositories are supported.
For each supplied module, JAR artefacts along with a POM file are
created. These artefacts contain the compiled classes, source files
and documentation. Publishing of sources and documentation is
optional and can be disabled. Progress bars are shown when
publishing modules. Unless specified, Seed will attempt to read the
version from the project's Git repository. Internally, the feature
uses the Apache HTTP client, wrapped as a ZIO task, and sends
requests to the [Bintray REST API](https://bintray.com/docs/api/).

The newly-introduced CLI command `doc` runs Scaladoc on the supplied
modules and generates an HTML documentation for them. Seed runs the
Scala compiler directly, bypassing Bloop. This results in an
additional compilation pass. Compiler bridges are provided for Scala
2.11, 2.12 and 2.13. However, the actual resolution of the
`scala-compiler` artefact occurs during runtime. Therefore,
documentation generation is compatible with alternative compilers
such as Typelevel Scala.

The aforementioned features required changes to the artefact
resolution. Previously, all dependencies were resolved at once.
However, modular projects are likely to contain libraries with
diverging versions. A resolution pass in Coursier merges these
duplicate libraries, only retaining the latest version. This may
lead to unexpected compile- and runtime behaviour. The new
resolution logic solves this limitation by performing a separate
resolution pass for each module. Test modules are resolved
separately too. As a consequence of these changes, the resolution is
slightly slower, but still acceptable on larger projects.

A further change is that the standard library's organisation and
version are forcibly set during dependency resolution by using
Coursier's `ResolutionParams` feature. This avoids having to patch
artefacts later on, e.g. during generation.

The progress bar logic was refactored and several bugs were fixed.
Notably, as build targets may run asynchronously, they can produce
output while the project is still compiling. In this case, the
progress bar output would get corrupted. The graphical glitch was
resolved by using the console output's logger in
`seed.cli.BuildTarget.buildTargets()`.

Finally, the `import` keyword, previously only available in build
files, can now be used within the global Seed configuration. Since
Bintray repository credentials are part of this file, users may want
to move the credentials to a custom file and import it instead.
@tindzk tindzk merged commit ee2e274 into master Feb 23, 2020
@tindzk tindzk deleted the feat/publishing branch February 23, 2020 19:01
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.

1 participant