Skip to content

Commit

Permalink
added spring AOT example
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-higgins committed Apr 24, 2024
1 parent 78e67ac commit 4aecccb
Show file tree
Hide file tree
Showing 3 changed files with 419 additions and 0 deletions.
17 changes: 17 additions & 0 deletions reference-examples/generation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,21 @@
<version>6.0.11</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.fluxtion</groupId>
<artifactId>fluxtion-maven-plugin</artifactId>
<version>3.0.14</version>
<executions>
<execution>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.fluxtion.example.reference.generation;

import com.fluxtion.compiler.EventProcessorConfig;
import com.fluxtion.compiler.Fluxtion;
import com.fluxtion.compiler.FluxtionCompilerConfig;
import com.fluxtion.compiler.FluxtionGraphBuilder;
import com.fluxtion.compiler.builder.dataflow.DataFlow;

import java.nio.file.Path;

//Uncomment to disable discovery for this FluxtionGraphBuilder
//@com.fluxtion.runtime.annotations.builder.Disabled
public class SampleAotBuilder implements FluxtionGraphBuilder {
@Override
public void buildGraph(EventProcessorConfig eventProcessorConfig) {
DataFlow.subscribe(String.class)
.mapToInt(String::length);
}

@Override
public void configureGeneration(FluxtionCompilerConfig compilerConfig) {
compilerConfig.setClassName("SampleAotBuilderProcessor");
compilerConfig.setPackageName("com.fluxtion.example.reference.generation.genoutput");
}

public static void main(String[] args) {
Fluxtion.scanAndCompileFluxtionBuilders(Path.of("target/classes/").toFile());
}
}
Loading

0 comments on commit 4aecccb

Please sign in to comment.