{"id":18974477,"url":"https://github.com/m7a/co-build","last_synced_at":"2026-01-27T03:36:02.838Z","repository":{"id":164554611,"uuid":"217774630","full_name":"m7a/co-build","owner":"m7a","description":"Ma_Sys.ma ANT Template to compile programs and build packages.","archived":false,"fork":false,"pushed_at":"2025-02-17T18:17:30.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T19:27:59.157Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m7a.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-26T22:03:42.000Z","updated_at":"2025-02-17T18:17:33.000Z","dependencies_parsed_at":"2024-05-01T12:37:38.582Z","dependency_job_id":"1c575232-0caa-49e2-96c3-c317418ee80b","html_url":"https://github.com/m7a/co-build","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Fco-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Fco-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Fco-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7a%2Fco-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7a","download_url":"https://codeload.github.com/m7a/co-build/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239972028,"owners_count":19727289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T15:15:13.376Z","updated_at":"2026-01-27T03:35:57.818Z","avatar_url":"https://github.com/m7a.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"---\nsection: 32\nx-masysma-name: masysmaci/build\ntitle: Ma_Sys.ma Build -- Ant Build Template\ndate: 2019/12/06 13:16:32\nlang: en-US\nauthor: [\"Linux-Fan, Ma_Sys.ma (Ma_Sys.ma@web.de)\"]\nkeywords: [\"ant\", \"mdpc2\", \"make\", \"build\", \"masysmaci\", \"template\", \"ant_build_template\", \"ant-build-template.xml\", \"ci\"]\nx-masysma-version: 1.0.1\nx-masysma-repository: https://www.github.com/m7a/co-build\nx-masysma-website: https://masysma.net/32/masysmaci_build.xhtml\nx-masysma-owned: 1\nx-masysma-copyright: |\n  Copyright (c) 2019, 2020, 2022 Ma_Sys.ma.\n  For further info send an e-mail to Ma_Sys.ma@web.de.\n---\nOverview\n========\n\nThe _Ma_Sys.ma Build_ is an attempt to provide a single unifying `build.xml` for\nthe Ant build system which allows compiling most Ma_Sys.ma programs with only\nminor modifications and which provides extended functionality to generate Debian\npackages. This replaces large parts of the formerly used MDPC scripts and the\npreviously used Makefile templates.\n\nIn addition to being a template, this is designed to facilitate _code reuse_ by\nnot being copied upon use, but rather _imported_. E.g. this XML can be loaded\ndirectly from its repository or alternatively from the file system. See section\n_Using the Template_ for details.\n\nThe template is designed to allow building programs in the following programming\nlanguages:\n\n * Ada\n * C\n * Java\n\nAdditionally, it can compile _LaTeX_ source code to PDF and act as a top-level\ntemplate for recursive invocation.\n\nHow to compile Projects using this Template\n===========================================\n\nSimilar to Makefiles, `ant` provides a set of targets.\nThe following targets/functionalities are generally available.\n\n`build`\n:   This target compiles the project.\n`jar`\n:   If it is a Java project, `jar` builds a jarfile if possible.\n`clean`\n:   Deletes object files i.e. everything generated except for the linked build\n    result.\n`dist-clean`\n:   Deletes all generated files including the linked build result.\n\nIf a project is intended to be built in form of a Debian package, this\nadditional target can be invoked:\n\n`package`\n:   Build a Debian package for this project.\n\nFor development purposes, the following targets allow managing the state of\na package:\n\n`init`\n:   Initializes a changelog.\n`incver`\n:   Interactively invoke the VIM editor to add a changelog entry\n    (for an incremented version).\n`autopackage`\n:   Calls `package` target if the package has been updated compared to the\n    repository contents. Installs necessary build dependencies if absent.\n\nUsing the Template\n==================\n\nTwo ways of including this template are recommended.\n\nThe include is a little obscure because it implements a routine for searching\nthe template's XML file and retrieving it from a local filesystem if possible.\nThe logic tries two distinct approaches:\n\n 1. _Attempt to load from a local file_. This searches for a copy of the\n    repository by the name `co-build` in the directory given by\n    environment variable `MDVL_CI_PHOENIX_ROOT` or `..` (i.e. one level up the\n    present working directory) if `MDVL_CI_PHOENIX_ROOT` is not set.\n 2. If the file was not found this way, _attempt to load from Internet_. To\n    do this, it tries to download the XML from GitHub, i.e. URL\n    \u003chttps://raw.githubusercontent.com/m7a/co-build/master/ant-build-template.xml\u003e.\n\n## Variant A: Block at the end of a file\n\nThis is the preferred default variant which consists of a block entitled\n`CONSTANT TPL IMPORT` to indicate that what follows is not intended to\nnormally be modified.\n\n~~~{.xml}\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject default=\"build\"\u003e\n\n\u003c!-- APPLICATION METADATA --\u003e\n\u003cproperty name=\"masysma.target\"  value=\"hello\"/\u003e \n\u003c!-- ... --\u003e\n\n\u003c!-- CI INTEGRATION --\u003e\n\u003c!-- ... --\u003e\n\n\u003c!-- CONSTANT TPL IMPORT --\u003e\n\u003cproperty environment=\"env\"/\u003e\n\u003ccondition property=\"masysma.internal.includepath.rel\" value=\"${env.MDVL_CI_PHOENIX_ROOT}\" else=\"..\"\u003e\u003cisset property=\"env.MDVL_CI_PHOENIX_ROOT\"/\u003e\u003c/condition\u003e\n\u003cproperty name=\"masysma.internal.includepath\" location=\"${masysma.internal.includepath.rel}\"/\u003e\n\u003cproperty name=\"masysma.internal.loadpath\" value=\"${masysma.internal.includepath}/co-build/ant-build-template.xml\"/\u003e\n\u003ccondition property=\"masysma.internal.load\" value=\"file://${masysma.internal.loadpath}\" else=\"https://raw.githubusercontent.com/m7a/co-build/master/ant-build-template.xml\"\u003e\u003cresourceexists\u003e\u003cfile file=\"${masysma.internal.loadpath}\"/\u003e\u003c/resourceexists\u003e\u003c/condition\u003e\n\u003cimport\u003e\u003curl url=\"${masysma.internal.load}\"/\u003e\u003c/import\u003e\n\n\u003c/project\u003e\n~~~\n\n## Variant B: Block split into two parts\n\nThis variant is useful if access to `MDVL_CI_PHOENIX_ROOT` is also needed by\nparts of the build targets. They can read its absolute location from property\n`masysma.internal.includepath`.\n\n~~~{.xml}\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject default=\"build\"\u003e\n\n\u003c!-- (metadata etc) --\u003e\n\n\u003c!-- PART OF TPL HERE FOR USE IN BUILD --\u003e\n\u003cproperty environment=\"env\"/\u003e\n\u003ccondition property=\"masysma.internal.includepath.rel\" value=\"${env.MDVL_CI_PHOENIX_ROOT}\" else=\"..\"\u003e\u003cisset property=\"env.MDVL_CI_PHOENIX_ROOT\"/\u003e\u003c/condition\u003e\n\u003cproperty name=\"masysma.internal.includepath\" location=\"${masysma.internal.includepath.rel}\"/\u003e\n\n\u003c!-- (customized build instructions --\u003e\n\n\u003c!-- TPL IMPORT (PARTIALLY GIVEN ABOVE) --\u003e\n\u003cproperty name=\"masysma.internal.loadpath\" value=\"${masysma.internal.includepath}/co-build/ant-build-template.xml\"/\u003e\n\u003ccondition property=\"masysma.internal.load\" value=\"file://${masysma.internal.loadpath}\" else=\"https://raw.githubusercontent.com/m7a/co-build/master/ant-build-template.xml\"\u003e\u003cresourceexists\u003e\u003cfile file=\"${masysma.internal.loadpath}\"/\u003e\u003c/resourceexists\u003e\u003c/condition\u003e\n\u003cimport\u003e\u003curl url=\"${masysma.internal.load}\"/\u003e\u003c/import\u003e\n\n\u003c/project\u003e\n~~~\n\nUse in Projects with a single Programming Language\n==================================================\n\nThe following sections show how the template can be instantiated for a given\ndirectory with the source code in a single programming language.\n\nTo allow automatic compilation, at least a `masysma.target` needs to be given.\nThis is usually set to the name of the output file without extension.\n\n## Ada\n\nDetection\n:   A project compiled as Ada source code, if a file with name\n    `${masysma.target}.adb` can be found.\n\nCompilation\n:   Ada compilation is performed by invoking the `gnatmake` utility.\n\nExample\n:   See [ma_capsblinker(11)](../11/ma_capsblinker.xhtml).\n\nNo language-specific properties defined. `masysma.target` refers to the output\nexecutable file to produce.\n\n## C\n\nDetection\n:   C compilation is detected by the existence of any `.c` file in the\n    `${basedir}`.\n\nCompilation\n:   Compilation for C projects consists of two separate invocations:\n\n 1. Compilation of the individual `.c` files with\n    `gcc -Wall -pedantic -std=c89 -O3 FILE.c`\n 2. Linking of all `.o` files with\n    `gcc -o ${masysma.target} *.o`\n\nExample\n:   See [progress(32)](progress.xhtml), especially the _Progress 2 C_ variant.\n\nProperties to influence compilation are described in the following:\n\n`masysma.c.standard`\n:   Sets a different value for the `-std=` flag. Default: `c89`.\n`masysma.c.compile.1` and `masysma.c.compile.2`\n:   Sets additional arguments to pass to the compiler invocation.\n    The use of this properties is similar to `masysma.c.link.X` explained\n    below.\n`masysma.c.link.1` and `masysma.c.link.2`\n:   Sets additional arguments to pass to the final/linking `gcc` invocation.\n    These are added as-is to the commandline if they have a value different\n    from the empty string. Example: `-lpthread`. Currently, the number of\n    such arguments is limted to 2, but of course, it is possible to increase\n    that if more are needed in the future.\n\n## Java\n\nDetection\n:   Java compilation is assumed if any `.java` files are found in the file\n    tree (below the `build.xml`'s directory).\n\nCompilation\n:   All files are compiled including debug information and with\n    `-Xlint:unchecked`. To invoke `javac`, ant's Javac task is instantiated.\n\nTo generate `.jar` files, target `jar` is provided. By default, all files from\ndirectory `ma` are included in the jarfile. The name of the jarfile is derived\nfrom `masysma.target` by appending suffix `.jar`.\n\nExample\n:   See [gamuhr(32)](gamuhr.xhtml) for basic compilation.\n    See [progress(32)](progress.xhtml) (subdirectory `progress1`) for an example\n    with classes provided in a directory other than `ma`.\n\nRelevant properties for Java compilation are as follows:\n\n`masysma.main`\n:   Defines the main-class (only relevant in conjunction with target `jar`).\n\nAside from properties, there are further settings that can be tuned for\ncompilation.\n\n`masysma.inccls` (fileset)\n:   This fileset defines the list of files to include in the jarfile. By\n    default, all files from below directory `ma` are included which means\n    sources (`.java`), classes (`.class`) along with any other files the\n    application might consider resources (e.g. `.txt`, `.png`, etc.).\n    Change this setting in case classes are not taken from directory `ma`.\n    Example: `\u003cfileset id=\"masysma.inccls\" dir=\".\" includes=\"*.class\"/\u003e`\n    includes all classfiles from the present working directory (useful for\n    compiling programs which are using the default package).\n    In order for this setting to take effect, it has to be specified after\n    importing the template i.e. near the end of the `build.xml` file.\n\n`masysma.classpath` (path)\n:   This path defines the locations to look for classes (only relevant for\n    compilation). By default, the `build.xml`'s directory and all `.jar` files\n    from below a directory called `lib` are included.\n\n## LaTeX\n\nAs LaTeX compilation may require multiple stages, the compilation is invoked\nrepeatedly until `Rerun to` no longer appears in the output. Additionally,\n`bibtex8` is automatically invoked if file `literature.bib` exists. The `.tex`\nfile to compile is expected to have its name equal to the value of\nproperty `masysma.target` followed by `.tex`. Task `clean` attempts to delete\nmost files created along with the `.aux` file for the respective source file.\nNote that builds of multiple `.tex` files are only supported as far as they are\nincluded with `\\input`, because auxiliary files created by inclusion of other\n`.tex` files are not cleaned up by default.\n\nDetection\n:   LaTeX compilation is invoked if a file called `${masysma.target}.tex`\n    exists.\n\nCompilation\n:   Compilation currently uses a fixed set of flags and always invokes\n    `pdflatex -halt-on-error -file-line-error -interaction batchmode`.\n    If `literature.tex` exists, BibTeX is invoked with\n    `bibtex8 ${masysma.target}`.\n\nUse in Projects with multiple Parts\n===================================\n\nTo build a project with multiple programming languages or parts, create\ndistinct subdirectories for each of the individual build configurations.\nInside them, provide individual `build.xml` files. These may use the template\nas explained before except that the relative location of file\n`ant-build-template.xml` may be one directory farther upwards. To apply this\nchange, edit the following line from the template:\n\n~~~{.xml}\n\u003ccondition property=\"masysma.internal.includepath.rel\" value=\"${env.MDVL_CI_PHOENIX_ROOT}\" else=\"..\"\u003e\u003cisset property=\"env.MDVL_CI_PHOENIX_ROOT\"/\u003e\u003c/condition\u003e\n~~~\n\nand change it to this:\n\n~~~{.xml}\n\u003ccondition property=\"masysma.internal.includepath.rel\" value=\"${env.MDVL_CI_PHOENIX_ROOT}\" else=\"../..\"\u003e\u003cisset property=\"env.MDVL_CI_PHOENIX_ROOT\"/\u003e\u003c/condition\u003e\n~~~\n\nThe resulting structure behaves like a recursive makefile except it is using\n`ant`. Note that the following targets can be invoked on the top-level\nto apply them to all parts: `build`, `clean` and `dist-clean`.\n\nAs an example, consider Ma_Sys.ma DirStat [dirstat(32)](dirstat.xhtml), whose\n`build.xml` files are organized as follows to build two distinct subprojects:\nDirStat 1 and DirStat 2.\n\n\t/bo-dirstat\n\t |\n\t +-- dirstat1/\n\t |    |\n\t |    +-- build.xml\n\t |\n\t +-- dirstat2/\n\t |    |\n\t |    +-- build.xml\n\t |\n\t +-- build.xml\n\nThe top-level `build.xml` uses the template to declare an MDVL pacakge but does\nnot itself provide any `masysma.target` definition. The subordinate `build.xml`\nfiles from the subdirectories are as follows (relevant excerpts shown):\n\nFor DirStat 1:\n\n~~~{.xml}\n\u003cproperty name=\"masysma.target\" value=\"dirstat1\"/\u003e \n\u003cproperty name=\"masysma.main\" value=\"ma.stat.Main\"/\u003e \n~~~\n\nFor DirStat 2:\n\n~~~{.xml}\n\u003cproperty name=\"masysma.target\" value=\"dirstat2\"/\u003e \n\u003cproperty name=\"masysma.main\" value=\"ma.dirstat.Main\"/\u003e \n~~~\n\nHere, both parts are Java projects, but this need not be the case.\nAlso, it is not _required_ that the individual parts use the template -- they\nmay also consist of standalone Ant `build.xml` files.\n\nMDPC 2.0\n========\n\nMDPC expands to _Ma_Sys.ma Developer Linux Packaging Control_ and provides a\nmeans to build Debian-compatible packages in a simplified fashion.\n\nThe first version was published on the debian-user mailinglist\n\u003chttps://lists.debian.org/debian-user/2013/08/msg00042.html\u003e and consists of\na series of shell scripts. The new version is (partially) integrated with\nMa_Sys.ma Build and relies on Ant instead of shell scripts.\n\nMDPC 2 sets defaults for files which would have otherwise to be provided\nexplicitly and declares Ant properties for relevant fields to fill in for a\ngiven package. It provides the following targets: `package`, `init`, `incver`.\nThe properties to declare package metadata are explained in the following.\n\n## Common Metadata\n\nThis section lists the most commonly needed MDPC 2 properties.\n\n`mdpc.name` (required)\n:   Declares the name of the package to build. This will later appear in\n    the installation logs, file name and package search results if queried.\n\n`mdpc.arch` (default: `all`)\n:   Declares the package architecture.\n    `all` means that the package is suited for all architectures (e.g. for\n    portable scripts, this can be the case). `any` declares that the package\n    can be compiled for any architecture, but the resulting binaries are\n    architecture-specific. Apart from these two (very common) options, it is\n    possible to specify an architecture identifier like `amd64`, `armhf`,\n    `i386` etc. directly although this should only be necessary for packages,\n    which rely on pre-built binaries.\n\n`mdpc.descrs` (required)\n:   One-line description of the package.\n\n`mdpc.descrl` (required)\n:   Multi-line description of the package. Note that all lines need to be\n    indented by a single whitespace and “empty” lines are expected to be marked\n    by a single whitespace followed by a dot (` .`).\n\n`mdpc.depends` (default: `${shlibs:Depends}, ${misc:Depends}, ${java:Depends}`)\n:   Declares the package's dependencies in Debian `control` file format\n    (comma-separated). By default, a series of `${...}` attempt to auto-detect\n    some dependencies, but this is known to be incomplete for scripts.\n\n`mdpc.section` (required)\n:   Associates the package with a _section_, which can be one of the following:\n    `admin`, `devel`, `doc`, `editors`, `electronics`, `embedded`, `games`,\n    `graphics`, `httpd`, `interpreters`, `java`, `libs`, `math`, `metapackages`,\n    `misc`, `net`, `science`, `shells`, `tex`, `text`, `utils`, `web`, `x11`\n\n`mdpc.maintainer` (default: `Linux-Fan, Ma_Sys.ma \u003cMa_Sys.ma@web.de\u003e`)\n:   Declares the package's maintainer.\n\n## License Metadata\n\nThis section explains the licensing-related MDPC 2 properties. It is an intended\ndesign goal that precise license specifications should be possible with MDPC 2,\nthus there are multiple properties to influence the `copyright` file at\ndifferent levels of granularity.\n\n`mdpc.cpyear` (default: `2022`)\n:   Declares the copyright year range for the current package.\n    For instance, if you develeoped a project from 2018 to 2020, you might\n    set this to `2018, 2019, 2020` etc.\n`mdpc.copyright`\n:   Declares a copyright notice in single-line format.\\\n    Default value: `Copyright (c) ${mdpc.cpyear} Ma_Sys.ma \u003cMa_Sys.ma@web.de\u003e`\n`mdpc.lfiles` (Default: `*`)\n:   Declares the set of files to apply the license inforamtion to.\n`mdpc.lblock` (Default: GPL3+)\n:   Declares a constant license block to use.\\\n    Defaults to the license block for _GPL 3 or higher_ which is used with\n    most published Ma_Sys.ma projects.\n`mdpc.copyright.file`\n:   If this property is set, properties `mdpc.cpyear`, `mdpc.copyright` and\n    `mdpc.lblock` are ignored unless explicitly referenced. This provides the\n    raw contents of a Debian `copyright` file allowing for external projects and\n    their licenses to be added or for a different choice of license from GPL3+:\n    If this property is not set, a `copyright` file will be generated from\n    `mdpc.cpyear` and `mdpc.copyright` properties and it will set the license to\n    the value defined in `mdpc.lblock`\n\nMa_Sys.ma Note\n:   Ma_Sys.ma code is usually released under _GPL 3 or higher_ and thus if you\n    do not find any copyright information in a Ma_Sys.ma project, try to\n    generate its package and refer to the generated `copyright` information. If\n    you need the license declearation to be more explicit, just send an e-mail\n    to `Ma_Sys.ma@web.de` and suitable annotations may be added to the project\n    under consideration.\n\n## Optional and Special Metadata\n\nHere are some special-purpose and rarely needed properties.\n\n`mdpc.bdep` (default: `debhelper (\u003e= 8)`)\n:   Declares the package's build-time dependencies.\n\n`mdpc.priority` (default: `optional`)\n:   Declares the package's priority. Most often, this need not be changed.\n\n`mdpc.recommends` (optional)\n:   Declares recommended dependencies. These need not be installed, but will\n    be installed by default. For the exact meanings, refer to Debian Policy.\n\n`mdpc.conflicts` (optional)\n:   Declares `Conflicts`.\n\n`mdpc.suggests` (optional)\n:   Declares `Suggests`.\n\n## File Properties\n\nSome properties map directly to related Debian files:\n\n * `mdpc.file.install` -- contents for file `debian/install`.\\\n   Default value: `${masysma.target} /usr/bin`\n * `mdpc.file.displace` -- contents for file `debian/displace` (optional).\n * `mdpc.add.rules` -- contents to add to `debian/rules` (optional).\n\n## Example\n\nAs an example, consider creating a simple _Hello World_ package.\nInitially, it has just these two files:\n\n\thello/\n\t |\n\t +-- hello.c\n\t |\n\t +-- build.xml\n\n`hello.c` is a minimal C program:\n\n~~~{.c}\n#include \u003cstdio.h\u003e\nint main(int argc, char** argv)\n{\n\tprintf(\"Hello world.\\n\");\n\treturn 0;\n}\n~~~\n\n`build.xml` is as follows:\n\n~~~{.xml}\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cproject default=\"build\"\u003e\n\n\u003c!-- APPLICATION METADATA --\u003e\n\u003cproperty name=\"masysma.target\" value=\"hello\"/\u003e \n\u003cproperty name=\"mdpc.name\"      value=\"mdvl-hello\"/\u003e\n\u003cproperty name=\"mdpc.section\"   value=\"misc\"/\u003e\n\u003cproperty name=\"mdpc.descrs\"    value=\"Hello Package\"/\u003e\n\u003cproperty name=\"mdpc.arch\"      value=\"any\"/\u003e\n\u003cproperty name=\"mdpc.descrl\"\u003e\n This is the hello package.\n\u003c/property\u003e\n\n\u003c!-- CONSTANT TPL IMPORT --\u003e\n\u003cproperty environment=\"env\"/\u003e\n\u003ccondition property=\"masysma.internal.includepath.rel\" value=\"${env.MDVL_CI_PHOENIX_ROOT}\" else=\"..\"\u003e\u003cisset property=\"env.MDVL_CI_PHOENIX_ROOT\"/\u003e\u003c/condition\u003e\n\u003cproperty name=\"masysma.internal.includepath\" location=\"${masysma.internal.includepath.rel}\"/\u003e\n\u003cproperty name=\"masysma.internal.loadpath\" value=\"${masysma.internal.includepath}/co-build/ant-build-template.xml\"/\u003e\n\u003ccondition property=\"masysma.internal.load\" value=\"file://${masysma.internal.loadpath}\" else=\"https://raw.githubusercontent.com/m7a/co-build/master/ant-build-template.xml\"\u003e\u003cresourceexists\u003e\u003cfile file=\"${masysma.internal.loadpath}\"/\u003e\u003c/resourceexists\u003e\u003c/condition\u003e\n\u003cimport\u003e\u003curl url=\"${masysma.internal.load}\"/\u003e\u003c/import\u003e\n\n\u003c/project\u003e\n~~~\n\nTo perform the first build of a package it is necessary to provide a\n`debian-changelog.txt`. To create this file, target `init` can be used as\nfollows: `ant init`. Afterwards, there are three files:\n\n\thello/\n\t |\n\t +-- hello.c\n\t |\n\t +-- debian-changelog.txt\n\t |\n\t +-- build.xml\n\nThe new file's contents are as follows:\n\n~~~\nmdvl-hello (1.0.0) stable; urgency=medium\n\n  * Package created with MDPC 2\n\n -- Linux-Fan, Ma_Sys.ma \u003cMa_Sys.ma@web.de\u003e  Sat, 28 Mar 2020 16:51:28 +0100\n~~~\n\nSee [documentation on `debian/changelog`](https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#changelog)\nfor hints on the format of the file. Having established this directory\nstructure, one can call `ant package` to create the associated package file.\nIf the package is intended to be upgraded to a new version, target `incver`\ncan be invoked before performing the package build.\n\nMa_Sys.ma-supplied packages already contain a `debian-changelog.txt` which means\nit is sufficient to invoke `ant package` only to generate their package files.\n\nDownloading Artifacts\n=====================\n\nIn case external dependencies are needed for a build, Ma_Sys.ma Build allows\ndownloading Git repositories and artifacts.\n\n## Downloading Ma_Sys.ma Git Repositories\n\nA downloaded Git repository is stored one next to the repository's directory.\nThe mechanism is invoked as follows (example):\n\n~~~{.xml}\n\u003cmasysma_require_repo masysmarepoid=\"co-maartifact\"/\u003e\n~~~\n\nThe repository name is given in attribute `masysmarepoid`.\n\nNote that this is specific to Ma_Sys.ma Repositories, i.e. prefix\n`https://github.com/m7a`. To use this mechanism for your own repositories, you\ncould create a modified copy of the build template and change the attribute name\nand base URL in `ant-build-template.xml`. Alternatively, consider using the more\nversatile `masysma_require_artifact` element described in the next section.\n\nAn advanced example for using the mechanism to download a required library\ncan be found in `ma_inventory_barcodegensvg/build.xml` from the\n[ma_inventory(32)](ma_inventory.xhtml) repository.\n\n## Downloading Artifacts -- maartifact Integration\n\n[maartifact(11)](../11/maartifact.xhtml) can be invoked from Ma_Sys.ma Build\ntargets by using the specifically provided `masysma_require_artifact` element.\nIf not already available, `maartifact` is downloaded using the Git download\nmechanism explained before.\n\nAs an example, consider the following excerpt from `build.xml` of repository\n`bp-jexer`:\n\n~~~{.xml}\n\u003ctarget name=\"download\"\u003e\n\t\u003cmasysma_require_artifact\n\t\t\tmasysmaartifact=\"jexer.git\"\n\t\t\tmasysmaatarget=\"build\"\n\t\t\tmasysmaadef=\"https://gitlab.com/klamonte/jexer.git/\"/\u003e\n\u003c/target\u003e\n~~~\n\nHere, the repository specified under `masysmaadef` is downlaoded to directory\n`build`. The name given under `masysmaartifact` serves to identify the\ndownloaded resource among all downloaded artifacts such that the download only\nneeds to happen on first use.\n\nThis XML specification of an artifact corresponds to the following `maartifact`\ncommandline invocation (`@...` refers to the value of attribute `...`):\n\n\tmaartifact @masysmaaction @masysmaartifact @masysmaartarget -b @masysmaabranch @masysmaadef\n\nIn the invocation, `@masysmaaction` defaults to `extract` and\n`@masysmaabranch` defaults to `master`.\n\nSee [maartifact(11)](../11/maartifact.xhtml) for further documentation on the\nuse of `maartifact`.\n\nMa_Sys.ma CI Integration\n========================\n\nThe following targets provide entrypoints for the interaction with the\n_Ma_Sys.ma CI_:\n\n`autopackage`\n:   This can be used to trigger an incremental package build\n    i.e. only build the package when it has changed\n`autoci`\n:   By convention, this build is called by the Ma_Sys.ma CI on each\n    iteration (if it is defined in the ant file). A typical integration thus\n    looks as follows in a `build.xml` file:\n\n~~~{.xml}\n\u003c!-- CI INTEGRATION --\u003e\n\u003ctarget name=\"autoci\" depends=\"autopackage\"/\u003e\n~~~\n\nFuture Directions\n=================\n\nThe previously offered `trigger` target is up for removal with one of the next\nrevisions.\n\nLicense\n=======\n\n\tMa_Sys.ma Build Ant Build Template,\n\tCopyright (c) 2019, 2020, 2022 Ma_Sys.ma.\n\tFor further info send an e-mail to Ma_Sys.ma@web.de.\n\t\n\tThis program is free software: you can redistribute it and/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\t\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\tGNU General Public License for more details.\n\t\n\tYou should have received a copy of the GNU General Public License\n\talong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Fco-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7a%2Fco-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7a%2Fco-build/lists"}