From d60c8331143788f1ae18955d6a93d184bd1a2a3f Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Wed, 10 Sep 2014 11:02:59 +0200 Subject: [PATCH] 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 --- lib/maven.defs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/maven.defs b/lib/maven.defs index 5f4006fe27..23708ca249 100644 --- a/lib/maven.defs +++ b/lib/maven.defs @@ -40,7 +40,8 @@ def maven_jar( sha1 = '', bin_sha1 = '', src_sha1 = '', repository = MAVEN_CENTRAL, attach_source = True, - visibility = ['PUBLIC']): + visibility = ['PUBLIC'], + local_license = False): from os import path parts = id.split(':') @@ -89,7 +90,10 @@ def maven_jar( cmd = ' '.join(cmd), out = binjar, ) - license = ['//lib:LICENSE-' + license] + license = ':LICENSE-' + license + if not local_license: + license = '//lib' + license + license = [license] if src_sha1 or attach_source: cmd = ['$(exe //tools:download_file)', '-o', '$OUT', '-u', srcurl]