Skip to content

Commit

Permalink
Integrate Helidon Build Tools v3.0.0-RC3. (helidon-io#4580)
Browse files Browse the repository at this point in the history
* Integrate Helidon Build Tools v3.0.0-RC3.
Move the archetype input filters to a separate properties file.

* Fix media support and broken permutations.
  • Loading branch information
romain-grecourt committed Jul 21, 2022
1 parent 0c8ab9d commit e604b46
Show file tree
Hide file tree
Showing 18 changed files with 227 additions and 103 deletions.
4 changes: 2 additions & 2 deletions applications/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<version.plugin.dependency>3.1.2</version.plugin.dependency>
<version.plugin.exec>1.6.0</version.plugin.exec>
<version.plugin.failsafe>3.0.0-M5</version.plugin.failsafe>
<version.plugin.helidon>3.0.0-RC2</version.plugin.helidon>
<version.plugin.helidon-cli>3.0.0-RC2</version.plugin.helidon-cli>
<version.plugin.helidon>3.0.0-RC3</version.plugin.helidon>
<version.plugin.helidon-cli>3.0.0-RC3</version.plugin.helidon-cli>
<version.plugin.jar>3.0.2</version.plugin.jar>
<version.plugin.os>1.5.0.Final</version.plugin.os>
<version.plugin.protobuf>0.5.1</version.plugin.protobuf>
Expand Down
123 changes: 123 additions & 0 deletions archetypes/helidon/filters.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#
# Copyright (c) 2022 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This file contains permutation input filters, the property names are not used only the values.
#
# The number of computed permutations can be very large and quickly become un-manageable.
# The build will output warnings when the number of computed permutations for a node is > 150000.
# Filters are used to restrain the computed permutations.
#
# Filters are taken into account when they evaluate successfully. If a variable is unresolved, the result is ignored.
# A filter that needs to restrain a specific combination should only reference variables in the scope of the target node.

# never combine multipart with other media options
multipart=${media} == 'multipart' || !(${media} contains 'multipart')

# group metrics, tracing and health together
observability=!(${metrics} || ${tracing} || ${health}) || \
(${metrics} && ${tracing} && ${health})

# force health.builtin=true
health=!${health} || (${health.builtin})

# force metrics.builtin=true
metrics=!${metrics} || (${metrics.builtin})

# force metrics.provider='microprofile' when tracing=true
tracing=!${tracing} || (${tracing} && ${metrics.provider} == 'microprofile')

# group extra options
extra=${extra} == [] || ${extra} == ['cors', 'webclient', 'fault-tolerance']

# group docker, k8s and v8o
packaging=!(${docker} || ${k8s} || ${v8o}) || (${docker} && ${k8s} && ${v8o})

# force docker.native-image=true and docker.jlink-image=true when docker=true
docker=!${docker} || (${docker.native-image} && ${docker.jlink-image})

# force single option for security.atn
security-atn=\
${security.atn} == ['oidc'] || \
${security.atn} == ['jwt'] || \
${security.atn} == ['google'] || \
${security.atn} == ['http-signature']

# only combine security.atz with security.atn=oidc
security-atz=\
${security.atz} == [] || \
(${security.atz} == 'abac' && ${security.atn} == 'oidc')

# do not combine media and security
security-media=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${security} && ${media} == []) || !${security})

# do not combine metrics and media
metrics-media=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${metrics} && ${media} == []) || !${metrics})

# do not combine metrics and security
security-metrics=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${metrics} && !${security}) || !${metrics})

# do not combine docker and media
docker-media=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${docker} && ${media} == []) || !${docker})

# do not combine docker and security
docker-security=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${docker} && !${security}) || !${docker})

# do not combine docker and tracing
docker-tracing=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${docker} && !${tracing}) || !${docker})

# do not combine docker and extra
docker-extra=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(${docker} && ${extra} != []) || !${docker})

# do not combine security and extra
extra-security=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
(!${security} && ${extra} != []) || (${security} && ${extra} == []))

# do not combine custom and db
custom-db=\
${app-type} != 'custom' || (${app-type} == 'custom' && \
!${db})

# do not combine media.json-lib=jackson when db.auto-ddl=true
ddl-media=\
${app-type} != 'database' || (${app-type} == 'database' && \
(${db.auto-ddl} && ${media.json-lib} == 'jackson') || \
(!${db.auto-ddl} && ${media.json-lib} != 'jackson'))

# do not combine media.json-lib=jackson when db.cp=hikaricp
hikaricp-media=\
${app-type} != 'database' || (${app-type} == 'database' && \
(${db.cp} == 'hikaricp' && ${media.json-lib} == 'jackson') || \
(${db.cp} != 'hikaricp' && ${media.json-lib} != 'jackson'))

# do not combine app-type=database when health=true
db-health=\
${app-type} != 'database' || (${app-type} == 'database' && \
!${health})
46 changes: 1 addition & 45 deletions archetypes/helidon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,51 +54,7 @@
</variables>
<exec src="flavor.xml"/>
</entrypoint>
<inputFilters>
<!-- TODO test cdata, if not go with a separate file -->
<!-- TODO look at multiline expressions -->
<!-- TODO look at equality with arrays (== ['foo'] ; == []) -->
<!--suppress UnresolvedMavenProperty -->
<filter>${media} == 'multipart' || !(${media} contains 'multipart')</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!(${metrics} || ${tracing} || ${health}) || (${metrics} &amp;&amp; ${tracing} &amp;&amp; ${health})</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!${health} || (${health.builtin})</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!${metrics} || (${metrics.builtin})</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!${tracing} || (${tracing} &amp;&amp; ${metrics.provider} == 'microprofile')</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>${extra} == [] || (${extra} contains 'cors' &amp;&amp; ${extra} contains 'webclient' &amp;&amp; ${extra} contains 'fault-tolerance')</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!(${docker} || ${k8s} || ${v8o}) || (${docker} &amp;&amp; ${k8s} &amp;&amp; ${v8o})</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>!${docker} || (${docker.native-image} &amp;&amp; ${docker.jlink-image})</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>${security.atn} == 'oidc' || ${security.atn} == 'jwt' || ${security.atn} == 'google' || ${security.atn} == 'http-signature'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${security.atz} == 'abac' &amp;&amp; ${security.atn} == 'oidc') || ${security.atz} == 'none'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${security} == 'true' &amp;&amp; ${media} == 'none') || ${security} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${metrics} == 'true' &amp;&amp; ${media} == 'none') || ${metrics} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${metrics} == 'true' &amp;&amp; ${security} == 'false') || ${metrics} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${docker} == 'true' &amp;&amp; ${media} == 'none') || ${docker} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${docker} == 'true' &amp;&amp; ${security} == 'false') || ${docker} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${docker} == 'true' &amp;&amp; ${tracing} == 'false') || ${docker} == 'false' || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'custom' &amp;&amp; ${db} == 'false') || ${app-type} != 'custom'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'database' &amp;&amp; ${db.auto-ddl} == 'true') &amp;&amp; ${media.json-lib} == 'jackson' || (${db.auto-ddl} == 'false' &amp;&amp; ${media.json-lib} != 'jackson') || ${app-type} != 'database'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'database' &amp;&amp; ${db.cp} == 'hikaricp') &amp;&amp; ${media.json-lib} == 'jackson' || (${db.cp} != 'hikaricp' &amp;&amp; ${media.json-lib} != 'jackson' ) || ${app-type} != 'database'</filter>
<!--suppress UnresolvedMavenProperty -->
<filter>(${app-type} == 'database' &amp;&amp; ${health} == 'false') || ${app-type} != 'database'</filter>
</inputFilters>
<inputFiltersFile>filters.properties</inputFiltersFile>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/helidon/src/main/archetype/common/extra.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<step name="Extra" optional="true">
<inputs>
<list id="extra" name="Select Additional Components" optional="true">
<option value="webclient" name="WebClient" description="Reactive HTTP client">
<option value="webclient" name="WebClient" description="Reactive HTTP client" if="${flavor} == 'se'">
<output>
<templates engine="mustache" transformations="mustache,packaged">
<directory>files</directory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
{{#mainClass}}
<mainClass>{{package}}.Main</mainClass>
{{/mainClass}}
<helidon.version>{{helidon-version}}</helidon.version>
</properties>

<dependencies>
Expand Down
Loading

0 comments on commit e604b46

Please sign in to comment.