mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-23 07:55:57 +00:00
Add maven pattern
This commit is contained in:
@@ -684,6 +684,24 @@ def failed_pattern_ruby_table(line, pattern, verbose=0):
|
||||
print("Unknown pattern match: ", pattern, s)
|
||||
|
||||
|
||||
def failed_pattern_maven(line, pattern, verbose=0):
|
||||
global must_restart
|
||||
global failed_commands
|
||||
|
||||
pat = re.compile(pattern)
|
||||
match = pat.search(line)
|
||||
if match:
|
||||
s = match.group(1)
|
||||
try:
|
||||
if s in buildreq.maven_jars:
|
||||
must_restart = must_restart + buildreq.add_buildreq(buildreq.maven_jars[s])
|
||||
else:
|
||||
must_restart = must_restart + buildreq.add_buildreq('jdk-%s' % s)
|
||||
except:
|
||||
if verbose > 0:
|
||||
print("Unknown maven jar match: ", s)
|
||||
|
||||
|
||||
def parse_build_results(filename, returncode):
|
||||
global must_restart
|
||||
global success
|
||||
@@ -835,6 +853,8 @@ def parse_build_results(filename, returncode):
|
||||
failed_pattern_ruby_table(line, r":in `require': cannot load such file -- ([a-zA-Z0-9\-\_:\/]+)")
|
||||
failed_pattern_ruby_table(line, r"LoadError: cannot load such file -- ([a-zA-Z0-9\-:\/\_]+)")
|
||||
failed_pattern_go(line, r".*\.go:.*cannot find package \"(.*)\" in any of:")
|
||||
failed_pattern_maven(line, "\[ERROR\] .* Cannot access central \(.*\) in offline mode and the artifact .*:(.*):[pom|jar]+:.* has not been downloaded from it before. .*")
|
||||
failed_pattern_maven(line, "\[ERROR\] .* Cannot access central \(.*\) in offline mode and the artifact .*:(.*):[jar|pom]+:.* has not been downloaded from it before.*")
|
||||
|
||||
if infiles == 1 and line.find("RPM build errors") >= 0:
|
||||
infiles = 2
|
||||
|
||||
@@ -487,6 +487,15 @@ def write_golang_pattern(file):
|
||||
file.write_strip("go test -v -x " + library_path + tolerance)
|
||||
|
||||
|
||||
def write_maven_pattern(file):
|
||||
write_prep(file)
|
||||
file.write_strip("%build")
|
||||
file.write_strip("python3 /usr/share/java-utils/mvn_build.py")
|
||||
file.write_strip("\n")
|
||||
file.write_strip("%install")
|
||||
file.write_strip("xmvn-install -R .xmvn-reactor -n maven-parent -d %{buildroot}")
|
||||
|
||||
|
||||
def set_build_pattern(pattern, strength):
|
||||
global default_pattern
|
||||
global pattern_strengh
|
||||
|
||||
@@ -221,6 +221,9 @@ gems = {"hoe": "rubygem-hoe",
|
||||
"test/unit": "rubygem-test-unit",
|
||||
}
|
||||
|
||||
maven_jars = {"apache": "jdk-apache-parent"
|
||||
}
|
||||
|
||||
|
||||
def Rakefile(filename):
|
||||
global gems
|
||||
|
||||
@@ -183,6 +183,18 @@ def download_tarball(url_argument, name_argument, archives, target_dir):
|
||||
if b >= 0:
|
||||
version = version[:b]
|
||||
|
||||
# maven
|
||||
if url_argument.find("maven.org") > 0:
|
||||
buildpattern.set_build_pattern("maven", 10)
|
||||
buildreq.add_buildreq("apache-maven")
|
||||
buildreq.add_buildreq("xmvn")
|
||||
buildreq.add_buildreq("openjdk-dev")
|
||||
buildreq.add_buildreq("javapackages-tools")
|
||||
buildreq.add_buildreq("python3")
|
||||
buildreq.add_buildreq("six")
|
||||
buildreq.add_buildreq("lxml")
|
||||
buildreq.add_buildreq("jdk-plexus-classworlds")
|
||||
|
||||
# override from commandline
|
||||
if name_argument and name_argument[0] != name:
|
||||
pattern = name_argument[0] + r"[\-]*(.*)\.(tgz|tar|zip)"
|
||||
|
||||
Reference in New Issue
Block a user