This is an automated email from the ASF dual-hosted git repository. cdutz pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/plc4x.git
commit e88ba00495539a128f7beccef42f057fd8c324da Author: Christofer Dutz <[email protected]> AuthorDate: Fri Aug 16 15:20:16 2019 +0200 - Made the build check if gem is at least in version 3.0.0 (which supports the "output" option) --- plc4j/integrations/logstash-plugin/pom.xml | 3 ++- plc4j/integrations/pom.xml | 10 +++++++++- src/main/script/prerequisiteCheck.groovy | 24 ++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/plc4j/integrations/logstash-plugin/pom.xml b/plc4j/integrations/logstash-plugin/pom.xml index ffe0f24..329409e 100644 --- a/plc4j/integrations/logstash-plugin/pom.xml +++ b/plc4j/integrations/logstash-plugin/pom.xml @@ -96,6 +96,7 @@ <arguments> <argument>build</argument> <argument>gem/logstash-input-plc4x.gemspec</argument> + <argument>--output=${project.artifactId}-${project.version}.gem</argument> </arguments> <workingDirectory>${project.build.directory}</workingDirectory> </configuration> @@ -129,7 +130,7 @@ <configuration> <artifacts> <artifact> - <file>${project.build.directory}/plc4j-logstash-plugin-0.5.0.pre.SNAPSHOT.gem</file> + <file>${project.build.directory}/${project.artifactId}-${project.version}.gem</file> <type>gem</type> </artifact> </artifacts> diff --git a/plc4j/integrations/pom.xml b/plc4j/integrations/pom.xml index f35b5d3..f2ba6d0 100644 --- a/plc4j/integrations/pom.xml +++ b/plc4j/integrations/pom.xml @@ -39,7 +39,15 @@ <module>apache-nifi</module> <module>apache-karaf</module> <module>apache-calcite</module> - <module>logstash-plugin</module> </modules> + <profiles> + <profile> + <id>with-logstash</id> + <modules> + <module>logstash-plugin</module> + </modules> + </profile> + </profiles> + </project> \ No newline at end of file diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy index 72a1558..b4814fd 100644 --- a/src/main/script/prerequisiteCheck.groovy +++ b/src/main/script/prerequisiteCheck.groovy @@ -146,6 +146,22 @@ def checkGpp() { } } +def checkGem() { + print "Detecting Gem version: " + def output = "gem --version".execute().text + Matcher matcher = extractVersion(output) + if(matcher.size() > 0) { + def curVersion = matcher[0][1] + def result = checkVersionAtLeast(curVersion, "3.0.0") + if(!result) { + allConditionsMet = false + } + } else { + println "missing" + allConditionsMet = false + } +} + def checkPython() { print "Detecting Python version: " def process = ("python --version").execute() @@ -241,6 +257,7 @@ def javaEnabled = false def pythonEnabled = false def proxiesEnabled = false def sandboxEnabled = false +def logstashEnabled = false def activeProfiles = session.request.activeProfiles for (def activeProfile : activeProfiles) { if(activeProfile == "with-boost") { @@ -264,6 +281,9 @@ for (def activeProfile : activeProfiles) { } else if(activeProfile == "with-sandbox") { sandboxEnabled = true println "sandbox" + } else if(activeProfile == "with-logstash") { + logstashEnabled = true + println "logstash" } } println "" @@ -323,6 +343,10 @@ if(!boostEnabled && cppEnabled) { checkBoost() } +if(javaEnabled && logstashEnabled) { + checkGem() +} + if(!allConditionsMet) { throw new RuntimeException("Not all conditions met, see log for details.") }
