Skip to content

Commit cd9961a

Browse files
authored
Merge pull request #33 from AkaZver/feature/fix-protobuf-config
Fix protobuf-spi-impl configuration
2 parents 7e4b36f + 3cf25c5 commit cd9961a

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The plugin automatically:
5757
| | [apache/camel-spring-boot](https://github.com/apache/camel-spring-boot) | [org.apache.camel.springboot/camel-mapstruct-starter](https://mvnrepository.com/artifact/org.apache.camel.springboot/camel-mapstruct-starter) | `implementation` |
5858
| | [apache/camel-quarkus](https://github.com/apache/camel-quarkus) | [org.apache.camel.quarkus/camel-quarkus-mapstruct](https://mvnrepository.com/artifact/org.apache.camel.quarkus/camel-quarkus-mapstruct) | `implementation` |
5959
| **Quarkus** | [quarkiverse/quarkus-mapstruct](https://github.com/quarkiverse/quarkus-mapstruct) | [io.quarkiverse.mapstruct/quarkus-mapstruct](https://mvnrepository.com/artifact/io.quarkiverse.mapstruct/quarkus-mapstruct) | `implementation` |
60-
| **Protobuf** | [entur/mapstruct-spi-protobuf](https://github.com/entur/mapstruct-spi-protobuf) | [no.entur.mapstruct.spi/protobuf-spi-impl](https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl) | `implementation` |
60+
| **Protobuf** | [entur/mapstruct-spi-protobuf](https://github.com/entur/mapstruct-spi-protobuf) | [no.entur.mapstruct.spi/protobuf-spi-impl](https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl) | `annotationProcessor` |
6161

6262
## Config
6363

‎src/main/java/io/github/akazver/gradle/plugins/mapstruct/dependency/AdditionalDependency.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class AdditionalDependency extends PluginDependency {
5757

5858
// https://mvnrepository.com/artifact/no.entur.mapstruct.spi/protobuf-spi-impl
5959
public static final AdditionalDependency PROTOBUF_SPI_IMPL =
60-
new AdditionalDependency("implementation", "no.entur.mapstruct.spi:protobuf-spi-impl:1.62.0");
60+
new AdditionalDependency("annotationProcessor", "no.entur.mapstruct.spi:protobuf-spi-impl:1.62.0");
6161

6262
public AdditionalDependency(String configuration, String id) {
6363
super(configuration, id);

‎src/main/java/io/github/akazver/gradle/plugins/mapstruct/manager/DependencyManager.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void addOptionalDependencies(String processorConfig) {
9595

9696
if (hasProtobuf) {
9797
LOGGER.lifecycle(ADDING_MESSAGE, "Protobuf");
98-
addDependency(PROTOBUF_SPI_IMPL);
98+
addDependency(PROTOBUF_SPI_IMPL, processorConfig);
9999
}
100100
}
101101

‎src/test/java/io/github/akazver/gradle/plugins/mapstruct/DependencyTest.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ void addOptionalDependenciesWithProtobuf() {
271271
evaluate(project);
272272

273273
String[] expectedAnnotationProcessor = {
274-
MAPSTRUCT_PROCESSOR.getId()
274+
MAPSTRUCT_PROCESSOR.getId(), PROTOBUF_SPI_IMPL.getId()
275275
};
276276

277277
String[] expectedImplementation = {
278-
MAPSTRUCT.getId(), PROTOBUF_JAVA.getId(), PROTOBUF_SPI_IMPL.getId()
278+
MAPSTRUCT.getId(), PROTOBUF_JAVA.getId()
279279
};
280280

281281
optionalDependenciesWithoutSpringTest(project, expectedAnnotationProcessor, expectedImplementation);
@@ -294,11 +294,11 @@ void addOptionalDependenciesWithProtobufPlugin() {
294294
assertThat(project.getConfigurations().findByName("protobuf")).isNotNull();
295295

296296
String[] expectedAnnotationProcessor = {
297-
MAPSTRUCT_PROCESSOR.getId()
297+
MAPSTRUCT_PROCESSOR.getId(), PROTOBUF_SPI_IMPL.getId()
298298
};
299299

300300
String[] expectedImplementation = {
301-
MAPSTRUCT.getId(), PROTOBUF_JAVA.getId(), PROTOBUF_SPI_IMPL.getId()
301+
MAPSTRUCT.getId(), PROTOBUF_JAVA.getId()
302302
};
303303

304304
optionalDependenciesWithoutSpringTest(project, expectedAnnotationProcessor, expectedImplementation);

0 commit comments

Comments
 (0)