Skip to content

Commit 3bfd72c

Browse files
committed
Add contrib/thrift-maven-plugin to autoconf build process.
1 parent 3b0ab4d commit 3bfd72c

File tree

5 files changed

+166
-0
lines changed

5 files changed

+166
-0
lines changed

Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ if WITH_TUTORIAL
2929
SUBDIRS += tutorial
3030
endif
3131

32+
if WITH_CONTRIB
33+
SUBDIRS += contrib
34+
endif
35+
3236
clean-local:
3337
$(RM) -r vendor/
3438

aclocal/ax_prog_maven.m4

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SYNOPSIS
2+
#
3+
# AX_PROG_MAVEN_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
4+
#
5+
# DESCRIPTION
6+
#
7+
# Makes sure that maven supports the version indicated. If true the shell
8+
# commands in ACTION-IF-TRUE are executed. If not the shell commands in
9+
# ACTION-IF-FALSE are run. The $MAVEN_VERSION variable will be filled with
10+
# the detected version.
11+
#
12+
# This macro uses the $MAVEN variable to perform the check. If $MAVEN is not
13+
# set prior to calling this macro, the macro will fail.
14+
#
15+
# Example:
16+
#
17+
# AC_PATH_PROG([MAVEN],[mvn])
18+
# AC_PROG_MAVEN_VERSION([3.0.0],[ ... ],[ ... ])
19+
#
20+
# Searches for Maven, then checks if at least version 3.0.0 is present.
21+
#
22+
# LICENSE
23+
#
24+
# Copyright (c) 2026 Joshua M. Keyes <joshua.michael.keyes@gmail.com>
25+
#
26+
# Copying and distribution of this file, with or without modification, are
27+
# permitted in any medium without royalty provided the copyright notice
28+
# and this notice are preserved. This file is offered as-is, without any
29+
# warranty.
30+
31+
#serial 1
32+
33+
AC_DEFUN([AX_PROG_MAVEN_VERSION],[
34+
AS_IF([test -n "$MAVEN"],[
35+
ax_maven_version="$1"
36+
37+
AC_MSG_CHECKING([for maven version])
38+
maven_version=`$MAVEN --quiet --version`
39+
AC_MSG_RESULT($maven_version)
40+
41+
AC_SUBST([MAVEN_VERSION],[$maven_version])
42+
43+
AX_COMPARE_VERSION([$ax_maven_version],[le],[$maven_version],[
44+
:
45+
$2
46+
],[
47+
:
48+
$3
49+
])
50+
],[
51+
AC_MSG_WARN([could not find maven])
52+
$3
53+
])
54+
])

configure.ac

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,28 @@ if test "$enable_tutorial" = "no"; then
593593
fi
594594
AM_CONDITIONAL(WITH_TUTORIAL, [test "$have_tutorial" = "yes"])
595595

596+
AC_ARG_ENABLE([contrib],
597+
AS_HELP_STRING([--enable-contrib], [build contrib [default=yes]]),
598+
[], enable_contrib=yes
599+
)
600+
have_contrib=yes
601+
if test "$enable_contrib" = "no"; then
602+
have_contrib="no"
603+
fi
604+
AM_CONDITIONAL(WITH_CONTRIB, [test "$have_contrib" = "yes"])
605+
606+
AC_ARG_WITH([maven-plugin],
607+
[AS_HELP_STRING([--with-maven-plugin], [build the Maven plugin [default=yes]])],
608+
[with_maven_plugin="$withval"], [with_maven_plugin="yes"])
609+
have_maven_plugin="no"
610+
if test "$enable_contrib" = "yes" -a "$with_maven_plugin" = "yes"; then
611+
AC_PATH_PROG([MAVEN], [mvn])
612+
if [[ -x "$MAVEN" ]] ; then
613+
AX_PROG_MAVEN_VERSION([3.0.0], have_maven_plugin="yes", have_maven_plugin="no")
614+
fi
615+
fi
616+
AM_CONDITIONAL(WITH_MAVEN_PLUGIN, [test "$have_maven_plugin" = "yes"])
617+
596618
AM_CONDITIONAL(MINGW, false)
597619
case "${host_os}" in
598620
*mingw*)
@@ -769,6 +791,8 @@ AC_CONFIG_FILES([
769791
compiler/cpp/Makefile
770792
compiler/cpp/src/Makefile
771793
compiler/cpp/test/Makefile
794+
contrib/Makefile
795+
contrib/thrift-maven-plugin/Makefile
772796
lib/Makefile
773797
lib/cl/Makefile
774798
lib/cpp/Makefile
@@ -929,6 +953,7 @@ echo "Building Py3 Library ......... : $have_py3"
929953
echo "Building Ruby Library ........ : $have_ruby"
930954
echo "Building Rust Library ........ : $have_rs"
931955
echo "Building Swift Library ....... : $have_swift"
956+
echo "Building Maven Plugin ........ : $have_maven_plugin"
932957

933958
if test "$have_c_glib" = "yes" ; then
934959
echo
@@ -1064,6 +1089,12 @@ if test "$have_swift" = "yes" ; then
10641089
echo " Using Swift ............... : $SWIFT"
10651090
echo " Using Swift version ....... : $($SWIFT --version | head -1)"
10661091
fi
1092+
if test "$have_maven_plugin" = "yes" ; then
1093+
echo
1094+
echo "Maven Plugin:"
1095+
echo " Using Maven ............... : $MAVEN"
1096+
echo " Using Maven version ....... : $($MAVEN --version --quiet)"
1097+
fi
10671098
echo
10681099
echo "If something is missing that you think should be present,"
10691100
echo "please skim the output of configure to find the missing"

contrib/Makefile.am

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
SUBDIRS =
21+
22+
if MINGW
23+
# do nothing, just build the compiler
24+
else
25+
26+
if WITH_MAVEN_PLUGIN
27+
SUBDIRS += thrift-maven-plugin
28+
endif
29+
30+
endif
31+
32+
distdir:
33+
$(MAKE) $(AM_MAKEFLAGS) distdir-am
34+
35+
# Any folders or files not listed above being added to SUBDIR need to be placed here in
36+
# EXTRA_DIST to be included in the release
37+
EXTRA_DIST = \
38+
README.md
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
export CLASSPATH
21+
22+
all-local:
23+
$(MAVEN) $(MAVEN_OPTS) package
24+
25+
clean-local:
26+
$(MAVEN) $(MAVEN_OPTS) clean
27+
28+
check-local: $(THRIFT)
29+
$(MAVEN) $(MAVEN_OPTS) verify
30+
31+
maven-publish:
32+
$(MAVEN) $(MAVEN_OPTS) deploy
33+
34+
distdir:
35+
$(MAKE) $(AM_MAKEFLAGS) distdir-am
36+
37+
EXTRA_DIST = \
38+
src \
39+
pom.xml

0 commit comments

Comments
 (0)