• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

typelead/gradle-eta: Gradle plugin for the Eta programming language

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

typelead/gradle-eta

开源软件地址(OpenSource Url):

https://github.com/typelead/gradle-eta

开源编程语言(OpenSource Language):

Java 94.1%

开源软件介绍(OpenSource Introduction):

Gradle Plugin for Eta

CircleCI Gradle Plugin Portal Gradle Plugin Portal Gradle Plugin Portal

A gradle plugin for building Eta projects via the Etlas build tool.

Requirements

This plugin requires that Gradle 4.3+ is used.

Using the Plugin

Plugin DSL

Eta Base Plugin

This is used for configuring your Eta/Etlas versions for your entire project. You can only do such configuration in the root project.

NOTE: Both the Eta Plugin and the Eta Android Plugin apply the Eta Base Plugin by default, so if you import either one, it is not required to import this one!

plugins {
    id 'com.typelead.eta.base' version '0.8.1'
}

Eta Plugin

This is used for standard JVM projects.

plugins {
    id 'com.typelead.eta' version '0.8.1'
}

Eta Android Plugin

This is used for Android projects.

plugins {
    id 'com.typelead.eta.android' version '0.8.1'
}

Legacy Method

Before applying any of the plugins, you should add the following in the build.gradle for your root project.

buildscript {
  repositories {
    maven {
      url 'https://plugins.gradle.org/m2/'
    }
  }
  dependencies {
    classpath 'gradle.plugin.com.typelead:gradle-eta:0.8.1'
  }
}

Eta Base Plugin

apply plugin: 'eta-base'

Eta Plugin

apply plugin: 'eta'

Eta Android Plugin

apply plugin: 'eta-android'

Building from Source

If you're interested in hacking on the plugin or trying out the latest version, you can install it from source.

Source Installation

git clone https://github.com/typelead/gradle-eta
cd gradle-eta
./gradlew pTML

Then, in your build.gradle you can add:

buildscript {
  repositories {
    mavenLocal()

    dependencies {
      classpath 'com.typelead:gradle-eta:latest.release'
    }
  }
}

Quick Start

Library

eta {
  version = '0.7.2b1'
  etlasVersion = '1.3.0.0'
}

Executable

apply plugin: 'application'

eta {
  version = '0.7.2b1'
  etlasVersion = '1.3.0.0'
}

Android Application

eta {
  version = '0.7.2b1'
  etlasVersion = '1.3.0.0'
}

See the examples and src/test/testData directories for more examples.

Configuration

You can use the top-level eta extension for some basic global configurations.

NOTE: The eta extension is only available in the root project! It will not be available in subprojects of a multi-module build because the configuration applies to all projects in the build.

Properties:

  • String version - Version of Eta to use. The corresponding will binary will automatically be downloaded.
  • String etaPath - Path to locally installed Eta binary.
  • boolean useSystemEta - If specified, attempts to resolve the eta binary on your system PATH.
  • String etlasVersion - Version of Etlas to use for this project. The Etlas binary will automatically be downloaded and installed from the Etlas repository.
  • String etlasRepo, defaults to standard Etlas repository. Generally, there is no reason to set this.
  • String etlasPath - Path to locally installed Etlas binary. It is recommended to use etlasRepo and etlasVersion instead, leaving this unconfigured. It will be dynamically set by Gradle if it was downloaded and installed.
  • boolean useSystemEtlas - If specified, attempts to resolve the etlas binary on your system PATH.

Dependencies

You can add Eta dependencies (from Hackage or elsewhere) as follows:

dependencies {
    compile eta('text:1.2.2.2')
}

The general format is eta([package-name]:[version-or-version-range]).

Ivy version range notation is supported.

Tasks

The Eta Gradle Plugin adds the following tasks:

Root Project Tasks

  • :setupEnvironmentEta - This task is attached to the root project and installs the necessary eta and etlas executables for your platform or uses the provided executables in the configuration.
  • :resolveDependenciesEta - This task is attached to the root project and makes sure all the projects in the build use a consistent set of Eta dependencies.

Per-Project, Per-SourceSet Tasks

  • installDependencies<SourceSet>Eta - This task installs the Eta dependencies into the Etlas global cache and injects the paths to all the dependency jars into the corresponding Gradle configurations. This task is incremental and will only do work on the first run and every time the dependencies change.
  • compile<SourceSet>Eta - This task performs incremental compilation of the corresponding source set. This task depends on compile<SourceSet>Java and will have the output of that task in its classpath.
  • injectDependencies<SourceSet>Eta - This task injects Eta dependencies into non-Eta projects when non-Eta projects depend on Eta projects. This task is an implementation detail and you don't have to worry about it.

For the main source set, the tasks are installDependenciesEta and compileEta.

Conditional Tasks

If the application plugin is enabled as well, the run task will run the main function defined in src/main/eta/Main.hs.

Standard Tasks

The standard Gradle tasks like build, assemble, so on will work as expected and will trigger compilation of the required Eta source sets.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap