Chromium Code Reviews| Index: build/android/gradle/android.jinja |
| diff --git a/build/android/gradle/android.jinja b/build/android/gradle/android.jinja |
| index 5dba39daeb0ecedfdc55bd1e9306ff3e1c2428ec..ac98621f1a5d97e80336751bb8f3c2d1d37bedde 100644 |
| --- a/build/android/gradle/android.jinja |
| +++ b/build/android/gradle/android.jinja |
| @@ -1,6 +1,23 @@ |
| {# Copyright 2016 The Chromium Authors. All rights reserved. #} |
| {# Use of this source code is governed by a BSD-style license that can be #} |
| {# found in the LICENSE file. #} |
| +{% macro expand_sourceset(variables, prefix) %} |
|
agrieve
2017/01/12 21:28:35
fancy!
Peter Wen
2017/01/18 20:54:40
Acknowledged.
|
| +{% if variables is defined %} |
| + {{ prefix }}.manifest.srcFile "{{ variables.android_manifest }}" |
|
agrieve
2017/01/12 21:28:35
nit: might as well put this in the block below. e.
Peter Wen
2017/01/18 20:54:40
Done.
|
| + {{ prefix }} { |
| + java.srcDirs = [ |
| +{% for path in variables.java_dirs %} |
| + "{{ path }}", |
| +{% endfor %} |
| + ] |
| + jniLibs.srcDirs = [ |
| +{% for path in variables.jni_libs %} |
| + "{{ path }}", |
| +{% endfor %} |
| + ] |
| + } |
| +{% endif %} |
| +{% endmacro %} |
| // Generated by //build/android/generate_gradle.py |
| {% if template_type in ('android_library', 'android_junit') %} |
| @@ -32,20 +49,9 @@ android { |
| } |
| {% endfor %} |
| - main.manifest.srcFile "{{ android_manifest }}" |
| - |
| - {{ sourceSetName }} { |
| - java.srcDirs = [ |
| -{% for path in java_dirs %} |
| - "{{ path }}", |
| -{% endfor %} |
| - ] |
| - jniLibs.srcDirs = [ |
| -{% for path in jni_libs %} |
| - "{{ path }}", |
| -{% endfor %} |
| - ] |
| - } |
| +{{ expand_sourceset(main, 'main') }} |
| +{{ expand_sourceset(test, 'test') }} |
| +{{ expand_sourceset(android_test, 'androidTest') }} |
| } |
| } |