Skip to content

smac89/aspectj-gradle

 
 

Repository files navigation

Gradle AspectJ plugin

Linux/OSX

Build Status

Windows

Build status

Usage

See https://plugins.gradle.org/plugin/com.github.smac89.aspectj

Requirements

  • Gradle 4+

Configurations

Use the aspectpath testAspectpath configurations to specify external aspects or external code to weave

dependencies {
    aspectpath "org.springframework:spring-aspects:${springVersion}"
}

gradle.properties

aspectjVersion = '1.8.13'

NOTE: This plugin is rule based and as such follows the rule based model structure. See the example project for an example configuration.

By default, the following options are set in the aspectj rule:

fork         : true,
maxmem       : '1024m',
proc         : 'none',
Xlint        : 'ignore',
showWeaveInfo: true,
verbose      : false,
log          : 'iajc.log',
source       : <project_default>,
target       : <project_default>,
encoding     : 'utf-8',
outxml       : true,

These options can either be configured in the aspectj rule or individually for the compileAspect and compileTestAspect tasks and these will take precedence over the default ones, for that task

model {
    tasks {
        compileAspect {
            additionalAjcArgs {
                xlint = 'warning'
                maxmem = '1024m'
            }
        }
    }
}