-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from gsmet/prepare-new-extension-annotation-pr…
…ocessor Prepare the extension for the new extension annotation processor
- Loading branch information
Showing
15 changed files
with
285 additions
and
145 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/main/java/io/quarkus/develocity/project/GoalMetadataProvider.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,53 @@ | ||
package io.quarkus.develocity.project; | ||
|
||
import org.apache.maven.project.MavenProject; | ||
|
||
import com.gradle.develocity.agent.maven.api.cache.MojoMetadataProvider; | ||
import com.gradle.develocity.agent.maven.api.scan.BuildScanApi; | ||
|
||
import io.quarkus.develocity.project.util.MavenMojoExecutionConfig; | ||
import io.quarkus.develocity.project.util.MavenProperties; | ||
|
||
@FunctionalInterface | ||
public interface GoalMetadataProvider { | ||
|
||
void configure(Context context); | ||
|
||
class Context { | ||
private final BuildScanApi buildScanApi; | ||
private final MojoMetadataProvider.Context metadataContext; | ||
private final MavenProperties properties; | ||
private final MavenMojoExecutionConfig configuration; | ||
|
||
public Context(BuildScanApi buildScanApi, MojoMetadataProvider.Context metadataContext) { | ||
this.buildScanApi = buildScanApi; | ||
this.metadataContext = metadataContext; | ||
this.properties = new MavenProperties(metadataContext.getSession(), metadataContext.getMojoExecution()); | ||
this.configuration = new MavenMojoExecutionConfig(metadataContext.getMojoExecution()); | ||
} | ||
|
||
public BuildScanApi buildScan() { | ||
return buildScanApi; | ||
} | ||
|
||
public MojoMetadataProvider.Context metadata() { | ||
return metadataContext; | ||
} | ||
|
||
public MavenProject project() { | ||
return metadataContext.getProject(); | ||
} | ||
|
||
public MavenProperties properties() { | ||
return properties; | ||
} | ||
|
||
public MavenMojoExecutionConfig configuration() { | ||
return configuration; | ||
} | ||
|
||
public void buildScanDeduplicatedValue(String key, String value) { | ||
buildScanApi.executeOnce(key + value, ignored -> buildScanApi.value(key, value)); | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.