Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2906)

Unified Diff: build/android/gradle/android.jinja

Issue 2633533002: Android: Instrumentation tests in gradle (Closed)
Patch Set: Fix per review. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/gradle/dependencies.jinja » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gradle/android.jinja
diff --git a/build/android/gradle/android.jinja b/build/android/gradle/android.jinja
index 5dba39daeb0ecedfdc55bd1e9306ff3e1c2428ec..b4b934092a900dd12f78ee37853c109fe5450a16 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) %}
+{% if variables is defined %}
+ {{ prefix }} {
+ manifest.srcFile "{{ variables.android_manifest }}"
+ 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') }}
}
}
« no previous file with comments | « no previous file | build/android/gradle/dependencies.jinja » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698