Skip to content

IntershopCommunicationsAG/isml-gradle-plugin

Repository files navigation

ISML Gradle Plugins

Note
Version 4 of this plugin will only work with JDK 8, Gradle 6 and an Intershop Commerce Management newer than 7.10.

Summary

This package provides two plugins - one plugin for the ISML tag lib support and one for the compilation of ISML files. These plugins compile ISML files of Intershop to Java class files. It generates also JSP and Java files from ISML files. All files of the output have the same time stamp.

Usage

To apply the ISML Gradle Plugins to your projects, add the following in your build script:

Groovy
build.gradle
plugins {
    // only necessary to use additonal TagLibs
    id 'com.intershop.gradle.ismltaglib' version '4.0.0'
    // necessary for the compilation of ISML files
    id 'com.intershop.gradle.isml' version '4.0.0'
}
Kotlin
build.gradle.kts
plugins {
    // only necessary to use additonal TagLibs
    id("com.intershop.gradle.ismltaglib") version "4.0.0"
    // necessary for the compilation of ISML files
    id("com.intershop.gradle.isml") version "4.0.0"
}

The compiler plugin will create a default configuration for ISML templates of an Intershop project. The plugin uses the project dependencies for the ISML task and the compilation of the files.

Tasks

The ISML Gradle plugin adds one task isml to the project. This task depends on all ISML plugin tasks 'isml2class*'.

Task name

Type

Description

isml

Task

Overall isml code generation task of a project. This task depends on all isml2class tasks.

isml2class<source set name>

com.intershop.gradle.isml.tasks.IsmlCompile

This task compiles ISML files to class files.

It is possible to configure the list of include or exclude files for TLD scanner on the isml2class. The property names are ‘tldScanIncludes’, ‘tldScanExcludes’. If ‘tldScanIncludes’ will be extended with all files from project dependencies. The list ‘tldScanIncludes’ is used only if the list is not empty. The file names (only the name without path) will be checked with the entries from the list for the beginning of the name.

Project Extension 'isml'

This plugin adds an extension isml to the project.

Properties

Property

Type

Default value

Description

jspCompilerVersion

String

'9.0.19'

The version of JSP compiler.

eclipseCompilerVersion

String

'4.6.1'

The version of Eclipse Java compiler. This version depends on the JSP compiler. Please check the used Tomcat version.

encoding

String

'UTF-8'

Template encoding. This is also used for JSP and Java compilation.

sourceSetName

String

'main'

Name of the Java source set, which can be used for ISML compilation.

ismlConfigurationName

String

'runtime'

Name of the configuration, which is used for the classpath of ISML compilation.

sourceCompatibility

String

'1.6'

This Java source compatibility is used for the compilation of java files.

targetCompatibility

String

'1.6'

This Java target compatibility is used for the compilation of java files.

taglibFolder

File

null

Folder with WEB-INF and TagLib configuration files.

enableTldScan

boolean

false

TldScan of the Jsp Compiler will be enabled if this property set to true.
This must be configured if you use TagLibs!

Methods

Method Values Description

sourceSets

IsmlSourceSet

This contains all folders with ISML templates.

Object 'sourceSet' (IsmlSourceSet)

Properties

Property

Type

Default value

Description

name

String

'main'

The name of the ISML source set

srcDir

File

'<project dir>/staticfiles/cartridge/templates'

The input directory of the task.

outputDir

File

'<project builddir>/generated/isml/main'

The output directory of the compiler task.

jspPackage

String

'ish.cartridges.<project name>

The package name of the compiled JSP files.

taskName

String

'isml2classMain'

The task name.

Example Configurations

Simple configuration

plugins {
    id 'com.intershop.gradle.ismltaglib' version '4.0.0'
    id 'com.intershop.gradle.isml' version '4.0.0'
}

isml {
    // necessary for "'com.intershop.gradle.ismltaglib'"
    enableTldScan = true
}

configurations {
    implementation
    runtime.extendsFrom(implementation)
}

dependencies {
    implementation "com.intershop.platform:core:<ICM platform version>"
    implementation "com.intershop.platform:isml:<ICM platform version>"
    ...
}

Contribute

See here for details.

License

Copyright 2014-2019 Intershop Communications.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.