commercial-shared


License

License

GroupId

GroupId

com.gu
ArtifactId

ArtifactId

commercial-shared_2.12
Last Version

Last Version

6.1.6
Release Date

Release Date

Type

Type

jar
Description

Description

commercial-shared
commercial-shared
Project URL

Project URL

https://github.com/guardian/marley
Project Organization

Project Organization

com.gu
Source Code Management

Source Code Management

https://github.com/guardian/commercial-shared

Download commercial-shared_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.gu/commercial-shared_2.12/ -->
<dependency>
    <groupId>com.gu</groupId>
    <artifactId>commercial-shared_2.12</artifactId>
    <version>6.1.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.gu/commercial-shared_2.12/
implementation 'com.gu:commercial-shared_2.12:6.1.6'
// https://jarcasting.com/artifacts/com.gu/commercial-shared_2.12/
implementation ("com.gu:commercial-shared_2.12:6.1.6")
'com.gu:commercial-shared_2.12:jar:6.1.6'
<dependency org="com.gu" name="commercial-shared_2.12" rev="6.1.6">
  <artifact name="commercial-shared_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gu', module='commercial-shared_2.12', version='6.1.6')
)
libraryDependencies += "com.gu" % "commercial-shared_2.12" % "6.1.6"
[com.gu/commercial-shared_2.12 "6.1.6"]

Dependencies

compile (1)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.10

provided (1)

Group / Artifact Type Version
com.gu : content-api-models-scala_2.12 jar 15.4

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.8
com.typesafe.play : play-json_2.12 jar 2.7.4

Project Modules

There are no modules declared in this project.

Commercial shared library

This codebase holds the business logic for the display of commercial components, so that it can be shared across all Guardian platforms: web and app.

Assumptions

  1. It will be included in all frontend deployments that show commercial components
  2. It will be included in mapi deployments
  3. It won't make any calls to external services
  4. Its only dependencies are the capi model and the facia model

Usage

Add the library as dependency:
libraryDependencies += "com.gu" %% "commercial-shared" % "<x.y.z>"

Known usages

Examples

  1. Find branding for a given content item, section, tag or container:
    See branding tests.
  2. Build display ad targeting for a given content item, section or tag:
    See ad targeting tests.

How to ...

Start sbt session

Run bin/activator

Test locally in a downstream project

Run the sbt publishLocal task.
This will generate a local snapshot artefact.
Add the snapshot version as a dependency of the downstream project.

Release

For Guardian Devs performing a release: make sure you're set up to perform releases to Maven Central!

Then run the sbt release task.

Releases follow the semantic versioning policy, which is roughly:

  • A major.minor.patch format
  • Bump patch number for a bug fix or dependency bump etc.
  • Bump minor number for non-breaking new features
  • Bump major number for breaking changes
com.gu

The Guardian

The source code of the world's leading liberal voice

Versions

Version
6.1.6