Skip to content

SubPackages

drasil-bot edited this page Jun 13, 2024 · 7 revisions

Warning: Wiki should not be edited directly. Edit the files in the ./wiki/ folder instead and make a PR.

This wiki page consists of a breakdown of what changed after the split of Drasil into subpackages and acts as an FAQ section. Questions can be asked by creating issues and assigning them to @samm82.

Packages Overview

Drasil is compiled using many different sub-packages that have evolved constantly over the years. Thus, noting the packages in a list requires constant maintenance. Please visit the Drasil website for updated dependency graphs. This list has been updated as of July 9, 2021.

Package Description Dependencies on Sub-packages
drasil-build Outlines basic types and functions needed to generate Makefiles and compile generated code.
  • drasil-lang
drasil-code Holds the language for types, classes, and functions related to generating code.
  • drasil-build
  • drasil-code-base
  • drasil-database
  • drasil-gool
  • drasil-lang
  • drasil-printers
  • drasil-theory
  • drasil-utils
drasil-code-base Proxy package between drasil-printers and drasil-code, for the bits of code in drasil-printers that relies on bits of drasil-code (CodeExpr specifically).
  • drasil-database
  • drasil-lang
  • drasil-utils
drasil-data Fundamental knowledge that is shareable amongst many pieces of software. Includes common concepts in mathematics, physics, and computer science.
  • drasil-lang
  • drasil-metadata
  • drasil-theory
  • drasil-utils
drasil-database Database aspects of information collection. Contains the ChunkDB and SystemInformation types which are central to document generation.
  • drasil-lang
  • drasil-theory
drasil-docLang Drasil language related to generated document structure.
  • drasil-lang
  • drasil-data
  • drasil-database
  • drasil-printers
  • drasil-theory
  • drasil-utils
drasil-example Examples of Drasil use. Generates code, SRS documents, and Traceability Graphs.
  • drasil-code
  • drasil-code-base
  • drasil-data
  • drasil-database
  • drasil-docLang
  • drasil-gen
  • drasil-gool
  • drasil-lang
  • drasil-metadata
  • drasil-printers
  • drasil-theory
  • drasil-utils
drasil-gen For generating all artifacts.
  • drasil-lang
  • drasil-gool
  • drasil-build
  • drasil-code
  • drasil-printers
drasil-gool Renderer for generating code in object oriented languages.
  • drasil-utils
drasil-lang Representation language for Drasil, often with Chunks.
drasil-metadata Metadata used throughout Drasil. Currently just domains.
  • drasil-lang
drasil-printers Document renderer. Can print for .dot, .tex, .html, and .md files
  • drasil-code-base
  • drasil-database
  • drasil-lang
  • drasil-utils
drasil-theory General requirements knowledge for generating SRS with Definitions and Models
  • drasil-lang
  • drasil-metadata
drasil-utils Various utility functions.
  • drasil-lang
drasil-website Website generator for Drasil.
  • drasil-data
  • drasil-database
  • drasil-docLang
  • drasil-gen
  • drasil-lang
  • drasil-printers
  • drasil-theory
  • drasil-utils

Older Versions/Significant Changes

As of June 2019, Language.Drasil got split, mostly into drasil-lang and some into drasil-code. This means that anything not in drasil-lang that needs even just a part of it, must import Language.Drasil, and likewise for Language.Drasil.Code. The following splits were made for the smaller packages:

The package ... ... which is responsible for ... ... was split from this one.
drasil-lang representation language for two levels (basic information and chunks) (present in old structure)
drasil-code code generation drasil-lang
drasil-gen generation of all artifacts drasil-code
drasil-printers document generation drasil-lang
drasil-build building system languages and renderers drasil-printers
drasil-database database aspects of information collection drasil-lang
drasil-theory general requirements knowledge drasil-lang
drasil-data fundamental knowledge that is shareable amongst many pieces of software (present in old structure)
drasil-utils various utility functions drasil-lang and -data
drasil-example examples of Drasil use (present in old structure)
drasil-docLang document language routines drasil-example

drasil-lang involves a "submodule" (if you will) called Language.Drasil.Development. This includes some developer tools, and has the potential to be expanded upon/pulled into its own subpackage in the future. drasil-docLang also has a "submodule" called Drasil.SRS - this allows for the needed qualified imports and consists of only the one file.

Dependencies

Before, Drasil could be built all at once, starting with the "smallest" part and building up via imports. Now, specific packages need to be built before others. These dependencies are enforced in the following sub-changes. The following is a dependency tree of the subpackages, with arrows pointing towards what a package is dependent on.

dependency_tree

Cabal Files

As part of this reorganization, the one drasil.cabal file in code/ got split into multiple .cabal files, one for each package with the same name as the package itself, and moved into their corresponding directories. Each file has a list of dependencies, which includes the Drasil subpackages, following the above hierarchy. Thus, a change to drasil-lang might require the version number to be bumped up (both in drasil-lang.cabal's header and in its superpackages' dependency lists) in order for changes to be recompiled.

Makefile

The Makefile used to build the Drasil framework all at once, but again, that process has changed. It now builds them following the order of dependencies described above.

make clean has also been updated to (in addition to deleting build and logs) run stack clean in every directory required, which will help with some compilation issues.

FAQ

Q: My code is there but an example isn't building properly/ I'm getting an import error when everything should work/ The Travis CI build of main passes, but my local machine has errors.

A: First try running make clean, then running make again. This forces your machine to recompile, using the packages on your local branch.

Clone this wiki locally