]>
git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/dev/archery/archery/lang/java.py
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
20 from ..utils
.command
import Command
, CommandStackMixin
, default_bin
21 from ..utils
.maven
import MavenDefinition
25 def __init__(self
, java_bin
=None):
26 self
.bin
= default_bin(java_bin
, "java")
29 class Jar(CommandStackMixin
, Java
):
30 def __init__(self
, jar
, *args
, **kwargs
):
32 self
.argv
= ("-jar", jar
)
33 Java
.__init
__(self
, *args
, **kwargs
)
36 class JavaConfiguration
:
40 java_home
=None, java_options
=None,
42 build_extras
=None, benchmark_extras
=None):
43 self
.java_home
= java_home
44 self
.java_options
= java_options
46 self
.build_extras
= list(build_extras
) if build_extras
else []
47 self
.benchmark_extras
= list(
48 benchmark_extras
) if benchmark_extras
else []
51 def build_definitions(self
):
52 return self
.build_extras
55 def benchmark_definitions(self
):
56 return self
.benchmark_extras
59 def environment(self
):
60 env
= os
.environ
.copy()
63 env
["JAVA_HOME"] = self
.java_home
66 env
["JAVA_OPTIONS"] = self
.java_options
71 class JavaMavenDefinition(MavenDefinition
):
72 def __init__(self
, source
, conf
, **kwargs
):
73 self
.configuration
= conf
74 super().__init
__(source
, **kwargs
,
75 build_definitions
=conf
.build_definitions
,
76 benchmark_definitions
=conf
.benchmark_definitions
,