Allow plugins to use self-provided licenses for used Maven Jars
maven_jar only allowed to use licenses that were defined in '//lib:'. But plugins may need further licenses that are not yet in core (E.g.: plugins/its-jira relies on a jar with CPL1.0 license). Since, plugins cannot add rules underneath '//lib:', we add the local_license parameter to maven_jar, which allows plugins to use licenses from ':' instead of '//lib:'. Change-Id: Icc40c413eed65a0b6e3003021050d91086ca4c34
This commit is contained in:
parent
24ec75ea2f
commit
d60c833114
@ -40,7 +40,8 @@ def maven_jar(
|
|||||||
sha1 = '', bin_sha1 = '', src_sha1 = '',
|
sha1 = '', bin_sha1 = '', src_sha1 = '',
|
||||||
repository = MAVEN_CENTRAL,
|
repository = MAVEN_CENTRAL,
|
||||||
attach_source = True,
|
attach_source = True,
|
||||||
visibility = ['PUBLIC']):
|
visibility = ['PUBLIC'],
|
||||||
|
local_license = False):
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
parts = id.split(':')
|
parts = id.split(':')
|
||||||
@ -89,7 +90,10 @@ def maven_jar(
|
|||||||
cmd = ' '.join(cmd),
|
cmd = ' '.join(cmd),
|
||||||
out = binjar,
|
out = binjar,
|
||||||
)
|
)
|
||||||
license = ['//lib:LICENSE-' + license]
|
license = ':LICENSE-' + license
|
||||||
|
if not local_license:
|
||||||
|
license = '//lib' + license
|
||||||
|
license = [license]
|
||||||
|
|
||||||
if src_sha1 or attach_source:
|
if src_sha1 or attach_source:
|
||||||
cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', srcurl]
|
cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', srcurl]
|
||||||
|
Loading…
Reference in New Issue
Block a user