GithubHelp home page GithubHelp logo

jonathanrlouie / idris-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 110 KB

A Maven plugin for Idris 2

License: The Unlicense

Nix 3.25% Groovy 0.36% Java 85.81% Idris 7.52% Shell 2.38% HTML 0.68%

idris-maven-plugin's Introduction

Idris Maven Plugin

The idris-maven-plugin is used to compile and run Idris code in Maven. It is meant to be used with the idris-jvm backend.

Supported Features

Compile Mojo

  • Compiles Idris applications to JVM bytecode
  • Automatically downloads the idris-jvm compiler from Maven Central if it is not supplied

Run Mojo

  • Runs Idris applications
  • Automatically downloads dependencies from Maven Central
  • Automatically downloads the idris-jvm runtime from Maven Central if it is not supplied

Creating a new Idris Maven project

To create a new Idris Maven project, you can use the idris-maven-archetype.

With the archetype plugin installed, run the following Maven command to create a new Idris Maven project from the archetype:

mvn archetype:generate                                  \
  -DarchetypeGroupId=io.github.jonathanrlouie           \
  -DarchetypeArtifactId=idris-maven-archetype           \
  -DarchetypeVersion=1.0-SNAPSHOT                       \
  -DgroupId=<my.groupid>                                \
  -DartifactId=<my-artifactId>

You will need to set the IDRIS2_PREFIX environment variable to make the base Idris2 libraries accessible.

By default, the plugin will automatically download the Idris2 compiler and the base libs to the local Maven Artifact Repository. The default artifact repository directory is in the .m2 directory in the home directory.

On UNIX and Linux, that is ~/.m2/repository/io/github/mmhelloworld/idris-jvm-compiler/0.5.1/idris2-0.5.1/lib

On Windows, that is C:\Documents and Settings\UserName\.m2\repository\io\github\mmhelloworld\idris-jvm-compiler\0.5.1\idris2-0.5.1\lib

For example, if you are on Linux with all of the Maven plugin's default settings, you should run export IDRIS2_PREFIX=~/.m2/repository/io/github/mmhelloworld/idris-jvm-compiler/0.5.1/idris2-0.5.1/lib from the command line to set the IDRIS2_PREFIX environment variable correctly.

You should now be able to compile and run the project using mvn idris:run from the root of the newly created project.

How to run the examples

To run the examples, run mvn idris:run from the root of the example project you want to run.

Requirements for building the Plugin

Before building and installing the plugin, you will need JDK 11 or higher and Maven 3.8.1 or higher. Lower versions of Maven may work, but are not explicitly supported. You also will need the idris-jvm backend. See their documentation for more information on installing the backend.

Installing the Plugin

To install the plugin, clone the repository and run mvn install from the root of the repository.

Running the Tests

From the root of the repository, run mvn test.

To run the functional tests, run the run_functional_tests.sh script in the root of the repository.

Nix Environment

Windows users should use WSL and install Nix before following the instructions below.

For Nix users, nix develop in the root of the repository to enter a developer environment, which already has the required versions of the JDK and Maven. It also automatically downloads and installs the idris-jvm backend.

Contributing

If you want to contribute to this project, please fork the repository and open a pull request. Your pull request will be automatically checked for linting and style.

Planned Features

  • Add a Help Mojo
  • Support for compiling library code into JARs without needing to specify a main class
  • Support downloading Idris dependencies through a user specified package manager (pack, sirdi, etc.)
  • Allow running the compiler and Idris applications in a separate thread
  • Support for mixed Java and Idris projects (Maybe? Depends on what is required to make this work.)

idris-maven-plugin's People

Contributors

jonathanrlouie avatar

Stargazers

Marimuthu Madasamy avatar

Watchers

James Cloos avatar  avatar

idris-maven-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.