de.tobiasroeser.mill.aspectj_2.13

AspectJ compiler support for mill

License

License

Categories

Categories

AspectJ Development Tools Development Libraries
GroupId

GroupId

de.tototec
ArtifactId

ArtifactId

de.tobiasroeser.mill.aspectj_2.13
Last Version

Last Version

0.3.1-2-5c3be4
Release Date

Release Date

Type

Type

jar
Description

Description

de.tobiasroeser.mill.aspectj_2.13
AspectJ compiler support for mill
Project URL

Project URL

https://github.com/lefou/mill-aspectj
Source Code Management

Source Code Management

https://github.com/lefou/mill-aspectj

Download de.tobiasroeser.mill.aspectj_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/de.tototec/de.tobiasroeser.mill.aspectj_2.13/ -->
<dependency>
    <groupId>de.tototec</groupId>
    <artifactId>de.tobiasroeser.mill.aspectj_2.13</artifactId>
    <version>0.3.1-2-5c3be4</version>
</dependency>
// https://jarcasting.com/artifacts/de.tototec/de.tobiasroeser.mill.aspectj_2.13/
implementation 'de.tototec:de.tobiasroeser.mill.aspectj_2.13:0.3.1-2-5c3be4'
// https://jarcasting.com/artifacts/de.tototec/de.tobiasroeser.mill.aspectj_2.13/
implementation ("de.tototec:de.tobiasroeser.mill.aspectj_2.13:0.3.1-2-5c3be4")
'de.tototec:de.tobiasroeser.mill.aspectj_2.13:jar:0.3.1-2-5c3be4'
<dependency org="de.tototec" name="de.tobiasroeser.mill.aspectj_2.13" rev="0.3.1-2-5c3be4">
  <artifact name="de.tobiasroeser.mill.aspectj_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='de.tototec', module='de.tobiasroeser.mill.aspectj_2.13', version='0.3.1-2-5c3be4')
)
libraryDependencies += "de.tototec" % "de.tobiasroeser.mill.aspectj_2.13" % "0.3.1-2-5c3be4"
[de.tototec/de.tobiasroeser.mill.aspectj_2.13 "0.3.1-2-5c3be4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.2
de.tototec : de.tobiasroeser.mill.aspectj-api_2.13 jar 0.3.1-2-5c3be4

provided (2)

Group / Artifact Type Version
com.lihaoyi : mill-main_2.13 jar 0.7.0
com.lihaoyi : mill-scalalib_2.13 jar 0.7.0

Project Modules

There are no modules declared in this project.

mill-aspectj - AspectJ compiler support for mill

Quickstart

Mill version 0.6.0 or newer is required.

import mill._
import mill.scalalib._
import mill.define._

// Load the plugin from Maven Central via ivy/coursier
import $ivy.`de.tototec::de.tobiasroeser.mill.aspectj:0.3.1`, de.tobiasroeser.mill.aspectj._

object main extends AspectjModule {

  // Select the AspectJ version
  def aspectjVersion = T{ "1.9.5" }

  // Set AspectJ options, e.g. the language level and annotation processor
  // Run `mill main.ajcHelp` to get a list of supported options
  def ajcOptions = Seq("-8", "-proc:none")

}

Configuration

Your module needs to extend de.tobiasroeser.mill.aspectj.AspectjModule which itself extends mill.scalalib.JavaModule.

The module trait de.tobiasroeser.mill.aspectj.AspectjModule has the following configuration options (over those from mill.scalalib.JavaModule).

def aspectjVersion: T[String]

The AspectJ version. Required. For a list of available releases refer to the AspectJ Download Page.

def ivyDeps: T[Agg[Dep]]

The compile and runtime dependencies. Contains by default the aspectjrt.jar which is resolved via ivy (ivy"org.aspectj:aspectjrt:${aspectjVersion()}"). If you do do not use super.ivyDeps() when overriding this def, you need to provide the aspectjrt.jar manually.

def aspectjToolsDeps: T[Agg[Dep]]

The ivy dependencies representing the aspectj compiler classes, which is typically a aspectjtools.jar. Default to ivy"org.aspectj:aspectjtools:${aspectjVersion()}".

def aspectjToolsClasspath: T[Agg[PathRef]]

The aspectj compiler classpath. By default resolved from aspectjToolsDeps.

def ajcOptions: T[Seq[String]]

Additional options to be used by ajc in the compile target.

def aspectPath: T[Agg[PathRef]]

Additional classes, JARs or ZIPs to be used as aspect path (ajc -aspectpath). In most cases it is enough to use aspectModuleDeps and aspectIvyDeps.

def aspectModuleDeps: Seq[JavaModule]

List of modules to be used as aspect path (ajc -aspectpath).

def aspectIvyDeps: T[Agg[Dep]]

List of ivy dependencies to be used as aspect path (ajc -aspectpath).

def effectiveAspectPath: T[Seq[PathRef]]

Effective aspect path (ajc -inpath). In most cases, it is enough to use aspectModuleDeps and aspectIvyDeps.

def weavePath: T[Seq[PathRef]]

List of directories with .class files to weave (into target directory). Corresponds to ajc -inpath option.

def compile: T[CompilationResult]

Compiles the source code with the ajc compiler.

def ajcHelp: Command[Unit]

Shows the help of the AspectJ compiler (ajc -help).

Version Compatibility Matrix

Mill is still in active development, and has no stable API yet. Hence, not all mill-aspectj versions work with every mill version.

The following table shows a matrix of compatible mill and mill-aspectj versions.

Table 1. Version Compatibility Matrix
mill-aspectj mill

{main}

0.6.0 - 0.9.4

0.3.1

0.6.0 - 0.8.0

0.3.0

0.6.0 - 0.6.3

0.2.2

0.6.0 - 0.6.3

0.2.1

0.5.8 - 0.5.9

0.2.0

0.5.7

0.1.0

0.3.6 - 0.5.3

To ensure some basic compatibility, there are some integration tests in place. Newer mill versions may work as well.

If you need support for other versions, please create an issue.

Download

You can download binary releases from Maven Central.

Please make sure to use the correct mill platform suffix matching your used mill version.

Table 2. Mill Platform suffix
mill version mill platform suffix example

0.9.3 -

0.9

_mill0.9

$ivy.`de.tototec::de.tobiasroeser.mill.aspectj_mill0.9:0.3.1`

0.7.0 - 0.8.0

0.7

_mill0.7

$ivy.`de.tototec::de.tobiasroeser.mill.aspectj_mill0.7:0.3.1`

0.6.0 - 0.6.3

0.6

_mill0.6

$ivy.`de.tototec::de.tobiasroeser.mill.aspectj_mill0.6:0.3.1`

License

This project is published under the Apache License, Version 2.0.

Supporters

Thanks to iba Consulting Gesellschaft mbH & Co KG for the initial development support.

About

Mill

Mill is a Scala-based open source build tool. In my opinion the best build tool for the JVM. It is fast, reliable and easy to understand.

Me

I am Tobias Roeser, a professional software developer and love to do open source. I’m actively developing and maintaining mill as well as several mill plugins.

If you like my work, please star it on GitHub. You can also support me via GitHub Sponsors.

Contributing

If you found a bug or have a feature request, please open a new issue on GitHub. I also accept pull requests on GitHub.

You can also ask question and join our discussion at the GitHub Discussions board

Changelog

{main}

  • Support for newer mill APIs

mill-aspectj 0.3.1 - 2020-06-15

  • Support for mill API 0.7.x and Scala 2.13

  • Switch to GitHub Actions workflow and removed Travis CI setup

  • Enabled auto-deployment of tagged and snapshot releases to Maven Central

mill-aspectj 0.3.0 - 2020-03-04

  • Splitted out new api and worker package to access Aspectj Java API instead of reflection

  • Removed need to use a Java SecurityManager to trap System.exit() calls

  • Made concurrent runs of the compiler configurable

  • Fixed ajcHelp task

  • Support for Java 11 and others

mill-aspectj 0.2.2 - 2020-02-24

  • Version bump mill API to 0.6.0

mill-aspectj 0.2.1 - 2020-02-24

  • Version bump mill API to 0.5.8

mill-aspectj 0.2.0 - 2020-01-08

  • Share ajc compiler instance between module

  • Version bump mill API to 0.5.7

mill-aspectj 0.1.0 - 2019-08-30

  • Initial public release

Versions

Version
0.3.1-2-5c3be4
0.3.1-1-58c782
0.3.1
0.3.0-7-a8d224