This operation is a companion operation to the publish operation. It applies only to Soda Dependency Database repositories, and requires a Soda Build license.
With a Soda Build license, the cpa generation operation produces a H2 database, in addition to the .cpa file. The H2 database contains the following additional data:
-
function hash codes, and
-
the following C++ attributes:
-
deprecated
-
maybe unused
-
carries dependency
-
fall through
-
no return
-
warn unused return
-
This additional data permits richer querying of the SODA Dependency Database.
XXXX TO BE DOCUMENTED [Chris].
Example XML file to perform a publish-cpa-attributes operation:
<?xml version="1.0" encoding="UTF-8"?>
<headless version="1.0">
<operations>
<!-- POST-PUBLISH CPA SPECIFIC DATA from CPA DB - done here for better performance -->
<operation type="publish-cpa-attributes"/>
</operations>
<arguments>
<argument name="local-project" value="/Users/paulo/projects/cpa/headless-publish/structure101-model.cpa.hsp" >
<override attribute="datafile" value="/Users/paulo/structure101-git/qa-cpa-game-sim/build/structure101-model.cpa" />
</argument>
<!-- POINTS TO DB PROPS FILE, WHERE PROJECT AND LABEL ARE DB PROJECT AND SNAPSHOT -->
<argument name="repository" value="/Users/paulo/projects/databases/postgreql-s101-cpa.properties"/>
<argument name="project" value="headless-cpa-model"/>
<argument name="label" value="2.0.0"/>
<argument name="cpa-db-properties" value="/Users/paulo/structure101-git/qa-cpa-game-sim/build/cpa-attributes-db.properties"/>
</arguments>
</headless>
The XML configuration file passed to Soda Build references the CPA attributes file using the cpa-db-properties argument. The CPA attributes file requires the following properties:
-
auxdburl: the JDBC connection string to the project H2 database (.mv.db), e.g. jdbc:h2:/Users/me/my-cpa-project/structure101-model. The H2 database is always located in the same directory as your .cpa file, and will also have the same name you passed to the generate-asts-cpa/generate-cpa command using the -o argument (the default is structure101-mdeol).
-
auxdbuser=sa
-
auxdbpwd=
For example, the following sample cpa-attributes-db.properties file:
auxdburl=jdbc:h2:/Users/me/my-cpa-project/structure101-model
auxdbuser=sa
auxdbpwd=
The remaining arguments include:
| Argument | Required | Description |
|---|---|---|
| repository | yes |
The location of your Structure101 repository. One of:
|
| project | yes | The name of the project in the repository to which this snapshot will be published. If the project doesn't exist it will be created. |
| local-project | yes | See project-spec. |
| label | no | A label for the snapshot, typically a version number or build identifier. If not provided but the project exists then the last label published will be used. For a project not yet published if no label is provided then 1.0.0 is used. |
| date | no | A date for the snapshot. If specified, this must be unique within the repository project. The date format is locale-specific. |
| rpkey | no | Specifies the "remote publish key". Necessary if you are publishing using an URL to a remote filesystem repository that is password-protected. |
| overwrite | no |
If set to true, then any existing snapshot for the label is overwritten (saving disk space). When set to false a new snapshot is created in a folder named <label name>_n where n increments from 2. The web app always shows the last snapshot published for a label. Default is false. |