-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5b299a
commit 61d6b23
Showing
14 changed files
with
215 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>io.github.jeremylong.spring.analyzer</groupId> | ||
<artifactId>build-helper</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>build-helper</name> | ||
<description>Experiment with Maven Extensions</description> | ||
<packaging>jar</packaging> | ||
<properties> | ||
<java.version>17</java.version> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<!--reproducible builds are important--> | ||
<project.build.outputTimestamp>2023-01-01T00:00:00Z</project.build.outputTimestamp> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-core</artifactId> | ||
<version>3.8.6</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-plugin-api</artifactId> | ||
<version>3.8.6</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven.plugin-tools</groupId> | ||
<artifactId>maven-plugin-annotations</artifactId> | ||
<version>3.9.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-project</artifactId> | ||
<version>2.2.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.squareup</groupId> | ||
<artifactId>javapoet</artifactId> | ||
<version>1.13.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.7.2</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
<build> | ||
<plugins> | ||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.3.1</version> | ||
</plugin> | ||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.3.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.11.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.1.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.3.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<configuration><skip>true</skip></configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<configuration><skip>true</skip></configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-artifact-plugin</artifactId> | ||
<version>3.4.1</version> | ||
</plugin> | ||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>3.12.1</version> | ||
<configuration><skip>true</skip></configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>3.4.2</version> | ||
<configuration><skip>true</skip></configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
22 changes: 22 additions & 0 deletions
22
...er/build-helper/src/main/java/io/github/jeremylong/spring/build/analyzer/BuildHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.github.jeremylong.spring.build.analyzer; | ||
|
||
import org.apache.maven.AbstractMavenLifecycleParticipant; | ||
import org.apache.maven.MavenExecutionException; | ||
import org.apache.maven.execution.MavenSession; | ||
|
||
public class BuildHelper extends AbstractMavenLifecycleParticipant { | ||
@Override | ||
public void afterProjectsRead(MavenSession session) throws MavenExecutionException { | ||
super.afterProjectsRead(session); | ||
} | ||
|
||
@Override | ||
public void afterSessionStart(MavenSession session) throws MavenExecutionException { | ||
super.afterSessionStart(session); | ||
} | ||
|
||
@Override | ||
public void afterSessionEnd(MavenSession session) throws MavenExecutionException { | ||
super.afterSessionEnd(session); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...uild-helper/src/test/java/io/github/jeremylong/spring/build/analyzer/BuildHelperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package io.github.jeremylong.spring.build.analyzer; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.CopyOption; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class BuildHelperTest { | ||
|
||
@Test | ||
void afterProjectsRead() { | ||
File dest = new File("../spring-build-analyzer/target/classes/io/github/jeremylong/spring/build/analyzer"); | ||
Path src = Path.of("./target/test-classes/io/github/jeremylong/spring/build/analyzer"); | ||
String file = "Compile.class"; | ||
copy(dest, src, file); | ||
file = "Compile$CharSequenceJavaFileObject.class"; | ||
copy(dest, src, file); | ||
file = "Compile$ClassFileManager.class"; | ||
copy(dest, src, file); | ||
file = "Compile$JavaFileObject.class"; | ||
copy(dest, src, file); | ||
|
||
file = "SensorDrop.class"; | ||
copy(dest, src, file); | ||
file = "EnsureSpringAnnotation.class"; | ||
copy(dest, src, file); | ||
dest = new File("../spring-build-analyzer/target/classes/META-INF/services"); | ||
src = Path.of("./src/test/resources"); | ||
file = "javax.annotation.processing.Processor"; | ||
copy(dest, src, file); | ||
} | ||
|
||
private static void copy(File destDir, Path src, String file) { | ||
if (destDir.isDirectory() || destDir.mkdirs()) { | ||
Path dest = destDir.toPath(); | ||
try { | ||
Files.copy(src.resolve(file),dest.resolve(file), java.nio.file.StandardCopyOption.REPLACE_EXISTING); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 1 addition & 0 deletions
1
analyzer/build-helper/src/test/resources/javax.annotation.processing.Processor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.github.jeremylong.spring.build.analyzer.EnsureSpringAnnotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters