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

Side by Side Diff: build/android/gradle/android.jinja

Issue 2621413002: Android: Split up build.gradle.jinja (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 {# Copyright 2016 The Chromium Authors. All rights reserved. #} 1 {# Copyright 2016 The Chromium Authors. All rights reserved. #}
2 {# Use of this source code is governed by a BSD-style license that can be #} 2 {# Use of this source code is governed by a BSD-style license that can be #}
3 {# found in the LICENSE file. #} 3 {# found in the LICENSE file. #}
4 // Generated by //build/android/generate_gradle.py 4 // Generated by //build/android/generate_gradle.py
5 {% if template_type == 'root' %}
6
7 buildscript {
8 repositories {
9 jcenter()
10 }
11 dependencies {
12 classpath "com.android.tools.build:gradle:2.2.3"
13 }
14 }
15
16 {% elif template_type in ('java_library', 'java_binary') %}
17
18 apply plugin: "java"
19 {% if template_type == 'java_binary' %}
20 apply plugin: "application"
21 {% endif %}
22
23 sourceSets {
24 main {
25 java.srcDirs = [
26 {% for path in java_dirs %}
27 "{{ path }}",
28 {% endfor %}
29 ]
30 }
31 }
32
33 sourceCompatibility = JavaVersion.VERSION_1_7
34 targetCompatibility = JavaVersion.VERSION_1_7
35
36 {% if template_type == 'java_binary' %}
37 mainClassName = "{{ main_class }}"
38 applicationName = "{{ target_name }}"
39 {% endif %}
40 {% if template_type in ('java_binary', 'java_library') %}
41 archivesBaseName = "{{ target_name }}"
42 {% endif %}
43
44 {% else %}
45 5
46 {% if template_type in ('android_library', 'android_junit') %} 6 {% if template_type in ('android_library', 'android_junit') %}
47 apply plugin: "com.android.library" 7 apply plugin: "com.android.library"
48 {% elif template_type == 'android_apk' %} 8 {% elif template_type == 'android_apk' %}
49 apply plugin: "com.android.application" 9 apply plugin: "com.android.application"
50 {% endif %} 10 {% endif %}
51 11
52 android { 12 android {
53 compileSdkVersion {{ compile_sdk_version }} 13 compileSdkVersion {{ compile_sdk_version }}
54 buildToolsVersion "{{ build_tools_version }}" 14 buildToolsVersion "{{ build_tools_version }}"
(...skipping 26 matching lines...) Expand all
81 {% endif %} 41 {% endif %}
82 java.srcDirs = [ 42 java.srcDirs = [
83 {% for path in java_dirs %} 43 {% for path in java_dirs %}
84 "{{ path }}", 44 "{{ path }}",
85 {% endfor %} 45 {% endfor %}
86 ] 46 ]
87 } 47 }
88 } 48 }
89 } 49 }
90 50
91 {% endif %} 51 {% include 'dependencies.jinja' %}
92 {% if template_type != 'root' %}
93 52
94 dependencies {
95 {% for path in prebuilts %}
96 {{ depCompileName }} files("{{ path }}")
97 {% endfor %}
98 {% for proj in java_project_deps %}
99 {{ depCompileName }} project(":{{ proj }}")
100 {% endfor %}
101 {% for proj in android_project_deps %}
102 {{ depCompileName }} project(path: ":{{ proj }}", configuration: "debug")
103 {% endfor %}
104 }
105
106 {% if template_type.startswith('android') %}
107 android.variantFilter { variant -> 53 android.variantFilter { variant ->
108 if (variant.buildType.name.equals('release')) { 54 if (variant.buildType.name.equals('release')) {
109 variant.setIgnore(true); 55 variant.setIgnore(true);
110 } 56 }
111 } 57 }
112 58
113 afterEvaluate { 59 afterEvaluate {
114 def tasksToDisable = tasks.findAll { 60 def tasksToDisable = tasks.findAll {
115 return (it.name.equals('generateDebugSources') // causes unwanted Andro idManifest.java 61 return (it.name.equals('generateDebugSources') // causes unwanted Andro idManifest.java
116 || it.name.equals('generateReleaseSources') 62 || it.name.equals('generateReleaseSources')
117 || it.name.endsWith('Assets') 63 || it.name.endsWith('Assets')
118 || it.name.endsWith('BuildConfig') // causes unwanted BuildConf ig.java 64 || it.name.endsWith('BuildConfig') // causes unwanted BuildConf ig.java
119 {% if not use_gradle_process_resources %} 65 {% if not use_gradle_process_resources %}
120 || it.name.endsWith('Resources') 66 || it.name.endsWith('Resources')
121 || it.name.endsWith('ResValues') 67 || it.name.endsWith('ResValues')
122 {% endif %} 68 {% endif %}
123 || it.name.endsWith('Aidl') 69 || it.name.endsWith('Aidl')
124 || it.name.endsWith('Renderscript') 70 || it.name.endsWith('Renderscript')
125 || it.name.endsWith('Shaders')) 71 || it.name.endsWith('Shaders'))
126 } 72 }
127 tasksToDisable.each { Task task -> 73 tasksToDisable.each { Task task ->
128 task.enabled = false 74 task.enabled = false
129 } 75 }
130 } 76 }
131
132 {% endif %}
133 {% endif %}
OLDNEW
« no previous file with comments | « no previous file | build/android/gradle/build.gradle.jinja » ('j') | build/android/gradle/generate_gradle.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698