Skip to content

Commit 27543c9

Browse files
guidobreitoddbaert
andauthored
build(flagd): OS agnostic flagd provider build (#998)
Signed-off-by: Guido Breitenhuber <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 1c2e11b commit 27543c9

File tree

12 files changed

+45
-877
lines changed

12 files changed

+45
-877
lines changed

Diff for: providers/flagd/pom.xml

+23-86
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@
162162
<executions>
163163
<execution>
164164
<id>update-schemas-submodule</id>
165-
<phase>validate</phase>
165+
<phase>initialize</phase>
166166
<goals>
167167
<goal>exec</goal>
168168
</goals>
169169
<configuration>
170-
<!-- run: git submodule update \-\-init \-\-recursive -->
170+
<!-- run: git submodule update \-\-init schemas -->
171171
<executable>git</executable>
172172
<arguments>
173173
<argument>submodule</argument>
@@ -177,94 +177,30 @@
177177
</arguments>
178178
</configuration>
179179
</execution>
180+
</executions>
181+
</plugin>
182+
183+
<plugin>
184+
<artifactId>maven-resources-plugin</artifactId>
185+
<version>3.3.1</version>
186+
<executions>
180187
<execution>
181-
<id>copy-schema-definition</id>
182-
<phase>validate</phase>
183-
<goals>
184-
<goal>exec</goal>
185-
</goals>
186-
<configuration>
187-
<!-- run: cp schemas/protobuf/schema/v1/schema.proto src/main/proto/ -->
188-
<executable>cp</executable>
189-
<arguments>
190-
<argument>schemas/protobuf/schema/v1/schema.proto</argument>
191-
<argument>src/main/proto/</argument>
192-
</arguments>
193-
</configuration>
194-
</execution>
195-
<execution>
196-
<id>copy-sync-definition</id>
197-
<phase>validate</phase>
198-
<goals>
199-
<goal>exec</goal>
200-
</goals>
201-
<configuration>
202-
<!-- run: cp schemas/protobuf/sync/v1/sync_service.proto src/main/proto/ -->
203-
<executable>cp</executable>
204-
<arguments>
205-
<argument>schemas/protobuf/sync/v1/sync_service.proto</argument>
206-
<argument>src/main/proto/</argument>
207-
</arguments>
208-
</configuration>
209-
</execution>
210-
<execution>
211-
<id>copy-evaluation.proto</id>
212-
<phase>validate</phase>
213-
<goals>
214-
<goal>exec</goal>
215-
</goals>
216-
<configuration>
217-
<!-- run: cp schemas/protobuf/flagd/evaluation/v1/evaluation.proto src/main/proto/ -->
218-
<executable>cp</executable>
219-
<arguments>
220-
<argument>schemas/protobuf/flagd/evaluation/v1/evaluation.proto</argument>
221-
<argument>src/main/proto/</argument>
222-
</arguments>
223-
</configuration>
224-
</execution>
225-
<execution>
226-
<id>copy-sync.proto</id>
227-
<phase>validate</phase>
228-
<goals>
229-
<goal>exec</goal>
230-
</goals>
231-
<configuration>
232-
<!-- run: cp schemas/protobuf/flagd/sync/v1/sync.proto src/main/proto/ -->
233-
<executable>cp</executable>
234-
<arguments>
235-
<argument>schemas/protobuf/flagd/sync/v1/sync.proto</argument>
236-
<argument>src/main/proto/</argument>
237-
</arguments>
238-
</configuration>
239-
</execution>
240-
<execution>
241-
<id>copy-flags-json-schema</id>
242-
<phase>validate</phase>
243-
<goals>
244-
<goal>exec</goal>
245-
</goals>
246-
<configuration>
247-
<!-- run: cp schemas/json/flags.json src/main/resources/flagd/schemas/ -->
248-
<executable>cp</executable>
249-
<arguments>
250-
<argument>schemas/json/flags.json</argument>
251-
<argument>src/main/resources/flagd/schemas/</argument>
252-
</arguments>
253-
</configuration>
254-
</execution>
255-
<execution>
256-
<id>copy-flags-targeting-schema</id>
257-
<phase>validate</phase>
188+
<id>copy-json-schemas</id>
189+
<phase>generate-resources</phase>
258190
<goals>
259-
<goal>exec</goal>
191+
<goal>copy-resources</goal>
260192
</goals>
261193
<configuration>
262-
<!-- run: cp schemas/json/targeting.json src/main/resources/flagd/schemas/ -->
263-
<executable>cp</executable>
264-
<arguments>
265-
<argument>schemas/json/targeting.json</argument>
266-
<argument>src/main/resources/flagd/schemas/</argument>
267-
</arguments>
194+
<outputDirectory>${basedir}/src/main/resources/flagd/schemas/</outputDirectory>
195+
<resources>
196+
<resource>
197+
<directory>${basedir}/schemas/json/</directory>
198+
<includes>
199+
<include>flags.json</include>
200+
<include>targeting.json</include>
201+
</includes>
202+
</resource>
203+
</resources>
268204
</configuration>
269205
</execution>
270206
</executions>
@@ -278,6 +214,7 @@
278214
<protocArtifact>com.google.protobuf:protoc:3.21.1:exe:${os.detected.classifier}</protocArtifact>
279215
<pluginId>grpc-java</pluginId>
280216
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.48.1:exe:${os.detected.classifier}</pluginArtifact>
217+
<protoSourceRoot>${project.basedir}/schemas/protobuf/</protoSourceRoot>
281218
</configuration>
282219
<executions>
283220
<execution>

Diff for: providers/flagd/src/main/proto/.gitignore

-1
This file was deleted.

Diff for: providers/flagd/src/main/proto/.gitkeep

Whitespace-only changes.

Diff for: providers/flagd/src/main/resources/flags.json

-184
This file was deleted.

0 commit comments

Comments
 (0)