package org.jboss.shamrock.rsops;

import io.smallrye.reactive.streams.Engine;
import org.eclipse.microprofile.reactive.streams.ReactiveStreamsFactory;
import org.eclipse.microprofile.reactive.streams.core.ReactiveStreamsFactoryImpl;
import org.eclipse.microprofile.reactive.streams.spi.ReactiveStreamsEngine;
import org.jboss.shamrock.annotations.BuildProducer;
import org.jboss.shamrock.annotations.BuildStep;
import org.jboss.shamrock.deployment.builditem.substrate.ReflectiveClassBuildItem;
import org.jboss.shamrock.deployment.builditem.substrate.SubstrateResourceBuildItem;

public class ReactiveStreamsOperatorsProcessor {

    @BuildStep
    public void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
                      BuildProducer<SubstrateResourceBuildItem> resource) throws Exception {
        reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, ReactiveStreamsFactoryImpl.class.getName(), Engine.class.getName()));

        resource.produce(new SubstrateResourceBuildItem("META-INF/services/" + ReactiveStreamsEngine.class.getName()));
        resource.produce(new SubstrateResourceBuildItem("META-INF/services/" + ReactiveStreamsFactory.class.getName()));
    }

}

@@ -466,108 +466,23 @@
 ate.
-ReflectiveClassBuildItem;%0Aimport org.jboss.shamrock.deployment.builditem.substrate.SubstrateResource
+ServiceProvider
 Buil
@@ -594,219 +594,114 @@
 cer%3C
-ReflectiveClassBuildItem%3E reflectiveClass,%0A                      BuildProducer%3CSubstrateResourceBuildItem%3E resource) throws Exception %7B%0A        reflectiveClass.produce(new ReflectiveClassBuildItem(false, false, 
+ServiceProviderBuildItem%3E serviceProvider) %7B%0A        serviceProvider.produce(new ServiceProviderBuildItem(
 Reac
@@ -711,27 +711,22 @@
 eStreams
-FactoryImpl
+Engine
 .class.g
@@ -761,25 +761,24 @@
 me()));%0A
-%0A
         
 resource
@@ -773,79 +773,61 @@
     
-resource.produce(new SubstrateResourceBuildItem(%22META-INF/services/%22 + 
+serviceProvider.produce(new ServiceProviderBuildItem(
 Reac
@@ -829,38 +829,39 @@
 (ReactiveStreams
-Engine
+Factory
 .class.getName()
@@ -864,90 +864,9 @@
 me()
-));%0A        resource.produce(new SubstrateResourceBuildItem(%22META-INF/services/%22 +
+,
  Rea
@@ -876,32 +876,36 @@
 veStreamsFactory
+Impl
 .class.getName()

Use the new SPI support in the SmallRye Reactive Streams Operators processor