Skip to content

Commit

Permalink
Doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Krystian Panek committed Oct 5, 2020
1 parent 82fc289 commit 3be4642
Showing 1 changed file with 23 additions and 35 deletions.
58 changes: 23 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,41 @@

# Gradle HTL Plugin

This plugin is Gradle port of existing [Apache Sling HTL Maven Plugin](https://github.com/apache/sling-htl-maven-plugin).

It is simple Gradle Plugin for eager AEM [HTML Template Language](https://docs.adobe.com/content/help/en/experience-manager-htl/using/overview.html) (HTL) files validation. Usually, HTL files get compiled when component is rendered on AEM. If it contain any errors, those won't be spotted during deployment. This plugin performs HTL files compilation just before deployment to prevent introducing unintended bugs.
Gradle equivalent to [Apache Sling HTL Maven Plugin](https://github.com/apache/sling-htl-maven-plugin).

# Compatibility
This plugin has been tested with Gradle versions (5.0.0+).

# Usage
Tested with Gradle 6.0.0 and above.

Plugin setup `buildSrc/build.gradle.kts`:
# Setup

```kotlin
repositories {
maven { url = uri("http://dl.bintray.com/cognifide/maven-public") }
}
Plugin is released in Gradle Plugin Portal. See notes from [there](https://plugins.gradle.org/plugin/com.cognifide.htl).

dependencies {
implementation("com.cognifide.gradle:htl-plugin:0.0.1")
}
```
## Usage

Apply plugin in your `build.gradle.kts` script:
```kotlin
plugins {
id("com.cognifide.gradle.htl")
}

plugins.apply("com.cognifide.gradle.htl")
```

## Running

To run plugin simply type `gradlew htlValidate` in commandline.
Simply run the task `gradlew htlValidate`.

# Configuration

You can configure few things:
1. Directory where your HTL files are stored (to avoid redundant scanning)
2. List of supported extensions (files recognized as HTL templates)
3. Decide if plugin will fail when warning is present. By default it fails only on errors.

Sample configuration (shown values are plugin defaults):

```kotlin
htlValidation {
directory("src/main/content/jcr_root/")
extensions("**/*.html", "**/*.htl")
failOnWarnings()
htl {
sourceDir("src/main/content/jcr_root")
sourceFilter {
include("**/*.html", "**/*.htl")
exclude("**/some-subdir/*")
}
}

tasks {
htlValidate {
/*
failOnWarnings() // or via property: htl.validator.failOnWarnings=true
printIssues() // or via property: htl.validator.printIssues=true
enabled = false // or via property: htl.validator.enabled=false
*/
}
}
```

Expand Down

0 comments on commit 3be4642

Please sign in to comment.