Skip to content

Commit 07ff3ca

Browse files
committed
move enum build to clas-io
1 parent 098efae commit 07ff3ca

3 files changed

Lines changed: 45 additions & 42 deletions

File tree

‎common-tools/clas-io/pom.xml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,45 @@
5555

5656
</dependencies>
5757

58+
<build>
59+
<plugins>
60+
<plugin>
61+
<groupId>org.apache.maven.plugins</groupId>
62+
<artifactId>maven-antrun-plugin</artifactId>
63+
<version>3.1.0</version>
64+
<executions>
65+
<execution>
66+
<id>bank-schema-enums</id>
67+
<phase>validate</phase>
68+
<goals>
69+
<goal>run</goal>
70+
</goals>
71+
<inherited>false</inherited>
72+
<configuration>
73+
<target>
74+
<exec executable="python3">
75+
<arg value="../../libexec/bank-schema-enums"/>
76+
</exec>
77+
</target>
78+
</configuration>
79+
</execution>
80+
</executions>
81+
</plugin>
82+
<plugin>
83+
<artifactId>maven-clean-plugin</artifactId>
84+
<version>3.4.0</version>
85+
<configuration>
86+
<filesets>
87+
<fileset>
88+
<directory>src/main/java/org/jlab/io/banks</directory>
89+
<includes>
90+
<include>**/*.java</include>
91+
</includes>
92+
</fileset>
93+
</filesets>
94+
</configuration>
95+
</plugin>
96+
</plugins>
97+
</build>
98+
5899
</project>

‎libexec/bank-schema-enums‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env python3
22
import os,glob,json
3-
idir = 'etc/bankdefs/hipo4'
4-
odir = 'common-tools/clas-io/src/main/java/org/jlab/io/banks'
3+
top = os.path.normpath(os.path.dirname(os.path.abspath(__file__))+'/..')
4+
idir = top+'/etc/bankdefs/hipo4'
5+
odir = top+'/common-tools/clas-io/src/main/java/org/jlab/io/banks'
6+
print(f'INFO: Creating schema enums at {odir}')
57
os.makedirs(odir, exist_ok=True)
68
for x in glob.glob(f'{idir}/*.json'):
79
for bank in json.load(open(x,'r')):

‎pom.xml‎

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -263,30 +263,6 @@
263263

264264
<plugins> <!-- plugins inherited by all child POMs -->
265265

266-
<!-- generate bank shcema enums -->
267-
<plugin>
268-
<groupId>org.apache.maven.plugins</groupId>
269-
<artifactId>maven-antrun-plugin</artifactId>
270-
<version>3.1.0</version>
271-
<executions>
272-
<execution>
273-
<id>bank-schema-enums</id>
274-
<phase>validate</phase>
275-
<goals>
276-
<goal>run</goal>
277-
</goals>
278-
<inherited>false</inherited> <!-- make this one NOT inherited -->
279-
<configuration>
280-
<target>
281-
<exec executable="python3">
282-
<arg value="libexec/bank-schema-enums"/>
283-
</exec>
284-
</target>
285-
</configuration>
286-
</execution>
287-
</executions>
288-
</plugin>
289-
290266
<!-- static analysis -->
291267
<plugin>
292268
<groupId>com.github.spotbugs</groupId>
@@ -452,22 +428,6 @@
452428
<pluginManagement>
453429
<plugins> <!-- plugin configurations (unused in child POMs unless declared) -->
454430

455-
<!-- delete auto-generated bank schema enums during clean phase -->
456-
<plugin>
457-
<artifactId>maven-clean-plugin</artifactId>
458-
<version>3.4.0</version>
459-
<configuration>
460-
<filesets>
461-
<fileset>
462-
<directory>common-tools/clas-io/src/main/java/org/jlab/io/banks</directory>
463-
<includes>
464-
<include>**/*.java</include>
465-
</includes>
466-
</fileset>
467-
</filesets>
468-
</configuration>
469-
</plugin>
470-
471431
<!-- generate minimal POM files for deployment, containing GAV (groupID, artifactId, version) -->
472432
<plugin>
473433
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)