File tree Expand file tree Collapse file tree 2 files changed +44
-3
lines changed
src/main/java/com/google/googlejavaformat/java Expand file tree Collapse file tree 2 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 191191 </execution >
192192 </executions >
193193 </plugin >
194+ <plugin >
195+ <groupId >com.google.code.maven-replacer-plugin</groupId >
196+ <artifactId >replacer</artifactId >
197+ <version >1.5.3</version >
198+ <executions >
199+ <execution >
200+ <phase >generate-sources</phase >
201+ <goals >
202+ <goal >replace</goal >
203+ </goals >
204+ </execution >
205+ </executions >
206+ <configuration >
207+ <file >core/src/main/java/com/google/googlejavaformat/java/GoogleJavaFormatVersion.java.template</file >
208+ <outputFile >${project.build.directory} /generated-sources/java/com/google/googlejavaformat/java/GoogleJavaFormatVersion.java</outputFile >
209+ <replacements >
210+ <replacement >
211+ <token >%VERSION%</token >
212+ <value >${project.version} </value >
213+ </replacement >
214+ </replacements >
215+ </configuration >
216+ </plugin >
217+ <plugin >
218+ <groupId >org.codehaus.mojo</groupId >
219+ <artifactId >build-helper-maven-plugin</artifactId >
220+ <version >3.0.0</version >
221+ <executions >
222+ <execution >
223+ <id >add-source</id >
224+ <phase >generate-sources</phase >
225+ <goals >
226+ <goal >add-source</goal >
227+ </goals >
228+ <configuration >
229+ <sources >
230+ <source >${project.build.directory} /generated-sources/java/</source >
231+ </sources >
232+ </configuration >
233+ </execution >
234+ </executions >
235+ </plugin >
194236 </plugins >
195237 </build >
196238</project >
Original file line number Diff line number Diff line change 1818
1919class GoogleJavaFormatVersion {
2020
21- static Object version () {
22- return Optional .ofNullable (Main .class .getPackage ().getImplementationVersion ())
23- .orElse ("unknown" );
21+ static String version() {
22+ return "%VERSION%";
2423 }
2524}
You can’t perform that action at this time.
0 commit comments