Skip to content

Instantly share code, notes, and snippets.

@nitay

nitay/x.py Secret

Created May 27, 2016 20:39
Show Gist options
  • Save nitay/0239f0bd6522c649ba6921c9b3bc3558 to your computer and use it in GitHub Desktop.
Save nitay/0239f0bd6522c649ba6921c9b3bc3558 to your computer and use it in GitHub Desktop.
class AiqJvmBinary:
DEPS = [
'3rdparty/ch/qos/logback:logback-classic', # runtime logback implementation
'3rdparty/org/slf4j:redirects', # redirect all logging to slf4j-api
'config/src/main/resources', # main configs like logback, reference.conf
]
DEPLOY_JAR_RULES = [
# See http://bit.ly/1X1spFy
Duplicate('^reference\.conf', Duplicate.CONCAT_TEXT),
]
def __init__(self, parse_context):
self.parse_context = parse_context
def __call__(self, **kwargs):
kwargs['dependencies'] = self.DEPS + kwargs.get('dependencies', [])
existing_jar_rules = kwargs.get('deploy_jar_rules', JarRules())
kwargs['deploy_jar_rules'] = JarRules(existing_jar_rules.rules + self.DEPLOY_JAR_RULES,
existing_jar_rules.default_dup_action)
self.parse_context.create_object('jvm_binary', **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment