{"id":16567828,"url":"https://github.com/sylvainhalle/antrun","last_synced_at":"2025-10-29T00:31:38.117Z","repository":{"id":34202337,"uuid":"38058304","full_name":"sylvainhalle/AntRun","owner":"sylvainhalle","description":"A general-purpose Ant build script","archived":false,"fork":false,"pushed_at":"2024-08-22T14:53:46.000Z","size":73656,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T20:44:56.905Z","etag":null,"topics":["ant","build-scripts","coverage-report","jacoco","jar","java","junit"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/sylvainhalle.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2015-06-25T15:40:22.000Z","updated_at":"2024-08-22T14:52:32.000Z","dependencies_parsed_at":"2024-09-04T04:15:38.526Z","dependency_job_id":null,"html_url":"https://github.com/sylvainhalle/AntRun","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2FAntRun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2FAntRun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2FAntRun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2FAntRun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sylvainhalle","download_url":"https://codeload.github.com/sylvainhalle/AntRun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238751067,"owners_count":19524519,"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":["ant","build-scripts","coverage-report","jacoco","jar","java","junit"],"created_at":"2024-10-11T21:07:36.486Z","updated_at":"2025-10-29T00:31:38.110Z","avatar_url":"https://github.com/sylvainhalle.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"AntRun: a general-purpose Ant build script\n==========================================\n\nAntRun is a template structure for Java projects. Through its comprehensive\nAnt build script, it supports automated execution of unit tests, generation\nof [Javadoc](http://www.oracle.com/technetwork/articles/java/index-jsp-135444.html)\ndocumentation and code coverage reports (with\n[JaCoCo](http://www.eclemma.org/jacoco/)), and download and installation\nof JAR dependencies as specified in an external, user-definable XML file.\nIt also includes a boilerplate `.gitignore` file suitable for an Eclipse or\nIntelliJ project.\n\nAll this is done in a platform-independent way, so your build scripts\nshould work on MacOS, Linux and Windows.\n\nTable of Contents                                                    {#toc}\n-----------------\n\n- [Quick start guide](#quickstart)\n- [Available tasks](#tasks)\n- [Continuous integration](#ci)\n- [Cross-compiling](#xcompile)\n- [About the author](#about)\n\nQuick start guide                                             {#quickstart}\n-----------------\n\n1. First make sure you have the following installed:\n\n  - The Java Development Kit (JDK) to compile. AntRun was developed and\n    tested on version 11 of the JDK, but it is probably safe to use\n    any later version.\n  - [Ant](http://ant.apache.org) to automate the compilation and build\n    process. For Debian-based systems, this corresponds to *two* packages:\n    `ant` and `ant-optional`.\n\n2. Download the AntRun template from\n   [GitHub](https://github.com/sylvainhalle/AntRun) or clone the repository\n   using Git:\n   \n   git@github.com:sylvainhalle/AntRun.git\n\n3. Override any defaults, and specify any dependencies your project\n   requires by editing `config.xml`. In particular, you may want\n   to change the name of the Main class.\n\n4. Start writing your code in the `src` folder, and your unit\n   tests in `srctest`. Optionally, you can create an Eclipse\n   workspace out of the `Source` folder, with the root directory\n   as a project. (Eclipse files can also be auto-generated, see\n   below.)\n\n5. Use Ant to build your project. To compile the code, generate the\n   Javadoc, run the unit tests, generate a test and code coverage report\n   and bundle everything in a runnable JAR file, simply type `ant all` on\n   the command line.\n   \n6. If dependencies were specified in step 4 and are not present in the\n   system, type `ant download-deps` to automatically download and install\n   them before compiling.\n\nOtherwise, use one of the many [tasks](#tasks) that are predefined.\n\nAvailable tasks                                                    {#tasks}\n---------------\n\nIn doubt, execute\n\n    $ ant -p\n\nfrom the project's top folder to get the list of all available targets.\n\n### dist\n\nThe default task. Currently applies `jar`.\n\n### compile\n\nCompiles the project; checks and downloads dependencies, if any of them\nis not fulfilled.\n\n### compile-tests\n\nCompiles the unit tests. Tests can use either JUnit 4 or JUnit 5. They\nare run with JUnit 5 (with the \"vintage\" engine in the case of tests\nwritten for version 4).\n\n### jar\n\nCompiles the project, generates the Javadoc and creates a runnable JAR,\nincluding the sources and the documentation (and possibly the project's\ndependencies, see `download-deps` below).\n\n### test\n\nPerforms tests with JUnit. A summary of the execution of the tests is also\nprinted at the console. The format of this summary depends on the version of\nAnt.\n\n### test-legacy\n\nPerforms tests with JUnit. Performs tests with jUnit, but without using the\n`junitlauncher` task that is supported only in Ant 1.10.6 onwards. This results\nin less detailed reports. It is recommended to use only on versions of Ant\nprior to 1.10.6.\n\n### report\n\nGenerates unit test and code coverage reports (with JaCoCo).\nThe unit test report (in HTML format) is available in the `tests/junit`\nfolder (which will be created if it does not exist). The code coverage\nreport is available in the `tests/coverage` folder.\n\nAlternately, you can call `junit-report` and `jacoco-report` to perform\nthese tasks individually.\n\nNote that this task requires that tests have first been run, but this must\nbe done separately. It will fail if it does not find the files generated during\nthe execution of the tests that are necessary to produce the reports.\n\n### download-deps\n\nDownloads all the JAR dependencies declared in `config.xml`, and required\nto correctly build the project. The JAR files are extracted and placed in\nthe `dep` or the `lib` folder. When compiling (with the `compile` task), the\ncompiler is instructed to include these JARs in its classpath. Depending on the\nsetting specified in `config.xml`, these JARs are also bundled in the\noutput JAR file of the `jar` task.\n\n### clean-reports\n\nDeletes test reports only.\n\n### clean\n\nDeletes compiled files and test reports. The standard task to force a fresh\nrecompilation of the sources.\n\n### wipe\n\nLike `clean`, but also deletes all JAR dependencies.\n\n### eclipse\n\nGenerates `.project` and `.classpath` files for this project. These files\nare used by [Eclipse](https://eclipse.org) to setup a project in a workspace.\nSelect *Import*/*General*/*Existing projects into workspace* and select\nthe projects folder. The project should show up with all its dependencies\nalready set.\n\n\nContinuous integration                                               {#ci}\n----------------------\n\nAntRun makes it easy to use [continuous\nintegration](https://en.wikipedia.org/wiki/Continuous_integration) services\nlike [Travis CI](https://travis-ci.org) or\n[Semaphore](http://semaphoreapp.com). The sequence of commands to\nautomatically setup the environment, build and test it is (for Linux):\n\n    $ ant\n    $ ant test\n\nNotice how all the process is platform-independent.\n\nDeclaring dependencies                                              {#deps}\n----------------------\n\nAmong other configuration settings, dependencies can be declared in the file\n`config.xml`. Locate the `\u003cdependencies\u003e` section in that file, and add as\nmany `\u003cdependency\u003e` entries as required. The structure of such a section is as\nfollows:\n\n``` xml\n\u003cdependency\u003e\n      \u003cname\u003eTest Dep\u003c/name\u003e\n      \u003cclassname\u003eca.uqac.lif.NonExistentClass\u003c/classname\u003e\n      \u003cfiles\u003e\n        \u003cjar\u003ehttp://sylvainhalle.github.io/AntRun/placeholders/dummy-jar.jar\u003c/jar\u003e\n        \u003czip\u003ehttp://sylvainhalle.github.io/AntRun/placeholders/dummy-zip.zip\u003c/zip\u003e\n        \u003ctgz\u003ehttp://sylvainhalle.github.io/AntRun/placeholders/dummy-tar.tgz\u003c/tgz\u003e\n      \u003c/files\u003e\n      \u003cbundle\u003etrue\u003c/bundle\u003e\n\u003c/dependency\u003e\n```\n\nThe parameters are:\n\n- `name`: a human-readable name for the dependency, only used for display\n- `classname`: a fully qualified class name that is supposed to be provided\n  by the dependency. AntRun checks if this class name is present in the\n  classpath; if not, it will download the files specified in the `files`\n  section\n- `files`: a list of either `jar`, `zip` or `tgz` elements, each containing a\n  URL to a JAR file, or an archive of JAR files. AntRun downloads these files\n  and places them in either the `dep` or the `lib` folders of the project (both\n  are in the classpath). If the URL is a zip or tgz, it also unzips the content\n  of the archive.\n- `bundle`: when this element has the value `true`, the dependency is copied\n  to the `dep` folder; otherwise, it is copied to the `lib` folder. As was\n  said, both are in the classpath, but only the JARs in the `dep` folder are\n  bundled when creating a JAR file for the project (using the `jar` task).\n\nIn Eclipse, it is also possible to depend on another project. This can\nbe specified using the `project` element, as follows:\n\n``` xml\n\u003cproject\u003eName of the project\u003c/project\u003e\n```\n\nCross-compiling                                                 {#xcompile}\n---------------\n\nThe `.class` files are marked with the major version number of the compiler\nthat created them; hence a file compiled with JDK 1.11 will contain this\nversion number in its metadata. A JRE 1.8 will refuse to run them,\nregardless of whether they were built from 1.8-compliant code.\n*Cross-compiling* is necessary if one wants to make a project compatible\nwith a version of Java earlier than the one used to compile it. \n\nBy default, AntRun compiles your project using the default JDK installed on\nyour computer. However, you can compile files that are compatible with\na specific version of Java by setting the `targetjdk` parameter to the\na version of Java (e.g. 8 for Java 8) in `config.xml`.\n\nProjects that use AntRun                                        {#projects}\n------------------------\n\nVirtually every Java project developed at [LIF](https://liflab.github.io) uses\nan AntRun template project. This includes:\n\n- [Azrael](https://github.com/sylvainhalle/Azrael), a generic serialization\n  library\n- [BeepBeep 3](https://liflab.github.io/beepbeep-3), an event stream\n  processing engine, and most of its\n  [palettes](https://github.com/liflab/beepbeep-3-palettes)\n- [Bullwinkle](https://github.com/sylvainhalle/Bullwinkle), a runtime BNF\n  parser\n- [Jerrydog](https://github.com/sylvainhalle/Jerrydog), a lightweight web\n  server\n- [LabPal](https://liflab.github.io/labpal), a framework for running\n  computer experiments\n- [Petit Poucet](https://github.com/liflab/petitpoucet), a generic\n  explainability library\n- [Synthia](https://github.com/liflab/synthia), a modular data structure\n  generator\n- [TeXtidote](https://github.com/sylvainhalle/textidote), a spelling and\n  grammar checker for LaTeX documents\n\n...and many more.\n\nAbout the author                                                   {#about}\n----------------\n\nAntRun was written by [Sylvain Hallé](https://leduotang.ca/sylvain),\nFull Professor at [Université du Québec à\nChicoutimi](https://www.uqac.ca/), Canada.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvainhalle%2Fantrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylvainhalle%2Fantrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvainhalle%2Fantrun/lists"}