Skip to content

Commit 2b1ab14

Browse files
author
sjaakd
committed
initial commit
0 parents  commit 2b1ab14

File tree

5 files changed

+251
-0
lines changed

5 files changed

+251
-0
lines changed

.gitattributes

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Repository specific GIT options
2+
3+
# Set default handling of line endings
4+
* text=auto
5+
6+
# Explicitly declare text files we want to always be normalized and converted
7+
# to native line endings on checkout.
8+
*.java text
9+
*.xml text
10+
*.txt text
11+
*.md text
12+
13+
# Java-friendly readable chunk headers
14+
15+
*.java diff=java

.gitignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Eclipse
2+
.metadata
3+
.recommenders
4+
.classpath
5+
.project
6+
.settings
7+
.factorypath
8+
.checkstyle
9+
.externalToolBuilders
10+
11+
# IntelliJ
12+
*.iml
13+
*.ipr
14+
*.iws
15+
.idea
16+
17+
# Netbeans
18+
nb-configuration.xml
19+
20+
# Build
21+
/**/target/
22+
test-output
23+
24+
# Misc.
25+
.DS_Store

pom.xml

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright MapStruct Authors.
4+
Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
5+
-->
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
7+
<modelVersion>4.0.0</modelVersion>
8+
9+
<groupId>org.aptintegration.tools</groupId>
10+
<artifactId>ast-modifying-spi</artifactId>
11+
<version>1.0.0-SNAPSHOT</version>
12+
<packaging>jar</packaging>
13+
<name>Abstract Syntax Tree Modifying SPI</name>
14+
<description>Integration tooling for annotation processors.</description>
15+
<url>http://mapstruct.org/</url>
16+
<inceptionYear>2018</inceptionYear>
17+
18+
<properties>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
<org.apache.maven.plugins.javadoc.version>3.0.0-M1</org.apache.maven.plugins.javadoc.version>
21+
<add.release.arguments />
22+
</properties>
23+
<licenses>
24+
<license>
25+
<name>The Apache Software License, Version 2.0</name>
26+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
27+
<distribution>repo</distribution>
28+
</license>
29+
</licenses>
30+
31+
<scm>
32+
<connection>scm:git:git://github.com/mapstruct/ast-modifying-spi.git</connection>
33+
<developerConnection>scm:git:[email protected]:mapstruct/ast-modifying-spi.git</developerConnection>
34+
<url>https://github.com/mapstruct/ast-modifying-spi/</url>
35+
<tag>HEAD</tag>
36+
</scm>
37+
38+
<distributionManagement>
39+
<repository>
40+
<id>sonatype-nexus-staging</id>
41+
<name>Nexus Release Repository</name>
42+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
43+
</repository>
44+
<snapshotRepository>
45+
<id>sonatype-nexus-snapshots</id>
46+
<name>Sonatype Nexus Snapshots</name>
47+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
48+
</snapshotRepository>
49+
</distributionManagement>
50+
51+
<issueManagement>
52+
<system>GitHub Issues</system>
53+
<url>https://github.com/mapstruct/ast-modifying-spi/issues</url>
54+
</issueManagement>
55+
56+
<ciManagement>
57+
<system>Travis CI</system>
58+
<url>https://travis-ci.org/mapstruct/ast-modifying-spi</url>
59+
</ciManagement>
60+
61+
<mailingLists>
62+
<mailingList>
63+
<name>mapstruct-users</name>
64+
<archive>https://groups.google.com/forum/?fromgroups#!forum/mapstruct-users</archive>
65+
</mailingList>
66+
</mailingLists>
67+
68+
<prerequisites>
69+
<maven>3.0.3</maven>
70+
</prerequisites>
71+
72+
<build>
73+
<plugins>
74+
<plugin>
75+
<groupId>org.apache.maven.plugins</groupId>
76+
<artifactId>maven-checkstyle-plugin</artifactId>
77+
<executions>
78+
<execution>
79+
<id>check-style</id>
80+
<phase>verify</phase>
81+
<goals>
82+
<goal>checkstyle</goal>
83+
</goals>
84+
</execution>
85+
</executions>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-clean-plugin</artifactId>
90+
<version>2.5</version>
91+
</plugin>
92+
<plugin>
93+
<groupId>org.apache.maven.plugins</groupId>
94+
<artifactId>maven-compiler-plugin</artifactId>
95+
<version>3.3</version>
96+
<configuration>
97+
<source>1.6</source>
98+
<target>1.6</target>
99+
<compilerArgument>-proc:none</compilerArgument>
100+
</configuration>
101+
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-dependency-plugin</artifactId>
105+
<version>2.8</version>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.apache.maven.plugins</groupId>
109+
<artifactId>maven-deploy-plugin</artifactId>
110+
<version>2.8.2</version>
111+
<configuration>
112+
<deployAtEnd>true</deployAtEnd>
113+
</configuration>
114+
</plugin>
115+
<plugin>
116+
<groupId>org.apache.felix</groupId>
117+
<artifactId>maven-bundle-plugin</artifactId>
118+
<version>3.0.1</version>
119+
<executions>
120+
<execution>
121+
<id>bundle-manifest</id>
122+
<phase>process-classes</phase>
123+
<goals>
124+
<goal>manifest</goal>
125+
</goals>
126+
</execution>
127+
</executions>
128+
</plugin>
129+
<plugin>
130+
<groupId>org.apache.maven.plugins</groupId>
131+
<artifactId>maven-install-plugin</artifactId>
132+
<version>2.5.2</version>
133+
</plugin>
134+
<plugin>
135+
<groupId>org.apache.maven.plugins</groupId>
136+
<artifactId>maven-jar-plugin</artifactId>
137+
<version>3.0.2</version>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-javadoc-plugin</artifactId>
142+
<version>${org.apache.maven.plugins.javadoc.version}</version>
143+
<configuration>
144+
<quiet>true</quiet>
145+
</configuration>
146+
</plugin>
147+
<plugin>
148+
<groupId>org.apache.maven.plugins</groupId>
149+
<artifactId>maven-release-plugin</artifactId>
150+
<version>2.5.3</version>
151+
<configuration>
152+
<arguments>-DskipTests ${add.release.arguments}</arguments>
153+
<preparationGoals>clean install</preparationGoals>
154+
<pushChanges>false</pushChanges>
155+
<localCheckout>true</localCheckout>
156+
<tagNameFormat>@{project.version}</tagNameFormat>
157+
<autoVersionSubmodules>true</autoVersionSubmodules>
158+
<useReleaseProfile>false</useReleaseProfile>
159+
<releaseProfiles>release</releaseProfiles>
160+
</configuration>
161+
</plugin>
162+
</plugins>
163+
</build>
164+
</project>

readme.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**Integration tooling for annotation processors.**
2+
3+
4+
A contract to be implemented by other annotation processors which - against the design philosophy of JSR 269 - alter
5+
the types under compilation.
6+
7+
This contract will be queried by MapStruct when examining types referenced by mappers to be generated, most notably
8+
the source and target types of mapping methods. If at least one AST-modifying processor announces further changes to
9+
such type, the generation of the affected mapper(s) will be deferred to a future round in the annnotation processing
10+
cycle.
11+
12+
Implementations are discovered via the service loader, i.e. a JAR providing an AST-modifying processor needs to
13+
declare its implementation in a file {@code META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor}.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright MapStruct Authors.
3+
*
4+
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
5+
*/
6+
package org.aptintegration.tools.spi;
7+
8+
import javax.lang.model.type.TypeMirror;
9+
/**
10+
* A contract to be implemented by other annotation processors which - against the design philosophy of JSR 269 - alter
11+
* the types under compilation.
12+
* <p>
13+
* This contract will be queried by MapStruct when examining types referenced by mappers to be generated, most notably
14+
* the source and target types of mapping methods. If at least one AST-modifying processor announces further changes to
15+
* such type, the generation of the affected mapper(s) will be deferred to a future round in the annnotation processing
16+
* cycle.
17+
* <p>
18+
* Implementations are discovered via the service loader, i.e. a JAR providing an AST-modifying processor needs to
19+
* declare its implementation in a file {@code META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor}.
20+
*
21+
* @author Gunnar Morling
22+
*/
23+
public interface AstModifyingAnnotationProcessor {
24+
25+
/**
26+
* Whether the specified type has been fully processed by this processor or not (i.e. this processor will amend the
27+
* given type's structure after this invocation).
28+
*
29+
* @param type The type of interest
30+
* @return {@code true} if this processor has fully processed the given type (or has no interest in processing this
31+
* type altogether), {@code false} otherwise.
32+
*/
33+
boolean isTypeComplete(TypeMirror type);
34+
}

0 commit comments

Comments
 (0)