Skip to content

IntershopCommunicationsAG/resourcelist-gradle-plugin

Repository files navigation

ResourceList and Cartridge ResourceList Plugin

Note
Version 5.0.0 of this plugin will only work with Gradle 8.5 and JDK 17.

Summary

This resourcelist plugin generates, based on existing java source files and resources, a file with the listing of these resources. The cartridge-resourcelist plugin generates two specific files. This configuration is provided to the resourcelist plugin.

Usage Base-ResourceList Plugin

Groovy
build.gradle
plugins {
    id 'com.intershop.gradle.resourcelist' version '5.0.0'
}

resourcelist {
    lists {
        orm {
            sourceSetName = 'main'
            include '**/**/*.orm'
            resourceListFileName = "resources/\${project.name}/orm/orm.resource"
            fileExtension = 'orm'
        }
        pipelets {
            sourceSetName = 'main'
            include '**/pipelet/**/*.xml'
            exclude '**/*_??_??.xml'
            resourceListFileName = "resources/\${project.name}/pipeline/pipelets.resource"
            fileExtension = 'xml'
        }
    }
}
Kotlin
build.gradle.kts
plugins {
    id("com.intershop.gradle.resourcelist") version "5.0.0"
}

resourcelist {
    lists {
        register("orm") {
            sourceSetName = "main"
            include("**/**/*.orm")
            resourceListFileName = "resources/\${project.name}/orm/orm.resource"
            fileExtension = "orm"
        }
        register("pipelets") {
            sourceSetName = "main"
            include("**/pipelet/**/*.xml")
            exclude("**/*_??_??.xml")
            resourceListFileName = "resources/\${project.name}/pipeline/pipelets.resource"
            fileExtension = "xml"
        }
    }
}

The resource list task creates a list of classes, that match to the filter configuration.

Usage ResourceList Plugin

plugins {
    id 'com.intershop.gradle.cartridge-resourcelist' version '5.0.0'
}

The cartridge-resourcelist plugin adds two configurations for Intershop orm files and Intershop pipelet files.

Important
The JavaBasePlugin must be applied to the project for this plugin, otherwise the functionality is not available.

Tasks

The resourcelist plugins add a resource list task for each configuration. The resource process task depends on all resource list tasks of a project.

Task name

Type

Description

resourceList<configuration name>

com.intershop.gradle.resourcelist.task.ResourceListFileTask

This task generates resource list files from special java sources.

The cartridge resource list plugin provides two special tasks

Task name

Type

Description

resourceListOrm

com.intershop.gradle.resourcelist.task.ResourceListFileTask

This task generates resource list files for orm configurationes.

resourceListPipelets

com.intershop.gradle.resourcelist.task.ResourceListFileTask

This task generates resource list files for pipelets.

Project Extension 'resourcelist'

This plugin adds an extension resourcelist to the project.

Methods

Method

Type

Default value

Description

lists

ListsConfiguration

This contains all source list configurations.

Object 'lists' (ListsConfiguration)

Property Type Default value Description

fileExtension

String

Name of the list configuration

Extension of the analysed files

resourceListFileName

String

''

Path for the resource file.

outputDir

File

'generated/resourcelist/<configuration name>

Output directory for the generated code

sourceSetName

String

'main'

Source set name with analysed sources.

excludes

List<String>

[]

List of exclude filters of this configuration.

includes

List<String>

[]

List of includes filters of this configuration.

Methods

Method Values Description

exclude

String

Add exclude filter to excludes list

include

String

Add include filter to excludes list

License

Copyright 2014-2018 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.