Skip to content

Commit 0c488d7

Browse files
committed
Create an auto-value-annotations artifact separate from the processor
Fixes #268 I followed the instructions in https://maven.apache.org/guides/mini/guide-using-one-source-directory.html because it seemed like the easiest way forward without moving around any files. RELNOTES=`@AutoValue`, `@AutoAnnotation`, `@AutoOneOf`, and `@Memoized` are now in a separate artifact, `auto-value-annotations`. This allows users to specify the annotations in compile scope and the processor in an annotation processing scope, without leaking the processor to a release binary. To upgrade to this version of auto-value, you'll need to add this new artifact as a dependency. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=188505001
1 parent 73e8eff commit 0c488d7

File tree

6 files changed

+281
-114
lines changed

6 files changed

+281
-114
lines changed

value/annotations/pom.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (C) 2012 Google, Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>com.google.auto</groupId>
23+
<artifactId>auto-parent</artifactId>
24+
<version>6</version>
25+
</parent>
26+
27+
<groupId>com.google.auto.value</groupId>
28+
<artifactId>auto-value-annotations</artifactId>
29+
<version>HEAD-SNAPSHOT</version>
30+
<name>AutoValue Annotations</name>
31+
<description>
32+
Immutable value-type code generation for Java 1.6+.
33+
</description>
34+
35+
<scm>
36+
<url>http://github.com/google/auto</url>
37+
<connection>scm:git:git://github.com/google/auto.git</connection>
38+
<developerConnection>scm:git:ssh://[email protected]/google/auto.git</developerConnection>
39+
<tag>HEAD</tag>
40+
</scm>
41+
<build>
42+
<sourceDirectory>../src/main/java</sourceDirectory>
43+
<plugins>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-compiler-plugin</artifactId>
47+
<configuration>
48+
<includes>
49+
<include>com/google/auto/value/*</include>
50+
<include>com/google/auto/value/extension/memoized/*</include>
51+
</includes>
52+
</configuration>
53+
</plugin>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-jar-plugin</artifactId>
57+
</plugin>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-invoker-plugin</artifactId>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
<profiles>
65+
<profile>
66+
<id>disable-java8-doclint</id>
67+
<activation>
68+
<jdk>[1.8,)</jdk>
69+
</activation>
70+
<properties>
71+
<additionalparam>-Xdoclint:none</additionalparam>
72+
</properties>
73+
</profile>
74+
</profiles>
75+
</project>

value/pom.xml

Lines changed: 7 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
</parent>
2626

2727
<groupId>com.google.auto.value</groupId>
28-
<artifactId>auto-value</artifactId>
28+
<artifactId>auto-value-pom-aggregator</artifactId>
2929
<version>HEAD-SNAPSHOT</version>
3030
<name>AutoValue</name>
3131
<description>
3232
Immutable value-type code generation for Java 1.6+.
3333
</description>
34+
<packaging>pom</packaging>
3435

3536
<scm>
3637
<url>http://github.com/google/auto</url>
@@ -39,123 +40,18 @@
3940
<tag>HEAD</tag>
4041
</scm>
4142

42-
<dependencies>
43-
<dependency>
44-
<groupId>com.google.auto</groupId>
45-
<artifactId>auto-common</artifactId>
46-
<version>0.10</version>
47-
</dependency>
48-
<dependency>
49-
<groupId>com.google.auto.service</groupId>
50-
<artifactId>auto-service</artifactId>
51-
<version>1.0-rc4</version>
52-
</dependency>
53-
<dependency>
54-
<groupId>com.google.guava</groupId>
55-
<artifactId>guava</artifactId>
56-
</dependency>
57-
<dependency>
58-
<groupId>com.squareup</groupId>
59-
<artifactId>javapoet</artifactId>
60-
</dependency>
61-
<!-- test dependencies -->
62-
<dependency>
63-
<groupId>org.apache.velocity</groupId>
64-
<artifactId>velocity</artifactId>
65-
<scope>test</scope>
66-
</dependency>
67-
<dependency>
68-
<groupId>com.google.guava</groupId>
69-
<artifactId>guava-testlib</artifactId>
70-
<scope>test</scope>
71-
</dependency>
72-
<dependency>
73-
<groupId>junit</groupId>
74-
<artifactId>junit</artifactId>
75-
<scope>test</scope>
76-
</dependency>
77-
<dependency>
78-
<groupId>com.google.truth</groupId>
79-
<artifactId>truth</artifactId>
80-
<scope>test</scope>
81-
</dependency>
82-
<dependency>
83-
<groupId>com.google.testing.compile</groupId>
84-
<artifactId>compile-testing</artifactId>
85-
<scope>test</scope>
86-
</dependency>
87-
</dependencies>
43+
<modules>
44+
<module>annotations</module>
45+
<module>processor</module>
46+
</modules>
8847

8948
<build>
90-
<resources>
91-
<resource>
92-
<directory>src/main/java</directory>
93-
<includes>
94-
<include>**/*.vm</include>
95-
</includes>
96-
</resource>
97-
</resources>
9849
<plugins>
9950
<plugin>
100-
<groupId>org.apache.maven.plugins</groupId>
101-
<artifactId>maven-compiler-plugin</artifactId>
102-
</plugin>
103-
<plugin>
104-
<groupId>org.apache.maven.plugins</groupId>
105-
<artifactId>maven-jar-plugin</artifactId>
106-
</plugin>
107-
<plugin>
51+
<!-- Used to run the functional tests -->
10852
<groupId>org.apache.maven.plugins</groupId>
10953
<artifactId>maven-invoker-plugin</artifactId>
11054
</plugin>
111-
<plugin>
112-
<groupId>org.immutables.tools</groupId>
113-
<artifactId>maven-shade-plugin</artifactId>
114-
<executions>
115-
<execution>
116-
<phase>package</phase>
117-
<goals>
118-
<goal>shade</goal>
119-
</goals>
120-
<configuration>
121-
<minimizeJar>true</minimizeJar>
122-
<artifactSet>
123-
<excludes>
124-
<exclude>com.google.code.findbugs:jsr305</exclude>
125-
</excludes>
126-
</artifactSet>
127-
<relocations>
128-
<relocation>
129-
<pattern>org.objectweb</pattern>
130-
<shadedPattern>autovalue.shaded.org.objectweb$</shadedPattern>
131-
</relocation>
132-
<relocation>
133-
<pattern>com.google</pattern>
134-
<shadedPattern>autovalue.shaded.com.google$</shadedPattern>
135-
<excludes>
136-
<exclude>com.google.auto.value.**</exclude>
137-
</excludes>
138-
</relocation>
139-
<relocation>
140-
<pattern>com.squareup.javapoet</pattern>
141-
<shadedPattern>autovalue.shaded.com.squareup.javapoet$</shadedPattern>
142-
</relocation>
143-
</relocations>
144-
</configuration>
145-
</execution>
146-
</executions>
147-
</plugin>
14855
</plugins>
14956
</build>
150-
<profiles>
151-
<profile>
152-
<id>disable-java8-doclint</id>
153-
<activation>
154-
<jdk>[1.8,)</jdk>
155-
</activation>
156-
<properties>
157-
<additionalparam>-Xdoclint:none</additionalparam>
158-
</properties>
159-
</profile>
160-
</profiles>
16157
</project>

value/processor/pom.xml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (C) 2012 Google, Inc.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>com.google.auto</groupId>
23+
<artifactId>auto-parent</artifactId>
24+
<version>6</version>
25+
</parent>
26+
27+
<groupId>com.google.auto.value</groupId>
28+
<artifactId>auto-value</artifactId>
29+
<version>HEAD-SNAPSHOT</version>
30+
<name>AutoValue Processor</name>
31+
<description>
32+
Immutable value-type code generation for Java 1.6+.
33+
</description>
34+
35+
<scm>
36+
<url>http://github.com/google/auto</url>
37+
<connection>scm:git:git://github.com/google/auto.git</connection>
38+
<developerConnection>scm:git:ssh://[email protected]/google/auto.git</developerConnection>
39+
<tag>HEAD</tag>
40+
</scm>
41+
42+
<dependencies>
43+
<dependency>
44+
<groupId>com.google.auto</groupId>
45+
<artifactId>auto-common</artifactId>
46+
<version>0.10</version>
47+
</dependency>
48+
<dependency>
49+
<groupId>com.google.auto.service</groupId>
50+
<artifactId>auto-service</artifactId>
51+
<version>1.0-rc4</version>
52+
</dependency>
53+
<dependency>
54+
<groupId>com.google.guava</groupId>
55+
<artifactId>guava</artifactId>
56+
</dependency>
57+
<dependency>
58+
<groupId>com.squareup</groupId>
59+
<artifactId>javapoet</artifactId>
60+
</dependency>
61+
<!-- test dependencies -->
62+
<dependency>
63+
<groupId>com.google.auto.value</groupId>
64+
<artifactId>auto-value-annotations</artifactId>
65+
<version>${project.version}</version>
66+
<scope>test</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.apache.velocity</groupId>
70+
<artifactId>velocity</artifactId>
71+
<scope>test</scope>
72+
</dependency>
73+
<dependency>
74+
<groupId>com.google.guava</groupId>
75+
<artifactId>guava-testlib</artifactId>
76+
<scope>test</scope>
77+
</dependency>
78+
<dependency>
79+
<groupId>junit</groupId>
80+
<artifactId>junit</artifactId>
81+
<scope>test</scope>
82+
</dependency>
83+
<dependency>
84+
<groupId>com.google.truth</groupId>
85+
<artifactId>truth</artifactId>
86+
<scope>test</scope>
87+
</dependency>
88+
<dependency>
89+
<groupId>com.google.testing.compile</groupId>
90+
<artifactId>compile-testing</artifactId>
91+
<scope>test</scope>
92+
</dependency>
93+
</dependencies>
94+
95+
<build>
96+
<sourceDirectory>../src/main/java</sourceDirectory>
97+
<testSourceDirectory>../src/test/java</testSourceDirectory>
98+
99+
<resources>
100+
<resource>
101+
<directory>../src/main/java</directory>
102+
<includes>
103+
<include>**/*.vm</include>
104+
</includes>
105+
</resource>
106+
</resources>
107+
<plugins>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-compiler-plugin</artifactId>
111+
<configuration>
112+
<includes>
113+
<include>com/google/auto/value/processor/**/*.java</include>
114+
<include>com/google/auto/value/extension/memoized/processor/**/*.java</include>
115+
</includes>
116+
</configuration>
117+
</plugin>
118+
<plugin>
119+
<groupId>org.apache.maven.plugins</groupId>
120+
<artifactId>maven-jar-plugin</artifactId>
121+
</plugin>
122+
<plugin>
123+
<groupId>org.apache.maven.plugins</groupId>
124+
<artifactId>maven-invoker-plugin</artifactId>
125+
</plugin>
126+
<plugin>
127+
<groupId>org.immutables.tools</groupId>
128+
<artifactId>maven-shade-plugin</artifactId>
129+
<executions>
130+
<execution>
131+
<phase>package</phase>
132+
<goals>
133+
<goal>shade</goal>
134+
</goals>
135+
<configuration>
136+
<minimizeJar>true</minimizeJar>
137+
<artifactSet>
138+
<excludes>
139+
<exclude>com.google.code.findbugs:jsr305</exclude>
140+
</excludes>
141+
</artifactSet>
142+
<relocations>
143+
<relocation>
144+
<pattern>org.objectweb</pattern>
145+
<shadedPattern>autovalue.shaded.org.objectweb$</shadedPattern>
146+
</relocation>
147+
<relocation>
148+
<pattern>com.google</pattern>
149+
<shadedPattern>autovalue.shaded.com.google$</shadedPattern>
150+
<excludes>
151+
<exclude>com.google.auto.value.**</exclude>
152+
</excludes>
153+
</relocation>
154+
<relocation>
155+
<pattern>com.squareup.javapoet</pattern>
156+
<shadedPattern>autovalue.shaded.com.squareup.javapoet$</shadedPattern>
157+
</relocation>
158+
</relocations>
159+
</configuration>
160+
</execution>
161+
</executions>
162+
</plugin>
163+
</plugins>
164+
</build>
165+
<profiles>
166+
<profile>
167+
<id>disable-java8-doclint</id>
168+
<activation>
169+
<jdk>[1.8,)</jdk>
170+
</activation>
171+
<properties>
172+
<additionalparam>-Xdoclint:none</additionalparam>
173+
</properties>
174+
</profile>
175+
</profiles>
176+
</project>

0 commit comments

Comments
 (0)